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

Improve CI checks in pull requests #262

Merged
merged 5 commits into from
Feb 24, 2022
Merged

Conversation

eeberhard
Copy link
Member

  • Skip build-test jobs if only documentation changed or in case of duplicate commits

  • Check contributions by looking for a diff between the head and base of a PR in VERSION and CHANGELOG files


Isn't it annoying when you forget to update the CHANGELOG? And then you have to wait for the CI to rebuild just because of that one line changed in the .md file that has no effect on the pipeline? Or, how about forgetting to update the CHANGELOG or VERSION in the first place? Lots of room for minor inconveniences.

This PR adds a check to ensure the CHANGELOG and VERSION have both been modified. It also uses a special action to check if a CI job is skippable - that is, if only a certain type of file (.md) has been changed.

@eeberhard eeberhard force-pushed the feature/more-ci-actions branch 2 times, most recently from 8a48e6c to 5607e9f Compare February 22, 2022 20:22
* Skip build-test jobs if only documentation changed or in case
of duplicate commits

* Check contributions by looking for a diff between the head
and base of a PR in VERSION and CHANGELOG files
@eeberhard eeberhard force-pushed the feature/more-ci-actions branch from 9a2b9d5 to 45d6dae Compare February 22, 2022 21:00
@eeberhard eeberhard changed the title Improved PR CI Improve CI checks in pull requests Feb 22, 2022
@domire8
Copy link
Contributor

domire8 commented Feb 23, 2022

Does that work? Imagine the following: You have several commits changing the source and the VERSION, then you open the PR, it fails because you didn't change the CHANGELOG. Then you change the CHANGELOG and it still doesn't run because you only changed an .md file, no? Or do I miss a detail?
I'm not against the idea, but not running the CI if the CHANGELOG is not changed is maybe a bit too much, not running it when you only change md files might be enough no?

@eeberhard
Copy link
Member Author

not running the CI if the CHANGELOG is not changed

The CI build-test jobs still run even if the "Check if changelog and version have been updated" check fails. So in the first instance where you make your code changes but not the changelog, you would still pass 5/6 checks. Then you update the changelog, pass the 6th test, and the other 5 would still count as passed. In theory, if all the checks have passed and you just change the changelog, it won't trigger a rebuild but still passes.

I will try that now by making a single change to the .md file.

@eeberhard
Copy link
Member Author

If you look at the test result history for commits 66c1496, b2656b2 and fc0f78f, you'll see the desired behaviour in action

Copy link
Contributor

@domire8 domire8 left a comment

Choose a reason for hiding this comment

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

I see now, thats very cool thanks

@eeberhard
Copy link
Member Author

@buschbapti do you agree with this approach to help make contributions more standardised?

Copy link
Contributor

@buschbapti buschbapti left a comment

Choose a reason for hiding this comment

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

Yes sorry for the delay. I like it a lot and thanks for the detailed explanation yesterday.

@eeberhard eeberhard merged commit 9fe85c3 into develop Feb 24, 2022
@eeberhard eeberhard deleted the feature/more-ci-actions branch February 24, 2022 10:46
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.

3 participants