Skip to content

Add XML schema validation workflow#416

Open
virtuousluna wants to merge 8 commits into
ESCOMP:mainfrom
virtuousluna:xml-validation-test
Open

Add XML schema validation workflow#416
virtuousluna wants to merge 8 commits into
ESCOMP:mainfrom
virtuousluna:xml-validation-test

Conversation

@virtuousluna

Copy link
Copy Markdown

Tag name: xml-validation
Originator(s): Rosio Rodriguez

Description (include issue title and the keyword ['closes', 'fixes', 'resolves'] and issue number): Resolves #59.

This PR adds a GitHub Actions workflow for XML schema validation in atmospheric_physics. The workflow uses xmllint to validate hand-written XML files in the repository.

The workflow validates two categories of XML files:

Suite definition files in suites/ and test/test_suites/, using the CCPP suite schema from the ccpp-framework repository.
Scheme namelist XML files under schemes/, using the CIME ParamGen entry_id_pg schema.

This adds automated CI coverage so XML schema issues can be caught during pull requests instead of being discovered later during model configuration or build workflows.

List all namelist files that were added or changed:

None. This PR does not add or modify any namelist XML files. It only adds validation coverage for existing scheme namelist XML files.

List all files eliminated and why: None.

List all files added and what they do: .github/workflows/xml_validation.yaml

Adds a GitHub Actions workflow named XML schema validation. The workflow installs xmllint, checks out the needed schema sources from ccpp-framework and CIME, validates suite definition XML files, and validates all scheme namelist XML files matching *_namelist.xml under the schemes/ directory.

List all existing files that have been modified, and describe the changes:
(Helpful git command: git diff --name-status main...<your_branch_name>)

None. This PR adds a new workflow file and does not modify existing source, namelist, or physics files.

List all automated tests that failed, as well as an explanation for why they weren't fixed: None in the final PR state.

During development, I caused the XML schema validation workflow to fail by temporarily changing the root tag in one scheme namelist XML file. This was done to confirm that the workflow correctly catches invalid XML. The file was restored, and the workflow passed successfully afterward.

Is this an answer-changing PR? If so, is it a new physics package, algorithm change, tuning change, etc?

No. This is not an answer-changing PR. It only adds CI validation infrastructure for XML files.

If yes to the above question, describe how this code was validated with the new/modified features:

Not applicable because this is not an answer-changing PR.

The workflow was validated by running it in a fork and confirming the expected behavior:

  • valid XML files passed schema validation
  • a deliberately broken scheme namelist XML file failed schema validation
  • restoring the XML file caused the workflow to pass again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Need xmllint Github Action

2 participants