Replace the ID range validation script#1163
Merged
Conversation
Use the new program Dicer-CLI to validate the ID range file, instead of the Scala script `validate_id_ranges.sc`. There were at least two problems with that script: * Beyond syntax errors, it only detects overlapping ranges; it does not detect ranges that are intrinsically invalid. * Its execution requires the Scala interpreter to download dependencies at runtime. The new dicer-cli program fixes both issues: it detects all invalid ranges, and is self-sufficient.
Ammonite is no longer used by any standard, ODK-generated workflow -- it was only used by the `make validate_idranges` workflow, which now uses a dedicated program. So we move Ammonite to the ODKFull image only, in line with the intended usage of ODKLite -- ODKLite should contain everything that is required by standard workflows, and nothing more.
matentzn
approved these changes
Jan 5, 2025
Contributor
matentzn
left a comment
There was a problem hiding this comment.
Big yes!
I wonder if it would make sense in cases like this to include a routine in the repo update process to clean up files that are no longer needed, like
template/src/scripts/validate_id_ranges.sc
Just a thought, not a blocker for this PR.
Contributor
Author
Sounds like a good idea indeed. |
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 replaces the
validate_id_ranges.scScala script by a program dedicated to the management of ID range files, dicer-cli.Rationale for this replacement:
dicer-clidetects more errors thanvalidate_id_ranges.sc, which only detects overlapping ranges. For example, this error in CL was only detected bydicer-cli.validate_id_ranges.scscript requires the Scala interpreter to download the script’s dependencies (such as the OWLAPI library) at runtime. Thedicer-clitool is self-sufficient.dicer-clican also be used to easily add new ranges to the file.With the
validate_id_ranges.scscript removed, there is no longer any standard, ODK-generated workflow that requires a Scala interpreter, so Ammonite is moved from ODKLite to ODKFull.