Skip to content
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

Changelog Auto-Updater #422

Merged
merged 6 commits into from
Sep 4, 2021
Merged

Changelog Auto-Updater #422

merged 6 commits into from
Sep 4, 2021

Conversation

Holzhaus
Copy link
Member

@Holzhaus Holzhaus commented Aug 5, 2021

This already allows automating the changelog updates via repository dispatch. I'll open a corresponding PR on the code repo. Please see the indivial commit messages for details.

To trigger a rebuild automatically, a PAT REPO_TOKEN needs to be present in the manual repo's secrets, because the default GITHUB_TOKEN doesn't to suffice.

This new helper script takes a branch name as input, then fetches
`CHANGELOG.md` from that branch in the upstream mixxxdj/mixxx repo,
converts the changelog into sphinx's ReStructured Text format and writes
it to `source/chapters/appendix/version_history.py`.

This makes keeping the manual repository changelog in sync with the code
repository changelog much easier and will allow automation in the
future.
Holzhaus added a commit to Holzhaus/mixxx that referenced this pull request Aug 5, 2021
See corresponding PR mixxxdj/manual#422 for details.

This requires a Personal Acess Token (PAT) with the `public_repo` scope
in the repository secrets (named `MANUAL_REPO_TOKEN`).
Holzhaus added a commit to Holzhaus/mixxx that referenced this pull request Aug 5, 2021
See corresponding PR mixxxdj/manual#422 for details.

This requires a Personal Acess Token (PAT) with the `public_repo` scope
in the repository secrets (named `MANUAL_REPO_TOKEN`).
@Holzhaus
Copy link
Member Author

Holzhaus commented Aug 5, 2021

Here's an example:

  1. Changelog Workflow: https://github.com/Holzhaus/manual/actions/runs/1101700527 (triggered from command line via cURL)
  2. Commit created by the changelog workflow: Holzhaus@080084a (sorry for the large diff, because the Markdown to RST converter uses a different indentation style)
  3. Rebuild (triggered by the changelog workflow): https://github.com/Holzhaus/manual/actions/runs/1101701820

@Holzhaus
Copy link
Member Author

Holzhaus commented Aug 7, 2021

Who can add the repo secret? @daschuer maybe?

@daschuer
Copy link
Member

daschuer commented Aug 9, 2021

Who can add the repo secret? @daschuer maybe?

I had just a look in the settings, but I don't know what to do. Do you have some hints?

Holzhaus added a commit to Holzhaus/mixxx that referenced this pull request Aug 15, 2021
See corresponding PR mixxxdj/manual#422 for details.

This requires a Personal Acess Token (PAT) with the `public_repo` scope
in the repository secrets (named `MIXXXBOT_CHANGELOG_AUTOUPDATER_PAT`).
This workflow can be triggered using a personal access token (PAT) with
the `public_repo` scope.

    $ curl -H "Accept: application/vnd.github.v3+json" \
           -H "Authorization: token <your-token>" \
           --request POST \
           --data '{"event_type": "update-changelog", "client_payload": {"branch": "2.3"}}' \
           https://api.github.com/repos/mixxxdj/manual/dispatches

It will then run `tools/update_changelog.py` and if any files were
changed, it will commit these changes and then trigger rebuild of the
manual.

For the latter to work, a `MIXXXBOT_CHANGELOG_AUTOUPDATER_PAT`
repository secret needs to be present, because the default
`GITHUB_TOKEN` doesn't suffice.
@Holzhaus
Copy link
Member Author

Ready to merge. Tested on my own repo, here's the commit generated by the bot: Holzhaus@a4b9555

Holzhaus added a commit to Holzhaus/mixxx that referenced this pull request Aug 16, 2021
See corresponding PR mixxxdj/manual#422 for details.

This requires a Personal Acess Token (PAT) with the `public_repo` scope
in the repository secrets (named `MIXXXBOT_CHANGELOG_AUTOUPDATER_PAT`).
@Holzhaus
Copy link
Member Author

Merge?

graphics-spongebob-163388

@Holzhaus
Copy link
Member Author

Ping. I suggest to merge this before mixxxdj/mixxx#4210 and mixxxdj/mixxx#4211 so that we can test if it works.

@daschuer
Copy link
Member

I think this will be hard to maintain later because of some hidden implications.
I am not able to point them out, because I have not yet fully understand how it works.
Would you mind to decorate the changes with some comments to improve the situation?

@daschuer
Copy link
Member

This introduces some implications the author of the CHANGLOG.md file should be aware of.
How can we make it sure that he his aware?

tools/update_changelog.py Outdated Show resolved Hide resolved
@Holzhaus
Copy link
Member Author

I think this will be hard to maintain later because of some hidden implications.
I am not able to point them out, because I have not yet fully understand how it works.
Would you mind to decorate the changes with some comments to improve the situation?

I added some explaining comments, however I'm unsure if this is what you meant.

This introduces some implications the author of the CHANGLOG.md file should be aware of.
How can we make it sure that he his aware?

The implication is that CHANGELOG.md has to be valid markdown. This is not new. Anyway, to enforce valid markdown I opened mixxxdj/mixxx#4222.

@Holzhaus
Copy link
Member Author

Ping.

tools/update_changelog.py Outdated Show resolved Hide resolved
Holzhaus added a commit to Holzhaus/manual that referenced this pull request Sep 1, 2021
@Holzhaus Holzhaus force-pushed the changelog-updater branch 2 times, most recently from 39cee02 to 5097ab7 Compare September 1, 2021 12:32
@Be-ing Be-ing requested a review from daschuer September 4, 2021 04:08
Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you.

@daschuer
Copy link
Member

daschuer commented Sep 4, 2021

@Swiftb0y: merge?

Copy link
Member

@Swiftb0y Swiftb0y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I forgot I had to approve the PR after my suggestions have been incorporated.

@Swiftb0y
Copy link
Member

Swiftb0y commented Sep 4, 2021

I suggest we make an exception this time and let @Holzhaus merge both PRs himself in the order they require to be merged.

@Holzhaus Holzhaus merged commit 78769ec into mixxxdj:2.3 Sep 4, 2021
@Holzhaus
Copy link
Member Author

Holzhaus commented Sep 4, 2021

It works: 52c82e0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants