Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
| ) | ||
| if args.create_card: | ||
| if args.card_path is None: | ||
| args.card_path = str(Path(args.kernel_dir).resolve() / "README.md") |
There was a problem hiding this comment.
Not for this PR, but it would be nice to make all card paths Path and not str.
| upload_parser.add_argument( | ||
| "--create-pr", | ||
| action="store_true", | ||
| help="If set, it will create a PR on the repo-id (only used with --create-card).", | ||
| ) |
There was a problem hiding this comment.
I'd leave this out for the upload command. Having dependent options is not nice if not needed and it's strange that the kernel upload would not generate a PR, but the card would.
| upload_parser.add_argument( | ||
| "--create-card", | ||
| action="store_true", | ||
| help="If set, a templated system card will be generated from the kernel.", | ||
| ) | ||
| upload_parser.add_argument( | ||
| "--card-path", | ||
| type=str, | ||
| default=None, | ||
| help="Path to save the generated card to (only used with --create-card).", | ||
| ) | ||
| upload_parser.add_argument( | ||
| "--description", | ||
| type=str, | ||
| default=None, | ||
| help="Description to introduce the kernel (only used with --create-card).", | ||
| ) | ||
| upload_parser.add_argument( | ||
| "--create-pr", | ||
| action="store_true", | ||
| help="If set, it will create a PR on the repo-id (only used with --create-card).", | ||
| ) |
There was a problem hiding this comment.
I was thinking more of just uploading the card, not creating one. E.g. if the user changed the card, it's nice that it gets uploaded as well along with the kernels. Presumably they already have created the card before. That means we have to settle on the name though, since I think on the Hub the card is always README.md and the README.md in a kernel Git repo may contain different information (more relevant to kernel developers/contributors).
So, maybe we should standardize on using CARD.md in the top-level directory of a kernel repo for the card and then kernel upload would upload it to the Hub as README.md. This is also in line with how the rest of how kernel building works - we go for very opinionated, there is only one way to do it, to enforce standardized, declarative source layouts.
I think orthogonal subcommands are the best, so ideally there would be a create-card subcommand that only creates a card. Then the upload subcommand uploads the card to the Kernel Hub along with the kernel. Maybe upload could have an --only-card option to only upload the card, but the default of kernels upload should do the right thing: upload the latest build variants and the latest card.
kernels upload(and test)