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

ci: Automatically open PR for subproject CHANGELOG.md updates #1328

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

vblagoje
Copy link
Member

@vblagoje vblagoje commented Jan 28, 2025

Why:

To address issues with unpredictable automatic changelog commits in pypi releases of our subprojects, this PR introduces automated pull requests for changelog updates. This provides more control and flexibility, enabling quick reviews, easy edits, and better handling of edge cases. It also allows us to refine the cliff.toml configuration without the risk of unexpected errors in changelogs.

What:

  • Replaced the add-and-commit action with the create-pull-request action to open pull requests for changelog updates instead of committing directly.
  • Configured the action to create a new branch and a well-structured pull request for each changelog modification.
  • Improved messaging in created PRs

How can it be used:

Upon each release, the workflow will execute the following:

uses: peter-evans/create-pull-request@v7
with:
  token: ${{ secrets.HAYSTACK_BOT_TOKEN }}
  commit-message: "Update changelog for ${{ steps.pathfinder.outputs.project_path }}"
  branch: update-changelog-${{ steps.pathfinder.outputs.project_path }}
  title: "docs: update changelog for ${{ steps.pathfinder.outputs.project_path }}"
  add-paths: |
    ${{ steps.pathfinder.outputs.project_path }}/CHANGELOG.md

This generates a pull request for the changelog update with clear branch names and commit messages, making it easier to review and edit before merging.

How did you test it:

The changes were tested in a controlled environment to ensure the workflow correctly generates pull requests for changelog updates. Validation included confirming:

  • Proper branch naming conventions.
  • Accurate commit messages.
  • Consistent changelog updates for the specified project path.
  • Smooth integration with the cliff.toml configuration.

Notes for the reviewer:

  • Review the branch naming conventions and commit messages in the create-pull-request action to confirm they align with repository standards.
  • Ensure the proposed messaging in PR is clear

@vblagoje vblagoje requested a review from a team as a code owner January 28, 2025 20:30
@vblagoje vblagoje requested review from Amnah199 and removed request for a team January 28, 2025 20:30
@vblagoje vblagoje changed the title chore: Automatically open PR for subproject CHANGELOG.md updates ci: Automatically open PR for subproject CHANGELOG.md updates Jan 28, 2025
@vblagoje vblagoje requested a review from anakin87 January 28, 2025 20:31
Copy link
Member

@anakin87 anakin87 left a comment

Choose a reason for hiding this comment

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

Let's try...

In any case, I would appreciate if you could also investigate why currently CHANGELOG updates are often generated incorrectly.

@vblagoje
Copy link
Member Author

Yes, will do - that one requires deeper investigation.

@vblagoje vblagoje merged commit e4f462f into main Jan 29, 2025
3 checks passed
@vblagoje vblagoje deleted the cliff_on_pr branch January 29, 2025 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants