-
Notifications
You must be signed in to change notification settings - Fork 319
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
Assemble changelog only in PRs comments #6783
Conversation
Why? Is this because of some restrictions on the main branch? |
Can we print the changelog automatically in the PR? Like we do with codecov? Because I seriously doubt that someone will manually run the script. |
Codecov Report
@@ Coverage Diff @@
## main #6783 +/- ##
=========================================
Coverage 72.50% 72.50%
Complexity 5550 5550
=========================================
Files 779 779
Lines 30067 30067
Branches 3548 3548
=========================================
Hits 21801 21801
Misses 6841 6841
Partials 1425 1425 |
release train will assemble the changelog automatically and open and merge the PR, right? Or release duty will have to do it manually? |
BTW, what is the flow now. I add a single changelog entry and merge pr without updating CHANGELOG.md. During release we assemble changelog changelog from entries and remove them. is my understanding correct? |
yes, it's a protected branch. I remember that I had similar issue automating something. |
the release train will do it automatically |
yes, I mentioned it here |
changelog/README.md
Outdated
|
||
Every release the release train app will: | ||
|
||
* get changelog from `changelog/unreleased/CHANGELOG.md` file | ||
* assemble the changelog by the script `python3 scripts/changelog/assemble_changelog.py` |
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 add #!/usr/bin/env python3
to the top of the file, you can run script typing less 🙂
* assemble the changelog by the script `python3 scripts/changelog/assemble_changelog.py` | |
* assemble the changelog by the script `./scripts/changelog/assemble_changelog.py` |
ChangelogFeaturesBug fixes and improvements
Known issues
|
Android Auto ChangelogFeaturesBug fixes and improvements |
This reverts commit aa6f7e8.
auto_bugfixes = get_changes('libnavui-androidauto/changelog/unreleased/bugfixes/') | ||
auto_features = get_changes('libnavui-androidauto/changelog/unreleased/features/') | ||
|
||
auto_changelog = '#### Features\n' + auto_features + '\n\n' + \ | ||
'#### Bug fixes and improvements\n' + auto_bugfixes | ||
auto_changelog = '# Android Auto Changelog\n' + \ |
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.
Out of scope of this PR and it's your file but I would try to generalize something here for the default changelog and the android auto one. So that it's easier to:
- Keep track of what changelogs are supported;
- Make changes in all places at once.
I see a list of objects describing the changelog file instead of having variable like a, b, c, ..., auto_a, auto_b, auto_c, ... . The objects would have different paths, changelog file names, maybe something else.
Just a refactoring idea.
Quoting GitHub blog post:
We could be a bit more strict with this repo permissions. Grant "navigation team" members the "Maintain" role, a couple leads Admin role and automation accounts Custom role with the Bypass branch protections permission. |
Do we need to assemble the changelog with every PR? If we are creating a separate I am not in favor of adding the assembled changelog to PR comment as I am not sure what value am I getting out of it. This also pollutes the PR in case there are several discussions happening which by the way is most often the case based on code review. The changes in
Does this mean the assembled changelog will be posted as PR comment every time a new commit is pushed or forced rebase is made? |
We can't give the bot permission Bypass branch protections anyway. Because the script uses the github-actions token, it's not a user. |
Yes, but it will create a comment if it doesn't exist or update if it exists. |
ChangelogFeaturesBug fixes and improvements
Known issues
|
I propose a compromise - a collapsible changelog comment. It doesn't take up a lot of space and it exists |
This is a better solution in my opinion. Thanks for giving it a deeper thought. However, I still don't understand the need for assembling the changelog in every PR and putting it as a PR comment. Can someone explain the benefit of it? cc @mapbox/navigation-android |
@SevaZhukov Can't we request a separate user, assign a custom role with Bypass branch protections and use its personal token for the workflow as suggested here? https://docs.github.com/en/actions/security-guides/automatic-token-authentication#granting-additional-permissions |
Sorry but no :( Because as I know we can't use and store permanent GitHub tokens. We can only get it by 1. mbx-ci (it doesn't work for this case because it's a public repo) 2. use default github-token for github-actions |
Well, I would like to be able to see what the changelog will result in, especially in the beginning when I'm new to the flow and it is subject to change. |
I think it's nice to see how new changelog entries affect the way whole changelog looks like. It may be useful if you write not a typical message, for instance with code examples or warnings about known issues. |
(cherry picked from commit 671b157)
After further consideration, it has been determined that it is not possible to both assemble and push the changelog to protected branches. Using PRs to update the changelog would simply bring us back to the original issue. As a result, the script has been refactored to only add the assembled changelog to PRs comments.