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

store: implement push pre-check. #1009

Merged
merged 5 commits into from Jan 6, 2017

Conversation

squidsoup
Copy link
Contributor

LP: #1610776

This branch adds a precheck request to the store to snapcraft push, which in the case of an unregistered snap will report the error to the user before attempting a full upload.

@codecov-io
Copy link

codecov-io commented Dec 20, 2016

Current coverage is 96.34% (diff: 84.21%)

Merging #1009 into master will decrease coverage by 0.02%

@@             master      #1009   diff @@
==========================================
  Files           194        194          
  Lines         17251      17286    +35   
  Methods           0          0          
  Messages          0          0          
  Branches       1338       1339     +1   
==========================================
+ Hits          16625      16654    +29   
- Misses          425        431     +6   
  Partials        201        201          

Powered by Codecov. Last update f467e55...0d4bf8a

Copy link
Contributor

@kyrofa kyrofa left a comment

Choose a reason for hiding this comment

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

This looks good, just a quick question.

snap_yaml = _get_data_from_snap_file(snap_filename)
snap_name = snap_yaml['name']
store = storeapi.StoreClient()

with _requires_login():
store.push_precheck(snap_name)
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this step take any significant amount of time? Should a message be printed about what it's doing in case it hangs at all?

Copy link
Collaborator

Choose a reason for hiding this comment

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

or do this after logging the message for which I want to change anyways ;-)

@squidsoup
Copy link
Contributor Author

squidsoup commented Dec 20, 2016 via email

@kyrofa
Copy link
Contributor

kyrofa commented Dec 22, 2016

Maybe "Checking snap status in store..."?

Yeah that's fine, or even as opaque as "Checking with the store..." would be fine. The reason here is I think twofold:

  • Even though this isn't a step of which the user needs to be explicitly aware, this would provide a better experience if issues do happen.
  • If issues do happen, this makes the log more useful to us, the people triaging the bug report.

with _requires_login():
store.push_precheck(snap_name)

logger.info('Uploading {}.'.format(snap_filename))
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we take the opportunity to call change this to 'Pushing {!r}'?

@sergiusens sergiusens changed the title Implement push pre-check. store: implement push pre-check. Jan 3, 2017
squidsoup and others added 2 commits January 5, 2017 22:36
Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
Copy link
Contributor

@kyrofa kyrofa left a comment

Choose a reason for hiding this comment

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

Yeah that seems fine.

@sergiusens sergiusens merged commit 8d7b53a into canonical:master Jan 6, 2017
kalikiana pushed a commit to kalikiana/snapcraft that referenced this pull request Apr 6, 2017
LP: #1610776

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

4 participants