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: Remind people of adding an entry to CHANGELOG #143

Closed
bkchr opened this issue Jan 15, 2024 · 12 comments · Fixed by #153
Closed

CI: Remind people of adding an entry to CHANGELOG #143

bkchr opened this issue Jan 15, 2024 · 12 comments · Fixed by #153

Comments

@bkchr
Copy link
Contributor

bkchr commented Jan 15, 2024

It should be somehow possible to skip this, ideas are welcome.

@Bullrich
Copy link
Contributor

What about a modifying the pull_request_template to inform the users of the requirement?

Could be something like:

<!-- Remember that you can run `/merge` to enable auto-merge in the PR -->

## Checklist
Did you remember to modify the `CHANGELOG.md` file?
- [ ] Yes

The other option is to generate a simple action that can see if the CHANGELOG file has not been modified and either, comment on the creation of a PR that the file has not been modified, or, fail until the CHANGELOG file has been modified.

@Bullrich
Copy link
Contributor

The other option is to generate a simple action that can see if the CHANGELOG file has not been modified and either, comment on the creation of a PR that the file has not been modified, or, fail until the CHANGELOG file has been modified.

Example using: pr-includes-file-change:

name: Modify Changelog

on:
  pull_request_target:
    types:
      - opened

jobs:

  test:
    runs-on: ubuntu-latest
    env:
      GITHUB_TOKEN: ${{ github.token }}
    steps:
      - name: Get Changed Files
        id: changed
        uses: foodee/pr-includes-file-change@master
        with:
          paths: ^CHANGELOG.md
      - name: Comment lack of CHANGELOG
        if: steps.changed.outputs.matched != 'true'
        run: gh pr comment $PR_NUMBER --body "Please modify the CHANGELOG.md file 🗂️"
        env:
          PR_NUMBER: context.issue.number
      - name: Fail
        if: steps.changed.outputs.matched != 'true'
        run: exit 1

Disclaimer, I haven't tested this action.

@ggwpez
Copy link
Member

ggwpez commented Jan 15, 2024

Something in the MR template to skip changelog modification would be good. Then the CI action can check whether the description contains a [x] Does not require a CHANGELOG entry or so (maybe the question should be more explicit with a Yes or No).

@bkchr
Copy link
Contributor Author

bkchr commented Jan 15, 2024

Something in the MR template to skip changelog modification would be good. Then the CI action can check whether the description contains a [x] Does not require a CHANGELOG entry or so (maybe the question should be more explicit with a Yes or No).

Yes this could work.

@mutantcornholio
Copy link
Contributor

This looks awfully like prdoc...
Changed/Added/Fixed sections kinda look like audiences (and that's configurable with custom schema).

@bkchr
Copy link
Contributor Author

bkchr commented Jan 19, 2024

We may switch to prdoc at some point, but currently I don't want to pull the overhead it brings into this repo. When it is more major etc, we can check it.

@mutantcornholio
Copy link
Contributor

If we don't want to bring overhead, maybe stick to a PR template without any CI for now?

@bkchr
Copy link
Contributor Author

bkchr commented Jan 19, 2024

Overhead was the wrong word here. What I meant is relying on too much logic outside of the repo that is complicated to adapt to our needs here.

Bullrich added a commit to Bullrich/polkadot-fellows-runtimes that referenced this issue Jan 22, 2024
Added a GitHub action that uses foodee/pr-includes-file-change to fetch all the changes and verify that the file `CHANGELOG.md` has been modified.

If it has not been modified and the PR body does not include the text `[x] Does not require a CHANGELOG entry`, the action will fail.

This will fulfill the requirements for polkadot-fellows#143
@Bullrich
Copy link
Contributor

PR #153 has been created to solve this requirement.

Bullrich added a commit to Bullrich/polkadot-fellows-runtimes that referenced this issue Jan 23, 2024
Added a GitHub action that uses
[foodee/pr-includes-file-change](https://github.com/marketplace/actions/pr-includes-file-change)
to fetch all the changes and verify that the file `CHANGELOG.md` has
been modified.

If it has not been modified and the PR body does not include the text
`[x] Does not require a CHANGELOG entry`, the action will fail.

This resolves polkadot-fellows#143

The template was updated to include a reminder on how to modify the
changelog and instructions on how to skip the CI if the PR does not
require to modify the changelog

---------

Co-authored-by: fellowship-merge-bot[bot] <151052383+fellowship-merge-bot[bot]@users.noreply.github.com>
@Bullrich
Copy link
Contributor

Bullrich commented Jan 23, 2024

PR #153 has been merged (e115160). For some reason, this issue has not been closed automatically 🤔

@bkchr
Copy link
Contributor Author

bkchr commented Jan 23, 2024

I assume just because github didn't found the keywords it was searching for.

@bkchr bkchr closed this as completed Jan 23, 2024
@Bullrich
Copy link
Contributor

It should as the PR does mention that, once it will be merged, it will close the issue:
Screenshot 2024-01-23 at 12 25 56

Maybe they had some internal problem?

Thanks for closing it! ✅

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 a pull request may close this issue.

4 participants