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

fix(CI): Make sure the "when unrelated" fake summaries work correctly #230

Merged
merged 2 commits into from
Oct 10, 2023

Conversation

nickvergessen
Copy link
Member

Before they executed when any file outside the defined scope matched. However that means: When a PR touches PHP and JS, both the real and the fake summaries for node, eslint and phpunit got triggered. Since the fake summary is always green it meant one could merge a PR that in the end had red CI on the non-fake summary.

Now the fake summaries are skipped, if any of the files still matches the pattern, instead of being executed whenever a single file did not match it.


How did I notice

Reason

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-excluding-paths

When all the path names match patterns in paths-ignore, the workflow will not run. If any path names do not match patterns in paths-ignore, even if some path names match the patterns, the workflow will run.

There was some file that didn't match, so that's why the "when unrelated" ran... that's .... problematic.

"When unrelated" should only run, when none of the matching files was touched.

Debug

Debugged this in https://github.com/nickvergessen/turbo-lamp/pulls

Possible improvements

Read the .yml file and use the on.pull_request.paths-ignore instead of duplicating the paths into the env. But I was unable to achieve that and this solution here works good enough for now.

Before they executed when any file outside the defined scope matched.
However that means: When a PR touches PHP and JS, both the real and
the fake summaries for node, eslint and phpunit got triggered.
Since the fake summary is always green it meant one could merge a PR
that in the end had red CI on the non-fake summary.

Now the fake summaries are skipped, if any of the files still matches
the pattern, instead of being executed whenever a single file did not
match it.

Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen nickvergessen added 3. to review Waiting for reviews bug Something isn't working labels Sep 28, 2023
@nickvergessen nickvergessen self-assigned this Sep 28, 2023
Copy link
Contributor

@max-nextcloud max-nextcloud left a comment

Choose a reason for hiding this comment

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

Thanks for diving into this!
Fixes #124

@nickvergessen
Copy link
Member Author

So, this or you want to port your logic @kesselb

@kesselb
Copy link
Contributor

kesselb commented Oct 4, 2023

Tough question 😰

I used the GitHub action dorny/paths-filter to run phpunit only for php* changes at https://github.com/nextcloud/server/pull/39734/files.

One advantage is that we only have one workflow. I find that easier to understand and maintain.

The disadvantage is that the workflow itself is more complex because we have the additional job to evaluating the changed files and another check for the summary step.

What do you think @skjnldsv @max-nextcloud @ChristophWurst?

… the changed files

Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen nickvergessen merged commit 6d872c0 into master Oct 10, 2023
3 checks passed
@nickvergessen nickvergessen deleted the bugfix/noid/fix-unrelated-ci branch October 10, 2023 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants