Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
added support for uploading snap packages directly to the Ubuntu Store. #197
Conversation
kyrofa
reviewed
Dec 23, 2015
| + ], | ||
| + tests_require=[ | ||
| + 'click_toolbelt>=0.4.0', | ||
| + ], |
|
Please add your new dependencies to the |
kyrofa
added
the
enhancement
label
Dec 23, 2015
sergiusens
reviewed
Jan 4, 2016
| + """Upload snap package to the Ubuntu Store.""" | ||
| + | ||
| + # make sure the full lifecycle is executed | ||
| + snap = lifecycle.execute('strip') |
sergiusens
Jan 4, 2016
Collaborator
you probably want to run the snap command here. This produces no snap.
Maybe some code reorg is needed if the snap command becomes common and just calling snap.main() is to cumbersome (or ugly).
|
Thanks a lot Ricardo! It would also be nice to upload a real snap to the staging server, maybe once every night, but that would require us to keep some credentials in jenkins. I'll discuss about it with @fgimenez. |
elopio
reviewed
Jan 11, 2016
| + 'stage to create it.', output) | ||
| + self.assertIn('Uploading {}'.format(snap_file_path), output) | ||
| + self.assertIn('Package scan completed.', output) | ||
| + self.assertIn('{} upload failed'.format(snap_file_path), output) |
elopio
Jan 11, 2016
Member
Yes, that's what I had in mind.
I'd prefer to put the whole expected message in a var, maybe as a regex if there are things you want to ignore, and then make one assertion for the output, but that's just a nit.
What I think we need now is to check successful scenarios with a fake server.
elopio
reviewed
Jan 11, 2016
| @@ -0,0 +1,50 @@ | ||
| +# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- | ||
| +# | ||
| +# Copyright (C) 2015 Canonical Ltd |
sergiusens
reviewed
Jan 27, 2016
| + self.assertThat(snap_file_path, FileExists()) | ||
| + | ||
| + self.assertIn('Snap assemble_1.0_amd64.snap not found. Running snap ' | ||
| + 'stage to create it.', output) |
sergiusens
Jan 27, 2016
Collaborator
can you s/stage to/step to to avoid confusion with the stage step?
sergiusens
reviewed
Jan 27, 2016
| # mccabe in 'warning' mode as we have high complexity | ||
| mccabe_list= | ||
| - for unit in $(find snapcraft -type f -name '*.py') | ||
| + for unit in $(find snapcraft -type f -name '*.py' -not -path 'snapcraft/vendor/*') |
sergiusens
reviewed
Jan 27, 2016
| @@ -70,7 +65,7 @@ run_static_tests(){ | ||
| run_unit_tests(){ | ||
| if which python3-coverage >/dev/null 2>&1; then | ||
| python3-coverage erase | ||
| - python3-coverage run --branch --source snapcraft -m unittest discover -s snapcraft -t . | ||
| + python3-coverage run --branch --source snapcraft --omit 'snapcraft/vendor/*' -m unittest discover -s snapcraft -t . |
sergiusens
reviewed
Jan 27, 2016
| + | ||
| + if not os.path.exists(snap_name): | ||
| + logger.info( | ||
| + 'Snap {} not found. Running snap stage to create it.'.format( |
sergiusens
reviewed
Jan 27, 2016
| + | ||
| +def main(argv=None): | ||
| + """Upload snap package to the Ubuntu Store.""" | ||
| + |
sergiusens
Jan 27, 2016
Collaborator
For help to work, we need this here:
argv = argv if argv else []
args = docopt(__doc__, argv=argv)
sergiusens
reviewed
Jan 27, 2016
| + | ||
| +def main(argv=None): | ||
| + """Forget credentials for Ubuntu One SSO.""" | ||
| + |
sergiusens
Jan 27, 2016
Collaborator
For help to work, we need this here:
argv = argv if argv else []
args = docopt(__doc__, argv=argv)
sergiusens
reviewed
Jan 27, 2016
| + | ||
| + | ||
| +def main(argv=None): | ||
| + """Authenticates session against Ubuntu One SSO.""" |
sergiusens
Jan 27, 2016
Collaborator
For help to work, we need this here:
argv = argv if argv else []
args = docopt(__doc__, argv=argv)|
Looks pretty good, the only thing I think is missing is some sort of upload progress
Thanks for working on this btw, we really appreciate the contribution!!!! |
|
I'm sorry to say the error seen here makes little sense to me, it might just be a network error, in any case, mind doing a:
|
|
OK, I've decided to let this in as is, thanks. I've logged https://bugs.launchpad.net/snapcraft/+bug/1538692 |
ricardokirkner commentedDec 23, 2015
authenticated session for the upload process