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

Checkout PR before updating changelog - fixes #732 #735

Merged
merged 2 commits into from
Oct 12, 2021
Merged

Checkout PR before updating changelog - fixes #732 #735

merged 2 commits into from
Oct 12, 2021

Conversation

BhumikaSaini
Copy link
Contributor

Related issue

Closes #732

Context / Background

When triggered, the Changelog Updater should update-commit-push the changelog file on the PR's source branch itself rather than the main branch. This will ensure that the changes from the PR as well as the changelog update flow together to main branch.

What change is being introduced by this PR?

Sr. No. File Changes Comments
1 ChangelogUpdater.yml 1. Removed the pull_request trigger.
2. Added prefix_only: 'true' for step with id: check.
3. Added Checkout the pull request step.
1. We are triggering the updater manually. If we want to retain the pull_request trigger, we should limit it to PRs against main branch.
2. The updater should not be triggered if the triggering message format is part of an issue_comment event that was not intended to trigger the bot (Example: if this issue message had been an issue_comment, the bot would have triggered erroneously). However, this will take effect only after prefix_only doesn't work - issue #18 on pull-request-comment-trigger repo is fixed.
3. This will switch to the PR's source branch before updating the changelog. More info can be found on this link.
2 CONTRIBUTING.md Updated the guidelines to enable "Allow edits by maintainers" on PRs. This will be required to ensure that the workflows run successfully.

How will this be tested?

Once this PR is merged:

  1. A new, dummy PR should be raised.
  2. The Changelog Updater should be triggered by posting a comment as mentioned in Changelog update workflow should push to PR branch instead of main #732.
  3. Run history of the Changelog Updater workflow should be inspected for the expected behaviour (as mentioned in Context / Background above).
  4. Ensure no changelog commits are made on the main branch by the bot.
  5. Ensure a changelog commit is made on the PR's source branch by the bot.

@BhumikaSaini BhumikaSaini marked this pull request as ready for review October 10, 2021 13:33
@BhumikaSaini BhumikaSaini changed the title Fix #732 Checkout PR before updating changelog - fixes #732 Oct 10, 2021
@BhumikaSaini
Copy link
Contributor Author

HI @thamara, @tupaschoal,
Please let me know if there are any changes to be incorporated.
Thank you!

Copy link
Owner

@thamara thamara left a comment

Choose a reason for hiding this comment

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

Thanks! This looks great!

@thamara
Copy link
Owner

thamara commented Oct 12, 2021

\changelog-update
User: BhumikaSaini

@thamara thamara merged commit 866c09a into thamara:main Oct 12, 2021
@thamara
Copy link
Owner

thamara commented Oct 12, 2021

Hey @BhumikaSaini, I have tested it in PR #737 and it looks like the step in the script which updates the file that will be later committed is not running. Logs here

Do you have any idea on why this is happening? My suspicion is that is not matching the role correctly, but I'll do some tests to confirm it. But please let me know if you have any suggestions.

@thamara
Copy link
Owner

thamara commented Oct 12, 2021

Actually, found the issue and fixed it. Thanks!

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.

Changelog update workflow should push to PR branch instead of main
2 participants