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(github): loosen up file matching when selecting tests to run #3021

Merged
merged 1 commit into from
Feb 24, 2024

Conversation

outSH
Copy link
Contributor

@outSH outSH commented Feb 12, 2024

  • Current file match glob is incorrect and never matches a file.
  • I didn't find a way to filter files by extension (as it was attempted now) so I propose to loose up the rules and run the test if any file in a package has changed.

More context

  • I've noticed in another PR (chore(esm): change imports to esm compatible #3018) that most tests didn't run, even though this PR changes most ts files, from all packages I think.
  • I've digged a little bit in dorny/paths-filter sources, found out the file matching string is passed to picomatch for actual filtering.
  • picomatch is very simple (but fast), and does not support any advanced globbing techniques. I've done some tests locally, and the best solution I found is to use less strict matching rules.

Pull Request Requirements

  • Rebased onto upstream/main branch and squashed into single commit to help maintainers review it more efficient and to avoid spaghetti git commit graphs that obfuscate which commit did exactly what change, when and, why.
  • Have git sign off at the end of commit message to avoid being marked red. You can add -s flag when using git commit command. You may refer to this link for more information.
  • Follow the Commit Linting specification. You may refer to this link for more information.

Character Limit

  • Pull Request Title and Commit Subject must not exceed 72 characters (including spaces and special characters).
  • Commit Message per line must not exceed 80 characters (including spaces and special characters).

A Must Read for Beginners
For rebasing and squashing, here's a must read guide for beginners.

Copy link
Contributor

@izuru0 izuru0 left a comment

Choose a reason for hiding this comment

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

LGTM

@sandeepnRES
Copy link
Contributor

Hi @outSH, I didn't get what you mean by never matches a file.
What I saw on PRs was, if there was a code change, the corresponding CI was running else it skipped.

@outSH
Copy link
Contributor Author

outSH commented Feb 13, 2024

Hi @outSH, I didn't get what you mean by never matches a file. What I saw on PRs was, if there was a code change, the corresponding CI was running else it skipped.

@sandeepnRES
Yeah, I've changed the original PR so it may not be clear, sorry. I've opened another one on my fork to make it more persitent here - outSH#11. As you can seet his PR changes all packages, but none are marked as changed by the CI:

image

This is because of invalid glob in config as I described above

@petermetz
Copy link
Contributor

@outSH One more idea! Could you please double-check if the change detection is also broken if you submit the same diff (or something equivalent) to the upstream repo (e.g. hyperledger/cacti instead of outSH/cacti)?
This is just another wild guess but I'm thinking maybe it's something to do with the PR being submitted against your own fork.

This idea of mine was inspired by the fact that my benchmark result publishing PR of mine also seems to be broken in a way that is dependent on which repo a PR is being submitted against. 😅

@outSH
Copy link
Contributor Author

outSH commented Feb 14, 2024

@petermetz The problem was spotted on PR opened here, you can see this happening here - #3018

Copy link
Contributor

@sandeepnRES sandeepnRES left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

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

@outSH My theory right now is that this won't fix the issue because of the underlying cause explained here: #3018 (comment)

Is there any chance that you verify it over there on that PR?
I'm thinking that if my research is correct than we don't need this PR at all.

Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

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

@outSH LGTM - later once the path-filter action has the ability to support our more fine-grained filtering use-case I'll recommend to change the glob patterns once again, but in the meantime this is definitely a net positive! Thank you very much for taking the time to send this in!

- Current file match glob is incorrect and never matches a file.
- I didn't find a way to filter files by extension (as it was attempted now)
    so I propose to loose up the rules and run the test
    if any file in a package has changed.

Signed-off-by: Michal Bajer <[email protected]>
@petermetz petermetz force-pushed the fix_ci_pattern_match_pr branch from 0a5140b to dcd72e7 Compare February 24, 2024 08:38
@petermetz petermetz enabled auto-merge (rebase) February 24, 2024 08:38
@petermetz petermetz merged commit ed6552c into hyperledger-cacti:main Feb 24, 2024
131 of 146 checks passed
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.

4 participants