-
Notifications
You must be signed in to change notification settings - Fork 73
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
feat: create-track command #2024
base: main
Are you sure you want to change the base?
Conversation
2c7c1e4
to
f0f3545
Compare
🎄 |
f0f3545
to
f049aa9
Compare
(Rebased on main to fix conflicts) |
thanks for working on this @lengau ... dumb question. I'm hoping this is an "easy" port to snapcraft too? |
@addyess I'm not actually sure, as I don't know how snapcraft currently generates its store macaroon. If it does it in a way that's easily compatible with the publisher gateway, it should be fairly easy. Do you have an open feature request on the snapcraft side where I could pop this PR so we don't reinvent the wheel when we do it? |
oof -- nope i don't have anything like that open. I suppose i can always go write one :D |
@@ -15,7 +15,7 @@ craft-grammar==2.0.1 | |||
craft-parts==2.1.3 | |||
craft-platforms==0.4.0 | |||
craft-providers==2.0.4 | |||
craft-store==3.0.2 | |||
craft-store @ git+https://github.com/canonical/craft-store@work/charmcraft-1901 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
craft-store @ git+https://github.com/canonical/craft-store@work/charmcraft-1901 | |
craft-store==3.1.0 |
# "craft-store>=3.0.0", | ||
"craft-store @ git+https://github.com/canonical/craft-store@work/charmcraft-1901", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# "craft-store>=3.0.0", | |
"craft-store @ git+https://github.com/canonical/craft-store@work/charmcraft-1901", | |
"craft-store>=3.1.0", |
For example: | ||
$ charmcraft create-track my-charm track-1 track-2 | ||
Name Created at Automatic phasing percentage | ||
--------- -------------------- ------------------------------ | ||
track-1 2024-12-10T23:48:40Z | ||
track-2 2024-12-11T00:14:24Z | ||
latest 2023-04-17T23:55:07Z |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to satisfy RST.
However, from what I know general suggestion is not to put examples in the overview
For example: | |
$ charmcraft create-track my-charm track-1 track-2 | |
Name Created at Automatic phasing percentage | |
--------- -------------------- ------------------------------ | |
track-1 2024-12-10T23:48:40Z | |
track-2 2024-12-11T00:14:24Z | |
latest 2023-04-17T23:55:07Z | |
For example:: | |
$ charmcraft create-track my-charm track-1 track-2 | |
Name Created at Automatic phasing percentage | |
--------- -------------------- ------------------------------ | |
track-1 2024-12-10T23:48:40Z | |
track-2 2024-12-11T00:14:24Z | |
latest 2023-04-17T23:55:07Z |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe doing this will subsequently mess up command-line help messages and we'll have another task à la canonical/craft-cli#306. So maybe it would be easier to remove this altogether and move the example into docs if it's wanted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I've adjusted instead to tell people how to request a track guardrail.
@@ -2374,3 +2374,73 @@ def _get_architectures_from_bases( | |||
for architecture in base.architectures: | |||
architectures.add(architecture) | |||
return sorted(architectures) | |||
|
|||
|
|||
class CreateTrack(CharmcraftCommand): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about adding any tests for this Command and/or new Service API 😄 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The initial version didn't really have enough logic in it to write tests against, but I realised I probably shouldn't be pushing all tracks back, so I've filtered it and that was sufficient excuse to write tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, and I just realised I didn't include my spread test changes originally. Oops!
4d64ae4
to
c42741d
Compare
Adds a
create-track
command right in time for Christmas for @addyessRequires canonical/craft-store#240
CRAFT-3424