feat: enforce changelog entry via CI check#604
feat: enforce changelog entry via CI check#604Mounil2005 wants to merge 2 commits intoscribe-org:mainfrom
Conversation
Add ci_changelog_check workflow that fails PRs targeting main when CHANGELOG.md has not been updated. Supports a 'no-changelog' label to skip the check for CI-only fixes, typos, or dependency bumps. Signed-off-by: Mounil <mounilkankhara@gmail.com>
Thank you for the pull request! 💙🩵The Scribe-Android team will do our best to address your contribution as soon as we can. The following are some important points:
Note Scribe uses Conventional Comments in reviews to make sure that communication is as clear as possible. |
Maintainer ChecklistThe following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)
|
Signed-off-by: Mounil <mounilkankhara@gmail.com>
|
@axif0, @DeleMike: What's your two's opinion on this? I think that it could be nice if we could eventually migrate away from the maintainer checklists that we have for projects. Each checklist that we have has one box for tests passing and having been written as well as a box that the changelog has been updated. We haven't been doing the changelog for Scribe-Android yet, and tend to write the changelog for Scribe-Data as PRs with major changes come in. Would be great if the testing checkbox was automatic given tests in CI and coverage being maintained, especially for the files being changed (maybe via |
Thanks for the detailed feedback! A few thoughts on the points raised: Cross-project reusability - happy to convert this into a reusable workflow using workflow_call so it can live in scribe-org/.github and be called from all Scribe projects with minimal config. That would make it a one-liner to opt in from any repo. Hard-fail vs. soft warning - since Scribe-Android hasn't been enforcing changelog entries yet, a hard fail might be too abrupt for contributors. One middle ground: keep the CI failure but also have the workflow post a PR comment when it fails, explaining exactly what to add and where (e.g. "Please add an entry under the latest version heading in CHANGELOG.md"). That way contributors aren't just staring at a red check with no guidance. Test checkbox automation - great idea as a follow-up. tj-actions/changed-files could be used to check whether changed .kt files have corresponding test coverage. Happy to explore that in a separate PR once the changelog piece is settled. Would it make sense to first agree on the changelog enforcement approach here, then tackle reusability and test automation as follow-ups? Would also love to hear what @axif0 and @DeleMike think! |
DeleMike
left a comment
There was a problem hiding this comment.
Hi @Mounil2005, this is a good PR; it will have its benefits. I do think that having a PR that checks for a compulsory changelog entry is good.
As @andrewtavis noted, this is a nice-to-have and not yet a priority.
|
How about looking into adding more test coverage for the app? is that something you can work on? |
Thanks for the suggestion @DeleMike! I would surely love to work on that. Core keyboard handlers: AutocompletionHandler, BackspaceHandler, KeyHandler, SpaceKeyProcessor, and SuggestionHandler are completely untested despite being the heart of the app. These are pure logic so unit tests with the existing JUnit 5 + Mockk setup would work well. which one should i move ahead with? |
|
Okay, kindly wait for @angrezichatterbox to get back to you on this. Or @andrewtavis, what are your thoughts on this? |
Thanks @DeleMike! Completely understand it's not a top priority right now. Since the implementation is already in place though, it might be a nice opportunity to merge it as a quiet foundation, it won't change anything for existing contributors and can always be tightened up later when the team feels ready. |
|
No problem @Mounil2005, let’s wait for @andrewtavis decision. |
Contributor checklist
./gradlew lintKotlin detekt testcommand as directed in the testing section of the contributing guideDescription
Adds a new GitHub Actions workflow
ci_changelog_check.yamlthat enforces changelog discipline on every PR targetingmain.What changed:
.github/workflows/ci_changelog_check.yaml-> new workflow fileHow it works:
tj-actions/changed-filesto detect whetherCHANGELOG.mdwas modified in the PRno-changeloglabel that maintainers can apply to skip the check for CI fixes, typo corrections, or dependency bumpsopened,reopened,synchronize,labeled, andunlabeledso adding/removing the label immediately re-evaluates the checkTesting:
This is a pure YAML workflow file, the
lintKotlin detekt testcommand does not apply. The check can be verified by opening a test PR without a changelog update and confirming it fails.Related issue
No related issue, this is a self-initiated improvement to the CI pipeline.