ci: don't check invalid examples #90

Closed
adina wants to merge 2 commits from make-invalid into main
Owner

there are no configurations for invalid examples and this - so far - only causes clutter. Can be easily commented back in when the necessary configurations are in place.

there are no configurations for invalid examples and this - so far - only causes clutter. Can be easily commented back in when the necessary configurations are in place.
ci: don't check invalid examples
All checks were successful
Codespell / Check for spelling errors (pull_request) Successful in 27s
Model checks / lint (pull_request) Successful in 1m44s
Validate examples and verify unmodified conversion / lint (pull_request) Successful in 2m48s
b0ac6944cf
there are no configurations for invalid examples and this
only causes clutter
Owner

Thanks for tackling this, I agree the invalidation-related errors cause clutter.

How about a more surgical intervention? I need to check on more examples, but I believe this should work:

@@ -106,12 +106,12 @@ check-validation: \
 checkvalidation/%:
 	$(MAKE) checkvalid/$* checkinvalid/$*
 checkvalid/%: src/%/validation src/%.yaml
-	@for ex in $</*.valid.cfg.yaml; do \
+	@for ex in $(wildcard $</*.valid.cfg.yaml); do \
 		echo "Validate $$ex" ; \
 		linkml-validate --config "$$ex" || exit 5 ; \
 	done
 checkinvalid/%: src/%/validation src/%.yaml
-	@for ex in $</*.invalid.cfg.yaml; do \
+	@for ex in $(wildcard $</*.invalid.cfg.yaml); do \
 		echo "(In)validate $$ex" ; \
 		linkml-validate --config "$$ex" && exit 5 || true; \
 	done

The reason we see errors with the current makefile is that when there are no *.invalid.cfg.yaml files, we still make it into the for loop, and call linkml-validate with the glob expression verbatim, which produces errors that we see: "Invalid value for '--config': File 'src/flat-data/unreleased/validation/*.invalid.cfg.yaml' does not exist."

Brief search suggests that wildcard would avoid that behavior.

I am also not sure about the && exit 5 || true part - I must think about it.

Thanks for tackling this, I agree the invalidation-related errors cause clutter. How about a more surgical intervention? I need to check on more examples, but I believe this should work: ```diff @@ -106,12 +106,12 @@ check-validation: \ checkvalidation/%: $(MAKE) checkvalid/$* checkinvalid/$* checkvalid/%: src/%/validation src/%.yaml - @for ex in $</*.valid.cfg.yaml; do \ + @for ex in $(wildcard $</*.valid.cfg.yaml); do \ echo "Validate $$ex" ; \ linkml-validate --config "$$ex" || exit 5 ; \ done checkinvalid/%: src/%/validation src/%.yaml - @for ex in $</*.invalid.cfg.yaml; do \ + @for ex in $(wildcard $</*.invalid.cfg.yaml); do \ echo "(In)validate $$ex" ; \ linkml-validate --config "$$ex" && exit 5 || true; \ done ``` The reason we see errors with the current makefile is that when there are no `*.invalid.cfg.yaml` files, we still make it into the for loop, and call `linkml-validate` with the glob expression verbatim, which produces errors that we see: "Invalid value for '--config': File 'src/flat-data/unreleased/validation/*.invalid.cfg.yaml' does not exist." Brief search suggests that [wildcard](https://www.gnu.org/software/make/manual/html_node/Wildcard-Function.html) would avoid that behavior. ~I am also not sure about the `&& exit 5 || true` part - I must think about it.~
Author
Owner

TIL! Thanks for finding this. I tried it locally, and I agree it seems to work. I don't cling too tightly on the commit I made, but I made a companion PR in datalad-concepts which already got merged. If we use your method here, we should also match this in datalad-concepts.

TIL! Thanks for finding this. I tried it locally, and I agree it seems to work. I don't cling too tightly on the commit I made, but I made a companion PR in datalad-concepts which already got merged. If we use your method here, we should also match this in datalad-concepts.
Use wildcard for matching configuration files
All checks were successful
Codespell / Check for spelling errors (pull_request) Successful in 20s
Model checks / lint (pull_request) Successful in 1m40s
Validate examples and verify unmodified conversion / lint (pull_request) Successful in 2m37s
bc11582967
Author
Owner

Ah, sorry for the commit. I realized too late you already opened #91.

Ah, sorry for the commit. I realized too late you already opened #91.
Owner

I don't cling to any particular commit either, but if we use the wildcard function then I would do it for both *valid and *invalid.

And I am not trying to compete or anything, it's just that I was also getting annoyed by the errors, so when I saw this PR it motivated me to look closer for a more specific solution. I was also surprised that @for withe the glob pattern behaves the way it does, and I think wildcard function is the more "do what we mean" approach.

I keep a closer eye on the Psychoinformatics hub than on GitHub at the moment, so I didn't realize until now that there is a companion PR in the GH datalad-concepts repo (which probably would be the more authoritative place, right?).

As a side note, probably out of scope here: it is weird that CI here failed in 17 min 34 s while the CI in functionally equivalent #91 succeeded in 2 min 14 s. Could it be possible that we are running into time limits or rate limiting? The CI output contains "Switch to local imports" and we've seen it rewrite some import statements, but probably we are still making external requests to original schemas - in GitHub?

I don't cling to any particular commit either, but if we use the wildcard function then I would do it for both `*valid` and `*invalid`. And I am not trying to compete or anything, it's just that I was also getting annoyed by the errors, so when I saw this PR it motivated me to look closer for a more specific solution. I was also surprised that `@for` withe the glob pattern behaves the way it does, and I think wildcard function is the more "do what we mean" approach. I keep a closer eye on the Psychoinformatics hub than on GitHub at the moment, so I didn't realize until now that there is a companion PR in the GH datalad-concepts repo (which probably would be the more authoritative place, right?). As a side note, probably out of scope here: it is weird that CI here failed in 17 min 34 s while the CI in functionally equivalent #91 succeeded in 2 min 14 s. Could it be possible that we are running into time limits or rate limiting? The CI output contains "Switch to local imports" and we've seen it rewrite some import statements, but probably we are still making external requests to original schemas - in GitHub?
Author
Owner

As a side note, probably out of scope here: it is weird that CI here failed in 17 min 34 s while the CI in functionally equivalent #91 succeeded in 2 min 14 s. Could it be possible that we are running into time limits or rate limiting? The CI output contains "Switch to local imports" and we've seen it rewrite some import statements, but probably we are still making external requests to original schemas - in GitHub?

I don't know. Out of curiosity, I restarted the run to see if this was maybe just a one time something. Afterwards, I'll close this PR as superseeded by #91. :) Edit: The rerun was 2mins15s. To be fair, that doesn't tell us anything. Let's keep an eye on the runs if we spot more long CIs.

> As a side note, probably out of scope here: it is weird that CI here failed in 17 min 34 s while the CI in functionally equivalent #91 succeeded in 2 min 14 s. Could it be possible that we are running into time limits or rate limiting? The CI output contains "Switch to local imports" and we've seen it rewrite some import statements, but probably we are still making external requests to original schemas - in GitHub? I don't know. Out of curiosity, I restarted the run to see if this was maybe just a one time something. Afterwards, I'll close this PR as superseeded by #91. :) Edit: The rerun was 2mins15s. To be fair, that doesn't tell us anything. Let's keep an eye on the runs if we spot more long CIs.
adina closed this pull request 2025-08-13 13:31:35 +00:00
All checks were successful
Codespell / Check for spelling errors (pull_request) Successful in 20s
Model checks / lint (pull_request) Successful in 1m40s
Validate examples and verify unmodified conversion / lint (pull_request) Successful in 2m37s

Pull request closed

Sign in to join this conversation.
No description provided.