Add documentation for how to use snapcraft upload. #277

Merged
merged 1 commit into from Jan 28, 2016

Conversation

Projects
None yet
4 participants
Member

kyrofa commented Jan 28, 2016

This PR resolves LP: #1539234 by adding a document that walks a developer through uploading a snap.

HACKING.md
+have an account on the [staging server](https://login.staging.ubuntu.com), then
+make sure you have the following environment variables defined:
+
+ UBUNTU_STORE_API_ROOT_URL='https://myapps.developer.staging.ubuntu.com/dev/api/'
@ricardokirkner

ricardokirkner Jan 28, 2016

Contributor

If we're considering documenting these environment variables, maybe it's best to just export a single variable to control whether STAGING or PRODUCTION is to be used to make developers life easier? (and we set the proper values based on that env var of flag internally).

@kyrofa

kyrofa Jan 28, 2016

Member

Not a bad idea. I'm not sure how often this will be used, honestly-- it's mostly here so I don't need to write it down somewhere else 😛 .

@elopio

elopio Jan 28, 2016

Member

Agree. I use it a lot, so I appreciate when I can run the tests just using STAGING instead of the full urls.
wishlist bug?

docs/upload-your-snap.md
+automated review. You'll be emailed when the review has completed, at which time
+you can visit the MyApps site and publish your .snap! Note that if you uploaded
+an update to an already-published .snap, your update will be automatically
+published as well unless you disable it in MyApps.
@ricardokirkner

ricardokirkner Jan 28, 2016

Contributor

When uploading via the web UI developers get the option not to automatically publish the update, but I think this doesn't apply to uploads via the API (which snapcraft uses), which means updates uploaded via snapcraft will be automatically published as well.

@kyrofa

kyrofa Jan 28, 2016

Member

Ah, and that's why you needed to read it! Thanks, fixing now.

Contributor

ricardokirkner commented Jan 28, 2016

LGTM overall.

HACKING.md
+
+### Staging server
+
+Snapcraft has the ability to upload .snaps for publication in the Snappy Store.
@elopio

elopio Jan 28, 2016

Member

I would just use the word snaps, without the .

HACKING.md
+### Staging server
+
+Snapcraft has the ability to upload .snaps for publication in the Snappy Store.
+If you're working on a feature that involves that stuff, you might want to use
@elopio

elopio Jan 28, 2016

Member

That involves what stuff?

HACKING.md
+If you're working on a feature that involves that stuff, you might want to use
+the staging server instead of the production store. To do that, make sure you
+have an account on the [staging server](https://login.staging.ubuntu.com), then
+make sure you have the following environment variables defined:
@elopio

elopio Jan 28, 2016

Member

s/make sure you have/set, and remove the "defined" at the end.

+ Enter your Ubuntu One SSO credentials.
+ Email: me@example.com
+ Password:
+ OTP: <press enter here if you haven't enabled two-factor authentication>
@elopio

elopio Jan 28, 2016

Member

@ricardokirkner can we change OTP for something more user friendly like One-time password?
Also can we show it only when 2fa is enabled?

@ricardokirkner

ricardokirkner Jan 28, 2016

Contributor

Printing a different string is certainly possible. Only requiring it for 2fa enabled accounts would require some non-trivial changes, essentially:

  1. attempt the login without asking (nor sending) the OTP
  2. if the login attempt fails, analyze the failure message and if the error is because an OTP is required, ask the user for it and retry step 1.
@kyrofa

kyrofa Jan 28, 2016

Member

We at least need a way to say "press enter if you don't have 2fa enabled" or something. Because I expect a lot of users would stop right there.

+ Password:
+ OTP: <press enter here if you haven't enabled two-factor authentication>
+ Authenticating against Ubuntu One SSO.
+ Starting new HTTPS connection (1): login.ubuntu.com
@elopio

elopio Jan 28, 2016

Member

@ricardokirkner could we not print this line?

@kyrofa

kyrofa Jan 28, 2016

Member

I'm working on prettying that up now as part of LP: #1538692.

@ricardokirkner

ricardokirkner Jan 28, 2016

Contributor

Possibly, would need investigating how to turn that off as that's being printed by urllib directly (under the hood)

@sergiusens

sergiusens Jan 28, 2016

Collaborator

Right, we solve this when using requests by upping the logging level for urllib.

docs/upload-your-snap.md
+
+Get into the directory containing the `snapcraft.yaml`, and do the following:
+
+ $ snapcraft upload
@elopio

elopio Jan 28, 2016

Member

Do you have to build it first, or snapcraft will build it if not found?

@kyrofa

kyrofa Jan 28, 2016

Member

It will build it if not found. Should I mention that?

@ricardokirkner

ricardokirkner Jan 28, 2016

Contributor

Possibly... it's a nice shortcut. Not sure how useful it'll be unless you're certain it'll built properly

+ Uploading files...
+ Starting new HTTPS connection (1): upload.apps.ubuntu.com
+ Uploading new version...
+ Starting new HTTPS connection (1): myapps.developer.ubuntu.com
@elopio

elopio Jan 28, 2016

Member

I would also hide this line.

@kyrofa

kyrofa Jan 28, 2016

Member

Yeah, also LP: #1538692.

+ Package scan completed.
+ Application uploaded successfully.
+ Uploaded as revision 1.
+ Please check out the application at: https://myapps.ubuntu.com/dev/click-apps/1337/.
@elopio

elopio Jan 28, 2016

Member

When you put a dot at the end of an URL, the most common mistake is to use the dot when copy-pasting it.

@kyrofa

kyrofa Jan 28, 2016

Member

Ah, I'll add that to the LP: #1538692 checklist.

docs/upload-your-snap.md
+Your .snap has now been uploaded to the store, and is now undergoing an
+automated review. You'll be emailed when the review has completed, at which time
+you can visit the MyApps site and publish your .snap! Note that if you uploaded
+an update to an already-published .snap, your update will be automatically
@elopio

elopio Jan 28, 2016

Member

uploaded an update is hard to say. What about uploaded a new version of an ...

@@ -323,7 +323,8 @@ We'll be happy to help you on the mailing list to build a snappy package of
anything that you are interested in. Choose a good name for it, and you can
very easily share it in
[ubuntu myapps](https://myapps.developer.ubuntu.com/dev/click-apps/?format=snap)
-where you go to share it with other snappy users.
+where you go to share it with other snappy users. You can even use Snapcraft to
+[upload for you](upload-your-snap.md)!
@elopio

elopio Jan 28, 2016

Member

Nice! Thanks for the great work @ricardokirkner.
And @kyrofa of course for documenting it.

Member

elopio commented Jan 28, 2016

This is great. Most of my comments are about things that can be reported as bugs for the future.

Add documentation for how to use snapcraft upload.
LP: #1539234

Signed-off-by: Kyle Fazzari <kyle@canonical.com>
Member

elopio commented Jan 28, 2016

oh, right. And I guess we need to discuss if we should use .snap or snap.

Member

kyrofa commented Jan 28, 2016

oh, right. And I guess we need to discuss if we should use .snap or snap.

Nahh, I already replaced them. No problem!

kyrofa added a commit that referenced this pull request Jan 28, 2016

Merge pull request #277 from kyrofa/bugfix/1539234/upload_documentation
Add documentation for how to use snapcraft upload.

@kyrofa kyrofa merged commit 83d9582 into snapcore:master Jan 28, 2016

1 of 2 checks passed

coverage/coveralls Coverage decreased (-0.0%) to 93.269%
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Collaborator

sergiusens commented Jan 28, 2016

👍 this will also make @dholbach very happy! 😄

@kyrofa kyrofa deleted the kyrofa:bugfix/1539234/upload_documentation branch Jan 29, 2016

smoser pushed a commit to smoser/snapcraft that referenced this pull request Sep 14, 2016

kalikiana pushed a commit to kalikiana/snapcraft that referenced this pull request Apr 6, 2017

Merge pull request #277 from kyrofa/bugfix/1539234/upload_documentation
Add documentation for how to use snapcraft upload.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment