Page MenuHomeSoftware Heritage

pytest_plugin: Add support for http request (debian lister related)
ClosedPublic

Authored by ardumont on Oct 12 2019, 5:12 AM.

Details

Summary

Add support for both http and https support.
Now a request resolves to a local file in <https?>_<hostname>, for example:

Related T2032

Test Plan

tox

Diff Detail

Repository
rDCORE Foundations and core functionalities
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

olasd requested changes to this revision.Oct 14 2019, 4:02 PM
olasd added a subscriber: olasd.

I'm a bit worried that this pulls http and https from the same set of files without distinction; This looks like a good catalyst for subtle single-character bugs.

Could we make the top-level directory <domain_name>_http or http_<domain_name> for http-only requests? (And maybe add support for https_<domain_name> for symmetry)

swh/core/pytest_plugin.py
172

Please use s? rather than the very verbose [s]{0,1}.

This revision now requires changes to proceed.Oct 14 2019, 4:02 PM

Could we make the top-level directory <domain_name>_http or http_<domain_name> for http-only requests?

yes, totally

(And maybe add support for https_<domain_name> for symmetry)

I'm for symmetry but I'm a bit worried about the amount of work on my pile of diffs that this implies...
(for the https part, for http only debian code is impacted so fine)

I'd rather change that after merging the package-loader branch if you don't mind.

swh/core/pytest_plugin.py
172

sure.

I have no strong opinion on this. olsad's idea might be an acceptable solution.

(And maybe add support for https_<domain_name> for symmetry)

I'm for symmetry but I'm a bit worried about the amount of work on my pile of diffs that this implies...
(for the https part, for http only debian code is impacted so fine)

I'd rather change that after merging the package-loader branch if you don't mind.

It's really just a mv of the top level directory; But I was really suggesting adding support, not replacing the current implementation.

It's really just a mv of the top level directory; But I was really suggesting adding support, not replacing the current implementation.

yes, I meant in terms of rebase but mostly arc diff --update... mess.

Update according to the right suggestion of not mixing http/https data folder

This revision is now accepted and ready to land.Oct 14 2019, 4:52 PM

I'd rather change that after merging the package-loader branch if you don't mind.

oh well, after some bike thinking, might as well do it now.

Update to look for file in top-level directory as <http_scheme>_<hostname>