You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we're using this on github actions to throw an error when somebody opens a PR and doesn't update the CHANGELOG.md. However, when a new release is made (hence the changelog.md modified to reflect the new development version), the PR branch becomes outdated, making the changelog entry incorrect.
example:
a new branch is created to work on a new feature, at this time. the development version is 0.1dev
the feature author opens a PR and adds a changelog entry under the 0.1dev section
the feature author asks for a review
a new release is made using the master branch (release version=0.1.), new development version is 0.1.1dev
the PR is reviewed and merged
After merging, the changelog is incorrect because the PR entry was created under 0.1dev instead of 0.1.1dev
I believe the only way to detect this problem is when merging the PR: we can check whether any new commit that appears on the master/main branch is modifying the CHANGELOG.md (some don't modify it and that's allowed), and if so, check which section is modifying. if the modification is outside of the development version, we should fail the CI.
note that this has some edge cases. for example, if I add a commit (A) to master/main and modify the first section, but then add another commit (B) and modify the latest one. the CI will pass, even though I modified the first section in commit A. But I don't know if there's anything better we can do. because we cannot detect this problem during the PR CI run (or can we?) - since the release can happen at any time: during the review, after the review, right before merging it. I guess the only way is if we only allow to merge PRs that have been merged/rebased with respect to master, which will guarantee that the CHANGELOG.md version in the PR has the latest development version.
The text was updated successfully, but these errors were encountered:
we recently added an utility to throw an error if a file hasn't been modified: https://github.com/ploomber/pkgmt/blob/main/src/pkgmt/fail_if_not_modified.py
we're using this on github actions to throw an error when somebody opens a PR and doesn't update the CHANGELOG.md. However, when a new release is made (hence the changelog.md modified to reflect the new development version), the PR branch becomes outdated, making the changelog entry incorrect.
example:
After merging, the changelog is incorrect because the PR entry was created under 0.1dev instead of 0.1.1dev
I believe the only way to detect this problem is when merging the PR: we can check whether any new commit that appears on the master/main branch is modifying the CHANGELOG.md (some don't modify it and that's allowed), and if so, check which section is modifying. if the modification is outside of the development version, we should fail the CI.
note that this has some edge cases. for example, if I add a commit (A) to master/main and modify the first section, but then add another commit (B) and modify the latest one. the CI will pass, even though I modified the first section in commit A. But I don't know if there's anything better we can do. because we cannot detect this problem during the PR CI run (or can we?) - since the release can happen at any time: during the review, after the review, right before merging it. I guess the only way is if we only allow to merge PRs that have been merged/rebased with respect to master, which will guarantee that the CHANGELOG.md version in the PR has the latest development version.
The text was updated successfully, but these errors were encountered: