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

cli: allow snap-id for validate #3349

Merged
merged 2 commits into from
Nov 9, 2020
Merged

cli: allow snap-id for validate #3349

merged 2 commits into from
Nov 9, 2020

Conversation

sergiusens
Copy link
Collaborator

Info API can only retrieve snap-id's for what is publicly available,
workaround the issue by allowing for using the snap-id as a fallback
to the snap-name.

LP: #1902913

Signed-off-by: Sergio Schvezov sergio.schvezov@canonical.com

  • Have you followed the guidelines for contributing?
  • Have you signed the CLA?
  • Have you successfully run ./runtests.sh static?
  • Have you successfully run ./runtests.sh tests/unit?

Info API can only retrieve snap-id's for what is publicly available,
workaround the issue by allowing for using the snap-id as a fallback
to the snap-name.

LP: #1902913

Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
@nessita
Copy link
Contributor

nessita commented Nov 4, 2020

Thank you Sergio for working on this!

I've reviewed the code and it looks good to me. I would just mention that I think there are no unit tests added for the newly added if branch, do you think that's something doable/worth it?

@sergiusens
Copy link
Collaborator Author

Thanks @nessita. That code path is tested through the test_validate case we have which leverages our fake store servers.

We have a long lasting tech debt to move this block of code closer to where the unit test lives, _store.py is scheduled to disappear.

cjp256
cjp256 previously approved these changes Nov 4, 2020
@sergiusens
Copy link
Collaborator Author

In case you want to try this out:

snap install snapcraft --classic --channel edge/pr-3349

Or refresh

snap refresh snapcraft --channel edge/pr-3349

@nessita
Copy link
Contributor

nessita commented Nov 5, 2020

I've tested this and it's not working since the added variable snap_id is colliding with an already existing snap_id. I think the new one should be named approved_snap_id or similar.

@sergiusens
Copy link
Collaborator Author

that should be fixed and more thoroughly tested now

@nessita
Copy link
Contributor

nessita commented Nov 5, 2020

I can confirm this now works as expected.

Copy link
Contributor

@cjp256 cjp256 left a comment

Choose a reason for hiding this comment

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

LGTM

@sergiusens sergiusens merged commit 1fc64e4 into master Nov 9, 2020
@sergiusens sergiusens deleted the 4.4+validations branch November 9, 2020 18:52
abitrolly pushed a commit to abitrolly/snapcraft that referenced this pull request Mar 31, 2021
Info API can only retrieve snap-id's for what is publicly available,
workaround the issue by allowing for using the snap-id as a fallback
to the snap-name.

LP: #1902913

Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
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.

None yet

3 participants