-
Notifications
You must be signed in to change notification settings - Fork 74
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
[Change Proposal] Enforcing structure inside changelog.yml
files
#140
Comments
I think I talked with @masci about this. Massi suggested to leverage from semver and introduce here th "prerelease" tag. We can later tweak our scripts to check the relation between:
I think we follow the same path with package-registry. I'm not sure if the step 3. is mandatory, but maybe it's better to enforce it. |
I'm good with this idea but would like understand what it looks like in practice. Could you come up with a snippet that shows a package's
Which scripts are you thinking of implementing these checks in? I was wondering if this is a good fit for #47. But if there's an easier/quicker way to implement this, I'm open to it. |
Let me think loud - The package is marked with The
|
@mtojek Got it, thanks for the explanation. I'm ++ for implementing I do think we also need validation of CHANGELOG files for this part:
... as nothing is requiring a developer to use |
This will also require that the |
* Update dependency on package-spec * Fix: make check
Related: #167. |
This issue is partially resolved via #172. @mtojek the part that is left unresolved (for me) is whether we should have additional validation about the first version entry inside |
I found out that the comment I think the only cure for this is strict validation (including |
Hello, there have been some work in creating a dedicated tool to manage the changelog: https://github.com/elastic/elastic-agent-changelog-tool I've been working on it for some time, and it could help resolve the mentioned issues, with the advantage of fitting better in the new semver based release model we are going to adopt. It has not been developed to target integrations (mainly Agent/Beats) but I think it's worth to discuss if we want to reuse it here too. The general idea is to create a |
What is the difference between fragments and the |
Instead of having a single changelog, you have multiple independent fragments. This prevents the multiple consequent conflicts that happen when there is high activity on a package. For example this is what recently happened to This is the snapshot of currently opened PRs: Each of this PRs conflict with each other in 2 things:
By using fragments this would not happen because (see this example):
By postponing building the changelog and assigning the version at release time is possible to work in parallel without introducing conflicts only in the changelog declarations. |
It's my personal view: I find editing the changelog inconvenient for Beats as for Integrations, but I don't see an issue in modifying a single changelog file by multiple contributors. It's a matter of skills to rebase and merge PRs. It would be awesome if we don't need to update the changelog or fragments at all. For example, in the elastic-package project, we're using GoReleaser to generate it from commit messages. Personally, I find it really convenient as I don't have to care about it at all :) Any thoughts about this @elastic/ecosystem? |
Not really. Is not the technical difficulty that is a blocker here. It's a matter of each PR someone merge creates conflicts in others that target the same package. So each time someone has to rebase, wait for tests to pass again and merge. If these someone do not sync, multiple people can rebase their PR, trigger test runs and see their PR fail again with the same conflict, because someone else has been faster in merging their PR. With multiple contributions this issue delays merging, and adds up to the risk of having stale PRs (especially for external contributors).
Indeed, but:
The fragment proposal is similar to how other OSS projects with high activity handle this (i.e. Ansible, Elasticsearch) |
This is a valid concern and something we should tackle eventually. It's also about money burned on CI runs. I'm wondering if fragments can be an intermittent form of changelog, which is transformed into a built form (single
I'd love to read about those. Do you have any write-ups/links describing those approaches? |
Indeed! There is the concept of a "consolidated changelog", where all fragments are gathered together in a form similar to the current changelog. |
One thing I would like to mention is that current changelog format is only expected to be like that for the final artifact. Each development team could decide how to build it. For example during development they could keep a dummy changelog, and build the final changelog to be included in the final package with whatever tool they want. @endorama could https://github.com/elastic/elastic-agent-changelog-tool generate changelogs in the format of the package spec? Or we would need to modify the spec to accept the format generated by this tool? We would still need to think though on how to solve pain points in the integrations monorepo. It may make sense to introduce the use of fragments there. Also, to facilitate this kind of approaches, we would need to be less strict on what can be included in
Do we need to modify the version on every change? It should be possible to use a prerelease suffix to combine multiple changes. If this is not possible now we may need to iterate on the experience on this.
Something like GoReleaser may not work so well for a monorepo like integrations, some layer would be needed to detect what changes belong to what integration, this may be complex. Also, GoReleaser creates a changelog entry for every change. I find this okish for developer tools, but for more user-facing I think it is better to decide what to include. So some manual curation is probably always going to be needed in packages. |
The tool has the concept of rendering a consolidated changelog. The current format we are focusing on is Asciidoc to be included in release notes, but is possible to support any format by adding the dedicated renderer.
No we do not, and we could improve the process around releasing packages, better managing and syncing multiple teams working on the same package. But I think there is greater leverage in addressing the issue without adding another process (which may also be very complex to manage for external contributors).
I've yet to try this (as I'm still a bit confused around version changes and migration to package storage v2), but this would not really solve the conflict issue and would need a stricter release process for packages (complex with multiple data stream granularity ownership). I think using fragments will help in flexibility and will remove a current source of rework in our PRs, while also helping in structuring our release process. |
Today discussing with @kaiyan-sheng and @gsantoro an use case emerged that the current changelog structure makes very hard: doing small related PRs incurs in multiple conflicts in the changelog file, which encourage a big PR approach and slows down iterating on integrations. |
I need to iterate on this comment:
As per development guidelines the package version must be updated every time, otherwise the package is not added to the snapshot storage, creating issues for package promotion. I can confirm this is still the case as I added multiple PRs to |
You need to follow a different workflow.
I wanted to highlight that I don't undermine your complaint regarding version handling, rather the opposite, as I'm total with you that it isn't straightforward and concerning. I guess that we can rediscuss it and review your proposal on fragments. |
Just adding that in tool v0.4.0 (still unreleased at the moment) we added support for custom templates when rendering a consolidated changelog. For templating |
Problem statement
With #131, packages are now expected to have a
changelog.yml
file in their root folders. That PR introduced the structure (syntax) for package changelogs but there are two unanswered questions about the semantics of the changelog entries:in the package's
changelog.yml
file, where should unreleased changes be stored?what should be the relationship of the
version
specified in a package'smanifest.yml
file to any of the versions specified in the package'schangelog.yml
file?Proposal
The structure of package's
changelog.yml
files is expected to be like so:next
, that is expected to be first entry in the top-level array inchangelog.yml
files (wherex.y.z
is in the snippet above). All thechanges
under this version will be unreleased ones.changelog.yml
files (wherep.q.r
is in the snippet above) matches exactly the value ofversion
in the package'smanifest.yml
file.This allows a package developer to accumulate unreleased changes in the changelog under the first entry (
next
). When the package developer is ready to release a new version of the package, they do the following, all as part of a single PR:version
in their package'smanifest.yml
,next
with the new value ofversion
in their package'smanifest.yml
, andnext
entry at the top of their package'schangelog.yml
file with an empty list ofchanges
under it.The text was updated successfully, but these errors were encountered: