CI asciidoc/metanorma label headers check - #634
Open
fmigneault wants to merge 8 commits into
Open
fmigneault wants to merge 8 commits into
fmigneault wants to merge 8 commits into
Conversation
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.
Changes
This adds a CI script that will validate whether header/req/rec/per/table/section labels are provided, and whether their names are consistent across sections. Adding the labels ensures that we don't get floating UUID auto-generated in the HTML which cannot be referenced consistently between builds.
The script generates an output such as the following. When labels naming is inconsistent (e.g., switching prefixes, mix of
-/_not following usual pattern), it will also propose/explain what's wrong about them. It will also detect duplicates within respective core/extension documents to avoid the creation of wrong links (for example, found duplicateats_dismiss_job-dismiss-success, one of which supposed to beats_dismiss_job-dismiss-status).With the CI integration, it will ensure that any edited AsciiDoc did not forget to include an anchor label, and that those provided are aligned with the type of contents contained (eg:
req_...for a[requirement]).> python .github/scripts/check_adoc_labels.py The following section headers and/or normative blocks are missing a valid anchor label ([[label]]): Status Label Type Line Name File / Problem --------------------------------------------------------------------------- FAIL MISSING Table 92 Conformance class URIs core/sections/clause_2_conformance.adoc FAIL MISSING Table 6 (no title found) extensions/deploy_replace_undeploy/standard/sections/annex_history.adoc FAIL MISSING Table 20 (no title found) extensions/deploy_replace_undeploy/standard/sections/clause_0_front_material.adoc FAIL MISSING Table 26 Supported HTTP methods by resource extensions/deploy_replace_undeploy/standard/sections/clause_1_scope.adoc FAIL MISSING Table 6 (no title found) extensions/job_management/standard/sections/annex_history.adocFixes
Using it, I fixed the >1100 cases that were missing or had an invalid anchor.
(see full list: https://github.com/opengeospatial/ogcapi-processes/actions/runs/35188120084/job/105094495456?pr=634)
I also identified and fixed the following notable cases that were inconsistent:
core/abstract_tests/core/ATS_test-process.adoc—[requirement]→[abstract_test]extensions/deploy_replace_undeploy/standard/abstract_tests/dru/ATS_mutable-process.adoc—[requirement]→[abstract_test]extensions/deploy_replace_undeploy/standard/abstract_tests/dru/ATS_test-process.adoc—[requirement]→[abstract_test]extensions/job_management/standard/recommendations/job-management/update/PER_put-op.adoc—[requirement]→[permission], identifier/req/job-management/update-put-op→/per/job-management/update-put-op(no other references found)core/recommendations/collection-output/PER_collection-output_response-response-one.adoc— typopre_→per_core/recommendations/ogc-process-description/PER_extend-data-access-apis-values.adoc— typopre_→per_core/recommendations/ogc-process-description/PER_value-passing.adoc— typopre_→per_In Core, I replaced the
response-response-[one|many]byresponse-output-[one|many]because the distinctive one/many is the selected output(s), so doubleresponsewas confusing and misleading.Finally, I patched the JSON contents that were missing wrapping
{}as it made linters go wild. Beside the purposely partial definitions such as arrays with..., they are now valid JSON contents.Patch
Cherry-picked the commits from #607 that resolve the file reference for Part 3 CI build.
I suggest merging that PR first and resolve any conflict here after (if any).