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: snapcraft promote #2556

Merged
merged 7 commits into from May 8, 2019
Merged

cli: snapcraft promote #2556

merged 7 commits into from May 8, 2019

Conversation

sergiusens
Copy link
Collaborator

Create a snap Status/Status class to easily handle the state response
and construct a channel set to use with the promote command.

LP: #1827513
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?

Create a snap Status/Status class to easily handle the state response
and construct a channel set to use with the promote command.

LP: #1827513
Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
@codecov-io
Copy link

codecov-io commented May 7, 2019

Codecov Report

Merging #2556 into master will increase coverage by 0.12%.
The diff coverage is 93.1%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2556      +/-   ##
==========================================
+ Coverage   88.85%   88.98%   +0.12%     
==========================================
  Files         202      204       +2     
  Lines       13794    13941     +147     
  Branches     2088     2108      +20     
==========================================
+ Hits        12257    12405     +148     
+ Misses       1093     1091       -2     
- Partials      444      445       +1
Impacted Files Coverage Δ
snapcraft/storeapi/__init__.py 100% <100%> (ø) ⬆️
snapcraft/cli/_command_group.py 96.42% <100%> (+0.13%) ⬆️
snapcraft/storeapi/errors.py 85.67% <100%> (+0.43%) ⬆️
snapcraft/internal/build_providers/_snap.py 96.27% <100%> (+6.18%) ⬆️
snapcraft/cli/store.py 89.22% <90.9%> (+0.33%) ⬆️
snapcraft/storeapi/channels.py 92.3% <92.3%> (ø)
snapcraft/storeapi/status.py 93.15% <93.15%> (ø)
snapcraft/internal/elf.py 80.71% <0%> (-0.36%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c541fac...8206f99. Read the comment docs.

@cprov
Copy link
Contributor

cprov commented May 7, 2019

Thanks @sergiusens, the implementation looks good and easy to update to the actual promote endpoint when it exists in the store. Meanwhile, there is a remote possibility of revisions being partially promoted (if an attempt fails), running the same promotion command will fix it.

Copy link
Contributor

@cmatsuoka cmatsuoka left a comment

Choose a reason for hiding this comment

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

This is a very nice, elegantly coded and almost spotless implementation. Just added a few nitpicking comments about type annotations.

snapcraft/storeapi/status.py Outdated Show resolved Hide resolved
snapcraft/storeapi/status.py Outdated Show resolved Hide resolved
snapcraft/storeapi/status.py Outdated Show resolved Hide resolved
@sergiusens
Copy link
Collaborator Author

Thanks @cprov wrt promotion being individual releases, we do indeed suffer from this possibily, just like on the web interface, although it is easier to surface on a GUI than on a CLI

Thanks for the compliments @cmatsuoka, I will get to the type annotations.

@sergiusens sergiusens merged commit 375c735 into canonical:master May 8, 2019
@sergiusens sergiusens deleted the promote branch May 8, 2019 16:52
clobrano pushed a commit to clobrano-forks/snapcraft that referenced this pull request Jun 8, 2019
Create a snap Status/Status class to easily handle the state response
and construct a channel set to use with the promote command.

LP: #1827513
Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
Comment on lines +291 to +296
elif parsed_from_channel.risk == "edge" and parsed_from_channel.branch is None:
raise click.BadOptionUsage(
"{!r} is not a valid set value for --from-channel.".format(
parsed_from_channel
)
)
Copy link
Contributor

@kyrofa kyrofa Jun 14, 2020

Choose a reason for hiding this comment

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

What's up with this limitation? Bites me all the time. Why can't we promote from edge? It's documented right above as being valid, and we have a CI system that ONLY lands stuff in edge. Am I missing something?

@sergiusens
Copy link
Collaborator Author

sergiusens commented Jun 17, 2020 via email

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

5 participants