Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Send HTTP GET header with settings when looking for a 'package_reference' #8046

Merged
merged 10 commits into from
Nov 13, 2020

Conversation

jgsogo
Copy link
Contributor

@jgsogo jgsogo commented Nov 11, 2020

Changelog: Feature: Add headers with settings and options to HTTP GET requests when searching for packages.
Docs: Omit

closes #7870

Conan sends a request header Conan-PkgID-Settings when looking for a pref in the remotes:

  • if using revisions, it is sent when looking for the latest package revision, URL like:

    v2/conans/<reference>/revisions/<rrev>/packages/<package_id>/latest
    
  • if not using revisions, it is in the downloads_url:

    v1/conans/<reference>/packages/<package_id>/download_urls
    

These are the headers, do we want this information in a single header? do we want to use different names?

Conan-PkgID-Settings
Conan-PkgID-Options

#REVISIONS: 1

@jgsogo jgsogo added this to the 1.32 milestone Nov 11, 2020
Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@@ -107,9 +110,9 @@ def _evaluate_remote_pkg(self, node, pref, remote, remotes):
# If the "remote" came from the registry but the user didn't specified the -r, with
# revisions iterate all remotes
if not remote or (not remote_info and self._cache.config.revisions_enabled):
for r in remotes.values():
for r in remotes.values(): # FIXME: Here we hit the same remote we did before
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch

conans/client/conan_api.py Outdated Show resolved Hide resolved
Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure that it won't break different servers like Artifactory, Bintray, etc.

@jgsogo
Copy link
Contributor Author

jgsogo commented Nov 13, 2020

I've tried a local Artifactory in docker, my Bintray account, and a cloud Artifactory (staging environment for ConanCenter).

@jgsogo jgsogo marked this pull request as ready for review November 13, 2020 16:32
@memsharded memsharded merged commit 014a545 into conan-io:develop Nov 13, 2020
@jgsogo jgsogo deleted the feat/7870-search-request-data branch November 17, 2020 10:35
redradist pushed a commit to redradist/conan that referenced this pull request Sep 12, 2021
…_reference' (conan-io#8046)

* pass settings to the remote_manager

* basic implementation

* add tests

* add comments

* call function from test requires argument

* add parameter to None

* list options too in headers too

* handle info variable with care

* get the value from the one assigned by the test environment

* add default argument
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature] Identify configuration in remote requests when querying for a packageID
3 participants