Repository navigation
Allow disabling pattern updates - #40
Merged
Merged
Conversation
Users might sometimes want to temporarily disable updating an externally sourced DOSDP pattern. For now, the only way to do that is to remove the corresponding URL entirely from the src/patterns/dosdp-patterns/external.txt file, but then the URL has to be added back later when updating that pattern is desired again. This commit makes it possible to comment out a URL in the external.txt file by preceding it with a `#` character. We also remove the EXTERNAL_PATTERN_FILES variable, which is never used anywhere.
The general promise of the MIR variable is that ODK workflows should not attempt to fetch any remote resources under MIR=false. This should apply to remotely source DOSDP patterns -- that is, running: ``` make patterns MIR=false ``` should _not_ automatically the patterns listed in src/patterns/dosdp-patterns/external.txt.
To compute the EXTERNAL_PATTERN_URLS, we cannot rely on the `$(filter-out)` and `$(file)` Make functions, which are broken on the version of GNU Make found on macOS. So we explicitly invoke grep instead.
matentzn
approved these changes
Oct 11, 2026
matentzn
left a comment
Contributor
There was a problem hiding this comment.
I am fine with this, but note my comment!
|
|
||
| EXTERNAL_PATTERN_URLS = $(strip $(file <$(PATTERNDIR)/dosdp-patterns/external.txt)) | ||
| EXTERNAL_PATTERN_FILES = $(notdir $(EXTERNAL_PATTERN_URLS)) | ||
| EXTERNAL_PATTERN_URLS = $(strip $(shell test -f $(PATTERNDIR)/dosdp-patterns/external.txt && grep -v ^\# $(PATTERNDIR)/dosdp-patterns/external.txt)) |
Contributor
There was a problem hiding this comment.
very strict, # yo wont match.
https://example.org/a.yaml
#https://example.org/b.yaml
# indented comment
https://example.org/c.yaml # trailing note
will result in https://example.org/a.yaml # indented comment https://example.org/c.yaml # trailing note. So #, indented, comment, trailing and note all end up in $(foreach url, ...) and get passed to odk-helper download.
Collaborator
Author
There was a problem hiding this comment.
Yes, the point is solely to allow ignoring one line – not to introduce a full-fledged comment syntax.
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.
This PR brings two small improvements to the workflows related to DOSDP patterns:
(A) It allows to comment out an URL in the
src/patterns/dosdp-patterns/external.txtfile. Commented-out URLs will be ignored when the external patterns are updated.(B) It disables the automatic updating of external patterns under
MIR=false, since the general idea ofMIR=falseis that it prevents ODK workflows from attempting to fetch external resources – there’s no reason to exclude remotely sourced DOSDP patterns from that logic.