Skip to content

Fix :latest checker version resolution for compliance-checker >= 6.0.0#24

Merged
sol1105 merged 4 commits into
ESGF:masterfrom
swarnaleem:fix/latest-version-resolution
Apr 30, 2026
Merged

Fix :latest checker version resolution for compliance-checker >= 6.0.0#24
sol1105 merged 4 commits into
ESGF:masterfrom
swarnaleem:fix/latest-version-resolution

Conversation

@swarnaleem

@swarnaleem swarnaleem commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

compliance-checker v6.0.0 removed the :latest alias. Before this, CheckSuite.checkers had keys like cf:latest alongside cf:1.11. Now it only has the explicit version. Since esgf-qa was passing cf:latest directly to CheckSuite.run_all(), users on CC >= 6.0.0 would hit:

KeyError: 'cf:latest'

making esgf-qa completely broken unless the exact installed version is passed explicitly (e.g. -t cf:1.11).

The fix moves the :latest resolution into esgf-qa itself. The existing get_installed_checker_versions() already loads all registered checkers and builds a sorted list of available versions per checker name. A new resolve_latest_version() function uses that to map "latest" to the actual highest installed version number before the checker strings are handed off to compliance-checker. So -t cf, -t cf:latest, -t wcrp_cmip6:latest all continue to work as before.

A couple of related fixes are included:

  • get_checker_release_versions() had check_suite.checkers.get(checker, "unknown version")._cc_spec_version which crashes with AttributeError when the key isn't found (since .get() returns the fallback string). Now it falls back to finding the highest versioned key for that checker name.
  • The "cc6:latest" in checker string check in run_compliance_checker() was hardcoded and would break once versions are resolved. Changed to checker.split(":")[0] in ("cc6", "mip").
Known pre-existing failures

test_args5 and test_args6 were already failing before this change. They fail because the wcrp-data-checker plugin's sanitize() function does not handle numpy.datetime64, so consistency output files are never written and Part 2 of the QA run fails.

Edit:

@sol1105

sol1105 commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the update. After looking more deeply into the compliance-checker lookup behavior, :latest was always only an alias for an unversioned checker selection, so eg. cc6:latest was always treated internally same as cc6 and I think we should do the same here.

To sum up, I think the best approach for us is:

  • still allowing :latest, but internally in that case use unversioned checker names
  • let compliance-checker handle latest-version selection, instead of doing that ourselves

@sol1105 sol1105 merged commit 62263ea into ESGF:master Apr 30, 2026
4 checks passed
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.

Incompatibility Issue Between esgf-qa and compliance-checker v6.0.0 Due to Removed :latest Alias

2 participants