Open
Conversation
379fdd3 to
3010328
Compare
This was referenced Dec 1, 2025
9f1c3e0 to
a830265
Compare
5fbdf60 to
a830265
Compare
Contributor
Author
|
Broken cache setup is causing the CI failures, it is referring to output of a step that hasn't been executed yet, defaulting to empty. See: and I would just manually delete the caches at https://github.com/mpalmer/action-validator/actions/caches and rerun the ci, but I can't. For a proper fix something more involved is required and I don't have easy answers for that. CI passes fine in my fork: |
a830265 to
5fbdf60
Compare
5fbdf60 to
c0a9294
Compare
This unlocks helpful syntax in compare-changes edition 2024 mandates minimum 1.86 as well, but had some CI issues so bumping directly to 1.92
6793c47 to
9055611
Compare
Contributor
Author
|
Fixed CI with 0de554d, it may need further work later but for now should be ok |
Contributor
Author
|
@mpalmer happy new year, this PR is ready for review |
The library hasn't really changed, just packaging & other updates.
be69f1b to
5f2453d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What / Why
How
I had some free time on my hands so I spent Nov 21 to Nov 30 on building a Rust library called compare-changes that is a reimplementation of GitHub's workflow syntax.
While setting up a trivial parser/pattern matcher is easy enough, one will soon start to learn about things like memoization, backtracking, pathological patterns, automatas and such, which are interesting, but would take me ages to use / account for, so instead the library relies on chumsky and regex for the difficult runtime bits.
Overview of compare-changes
globforaction-validatorand how the library works:
While GitHub's Documentation is helpful, it doesn't cover various edge cases of how pattern validation should behave. Therefore I've used various temporary repositories to run dummy workflows to see the actual behavior and eventually settled on the use of anttiharju/tmp for the purpose.
Now while I am quite happy with the state of the library, it of course could be that I've missed some edge cases and such, even if I am aware of a decent chunk of them. In case people encounter further issues with
action-validatorin regards to path patterns, feel free to point them to open an issue in anttiharju/compare-changes. These are fairly easy to provide repros for and it should be easy enough for me to update the library.Testing
Library has plenty of automated tests. Also tested manually:
Benchmarks
Main motivator for me here was fixing the slow Git hook so here are some numbers from a repo that uses a lot of glob patterns (anttiharju/relcheck@v1.8.13).
worst case: from
7.883 sto118.5 ms, a 66x improvement (7883/118=66,8050847458)best case: from
92.4 msto119.0 ms, a26.6 msoverheadthe multiplier may change a lot depending on the repo picked for running the benchmarks. In the performance issue discussion the multiplier was
19x[comment] because the worst case was not as bad. I did check that the numbers here were from0.8.0and not0.6.0, with0.6.0worst case went up to ~10s.Benchmarks ran on a 2021 14" MBP using hyperfine:
hyperfine --warmup 3 "git ls-files -z '.github/workflows/*.yml' '*/action.yml' | xargs -0 action-validator --verbose"details
worst-case
with a gitignored
.direnvfrom nix-direnvaction-validator@27-fix-wildcards-105-fix-gitignore-perfaction-validator@v0.8.0best case
no gitignored files ensured with
git reset --hard && git clean -dfxaction-validator@27-fix-wildcards-105-fix-gitignore-perfaction-validator@v0.8.0Anything else
tests/fixtures/012_github_glob_syntax/glob.yml) did not match GitHub's behavior, so went ahead and fixed them.action-validatornow shells out togitforls-filesto solve the performance issue when a repository has a lot of gitignored files.Comments on the code in the library (
lib.rs,path/mod.rs,convert/mod.rs) are also welcome, but not expected.