-
Notifications
You must be signed in to change notification settings - Fork 32
Add docs-builder release-notes create command #2298
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
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.
wow. thank you for the contribution.
| app.Add<ServeCommand>("serve"); | ||
| app.Add<IndexCommand>("index"); | ||
| app.Add<FormatCommand>("format"); | ||
| app.Add<ReleaseNotesCommand>("release-notes"); |
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.
Nit: I think we should adjust the naming a bit.
From my understanding this is a single entry within release notes. Right now, it could confuse users to think it already creates the full release notes.
I don't know what would be a good terminology. I know the term "Changeset" for a single unit. But I'm also not sure if this is the most fitting in our case.
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 initially proposed to have all release-notes commands under release-notes
docs-builder release-notes create
I am not opposed to split it into
docs-builder changelog add
That way release-notes commands operate over N changelog entries.
Where changelog is used for single changelog commands (which most people will use).
changelog matches the proposed docs/changelog location (already in use by elastic/elasticsearch).
| # Maps PR labels to "product" field | ||
| # Add mappings for your products, e.g.: | ||
| product: | ||
| product:elasticsearch: elasticsearch |
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.
Does this syntax actually work?
I imagine yaml parsers could get confused by multiple colons (:) in a single line.
| var yaml = serializer.Serialize(data); | ||
|
|
||
| // Add schema comments | ||
| var sb = new StringBuilder(); |
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 think it would be nice for maintainability if this was a template.
Maybe for now it's just enough to use a raw string literal.
|
Another thing that would be nice.. but probably as a follow-up is somehthing like an interactive form. If you don't provide all the args, the CLI asks you. Similar to (gh cli) |
| /// </summary> | ||
| /// <param name="title">Required: A short, user-facing title (max 80 characters)</param> | ||
| /// <param name="type">Required: Type of change (feature, enhancement, bug-fix, breaking-change, etc.)</param> | ||
| /// <param name="products">Required: Products affected in format "product target lifecycle, ..." (e.g., "elasticsearch 9.2.0 ga, cloud-serverless 2025-08-05")</param> |
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 wonder if applies_to could be the base for it.
Not sure if we can align the syntax. (Also applies_to must be extended to also support dates)
I guess we cannot do this now.. but aligning this in the future could be nice.
I definitely see a connection.
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 don't think we need to put dates any longer.
Since in our proposal we would discover what serverless release these go out.
| @@ -0,0 +1,92 @@ | |||
| # Release Notes Configuration | |||
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.
This file should live in docs/changelog.yml
| } | ||
|
|
||
| // Generate unique ID if not provided | ||
| var id = input.Id ?? GenerateUniqueId(input.Title, input.Pr ?? string.Empty); |
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.
We don't need id's, the pr-filename.yml is the id.
| /// <param name="products">Required: Products affected in format "product target lifecycle, ..." (e.g., "elasticsearch 9.2.0 ga, cloud-serverless 2025-08-05")</param> | ||
| /// <param name="subtype">Optional: Subtype for breaking changes (api, behavioral, configuration, etc.)</param> | ||
| /// <param name="area">Optional: Area(s) affected (comma-separated or specify multiple times)</param> | ||
| /// <param name="pr">Optional: Pull request URL</param> |
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.
This can just be the pull request number (we can get the github url from our configuration.Git
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.
Few changes but overall looks good 😍
It'd be nice if we can follow up with this with an interactive mode like gh pr create.
EDIT: @reakaleek already mentioned that :)
This PR adds a docs-builder command that generates a changelog YAML file.
It is derived from the "elastic-agent-changelog-tool new a-changeset-filename" workflow in https://github.com/elastic/elastic-agent-changelog-tool
For example:
That command creates a file named
1764714171-fixes-prevent-duplication-of-invalid-index-name-st.yamlthat contains:Everything is currently specified on the command line, with only three required options (
title,type, andproduct):Error handing
If you provide a value that doesn't match the schema, you get a warning but the changelog is still created.
For example:
Perhaps that ought to be an error instead of a warning and block the creation of the changelog file, but for now I'll leave as a non-blocking warning.
Next steps
elastic-agent-changelog-tool newand require only a filename (per https://github.com/elastic/elastic-agent-changelog-tool/blob/main/docs/usage.md#adding-a-changelog-fragment). However, we'd want to add validation that the minimal information exists before a changelog is merged.--config <path>command option in case teams want to store the config file in different locations per repo. Currently, the command looks for it in a specific location:warn ::e.d.s.easeNotesService:: Release notes configuration not found at ...GitHub/docs-builder/.artifacts/publish/docs-builder/release/config/release-notes.yml, using defaults.That was the intention behind having a label mapping configuration file.
Generative AI disclosure
Tool(s) and model(s) used: composer-1 agent