Skip to content

Consolidate CI case configuration to single source of truth#48

Draft
Copilot wants to merge 4 commits intodevelopfrom
copilot/consolidate-ci-cases-locations
Draft

Consolidate CI case configuration to single source of truth#48
Copilot wants to merge 4 commits intodevelopfrom
copilot/consolidate-ci-cases-locations

Conversation

Copy link

Copilot AI commented Nov 24, 2025

Description

CI test case configurations were maintained in two locations: individual case YAMLs with skip_ci_on_hosts tags and hardcoded matrices in gitlab-ci-hosts.yml. This created maintenance burden when adding test cases or modifying host support.

Changes

Automation Script (dev/ci/scripts/utils/generate_host_case_matrix.py)

  • Parses skip_ci_on_hosts from case YAMLs in dev/ci/cases/pr/
  • Generates host-specific case matrices for GitLab CI
  • Supports in-place update (--update), dry-run (--dry-run), and specific host selection (--hosts)

Configuration (dev/ci/gitlab-ci-hosts.yml)

  • Added auto-generated header warning against manual edits
  • Regenerated matrices from case YAMLs (content unchanged, now automated)

Documentation

  • dev/ci/README-case-configuration.md: Comprehensive guide for managing test cases
  • Updated dev/ci/README-CI-Pipeline.md with cross-references

Usage

Adding a new test case:

# 1. Create case YAML with skip_ci_on_hosts section
# 2. Regenerate matrices
python dev/ci/scripts/utils/generate_host_case_matrix.py --update
# 3. Commit both files

Existing test_ci_matrix_validation.py validates synchronization between case YAMLs and generated matrices.

Resolves #<issue_number>

Type of change

  • Maintenance (code refactor, clean-up, new CI test, etc.)

Change characteristics

  • Is this a breaking change (a change in existing functionality)? NO
  • Does this change require a documentation update? YES (included)
  • Does this change require an update to any of the following submodules? NO

How has this been tested?

  • All validation tests pass (7/7 in test_ci_matrix_validation.py)
  • YAML syntax validated
  • New case addition workflow verified locally
  • CodeQL security scan: 0 alerts
  • Code style: pycodestyle compliant

Checklist

  • Any dependent changes have been merged and published
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have documented my code, including function, input, and output descriptions
  • My changes generate no new warnings
  • New and existing tests pass with my changes
  • This change is covered by an existing CI test or a new one has been added
  • Any new scripts have been added to the .github/CODEOWNERS file with owners
  • I have made corresponding changes to the system documentation if necessary
Original prompt

This section details on the original issue you should resolve

<issue_title>s</issue_title>
<issue_description>When a user wishes to run a CI case locally, they use the generate_workflows.sh script, which looks through the dev/ci/cases/pr directory for YAMLs to determine which cases to run (e.g. C96C48_ufs_hybatmDA.yaml). These cases are supported on different machines, denoted by the skip_ci_on_hosts key. However, when cases are run through GitLab, the supported cases are determined by the gitlab-ci-hosts.yaml YAML. Having this in two separate locations makes for a cumbersome update procedure when new test cases are added. These lists should be consolidated in some way and ideally in a centralized and clearly labeled and documented YAML that both generate_workflows.sh and GitLab can work with.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits November 24, 2025 14:32
Create generate_host_case_matrix.py script to automatically generate
GitLab CI host matrices from skip_ci_on_hosts tags in case YAML files.
This establishes case YAMLs as the single source of truth for test
case configuration.

Co-authored-by: DavidHuber-NOAA <[email protected]>
Remove trailing whitespace and fix indentation to comply with
pycodestyle standards.

Co-authored-by: DavidHuber-NOAA <[email protected]>
- Support hostnames with hyphens in regex pattern
- Improve YAML section end detection to handle tabs
- Fix match.end() reference for correct string replacement
- Add clarifying comments

Co-authored-by: DavidHuber-NOAA <[email protected]>
Copilot AI changed the title [WIP] Consolidate CI case locations for easier updates Consolidate CI case configuration to single source of truth Nov 24, 2025
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.

s

2 participants