Skip to content

Actually validate the ISO registry - #2534

Merged
bert-e merged 1 commit into
development/2.16from
bugfix/ZENKO-5358-validate-registry
Sep 16, 2026
Merged

bert-e merged 1 commit into
development/2.16from
bugfix/ZENKO-5358-validate-registry

Conversation

@francoisferrand

Copy link
Copy Markdown
Contributor

validate_registry was meant to abort the ISO build when an image referenced by zenkoversion.yaml is missing from the registry. It has never checked a single image.

.. walks sequence nodes too (spec.capabilities.lifecycleRules, locationTypes), and yq treats indexing one with a string key as a hard error rather than a miss:

Error: cannot index array with 'image' (strconv.ParseInt: parsing "image": invalid syntax)

yq evaluates the whole expression before emitting anything, so a single sequence anywhere in the file empties the entire output — position doesn't matter. It ran inside a process substitution, so set -e never fired, the loop body never ran, missing stayed 0, and every build printed "Registry validation passed: all images are present."

Restricting the traversal to mapping nodes yields the expected 34 references. The list is now read into a variable first, so a yq failure or an empty result aborts instead of silently validating nothing — the original shape hid the exit status twice over.

Also adds coverage under tests/scripts/, since nothing exercised this function: all-present passes, each missing image aborts, and unreadable/empty input aborts. Those cases all pass against the previous code, which is the point.

Verification

Against the real zenkoversion.yaml, with one image absent from a temp IMAGES_ROOT:

expression result
before missing=0 → passes, missing image undetected
after missing=1 → aborts

New tests: 6 of 7 fail against the previous code, all 7 pass after. Full pytest tests/scripts/ green (18), also run under the CI-pinned yq 4.44.3 as well as the 4.53.6 on the runners.

Cross-checked that turning the check on doesn't expose latent breakage: all 34 referenced images are among the 37 the build copies, so CI stays green.

Based on development/2.14validate_registry doesn't exist on 2.11–2.13, so this is the earliest affected branch.

Issue: ZENKO-5358

@bert-e

bert-e commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Hello francoisferrand,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/bypass_source_branch_lineage Bypass the cross-branch contamination check
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request.
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

validate_registry() never validated anything: `..` also walks sequences, and
yq treats indexing one with a string key as a hard error rather than a miss.
It ran inside a process substitution, so the failure was invisible, the loop
body never ran, and every build reported "all images are present" — including
builds shipping an ISO with a missing image.

Restrict the search to mapping nodes, and read the list into a variable so a
failing yq or an empty result aborts the build instead of passing silently.

Issue: ZENKO-5358
@francoisferrand
francoisferrand force-pushed the bugfix/ZENKO-5358-validate-registry branch from 30d8251 to e1098f2 Compare September 16, 2026 05:46
@francoisferrand
francoisferrand changed the base branch from development/2.14 to development/2.16 September 16, 2026 05:47
@scality scality deleted a comment from bert-e Sep 16, 2026
@scality scality deleted a comment from bert-e Sep 16, 2026
@scality scality deleted a comment from bert-e Sep 16, 2026
@francoisferrand

Copy link
Copy Markdown
Contributor Author

/approve

@bert-e

bert-e commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/2.16

The following branches have NOT changed:

  • development/2.10
  • development/2.11
  • development/2.12
  • development/2.13
  • development/2.14
  • development/2.15
  • development/2.5
  • development/2.6
  • development/2.7
  • development/2.8
  • development/2.9

This pull request did not target the following hotfix branch(es) so they
were left untouched:

  • hotfix/2.13.5

Please check the status of the associated issue ZENKO-5358.

Goodbye francoisferrand.

The following options are set: approve

@bert-e
bert-e merged commit e1098f2 into development/2.16 Sep 16, 2026
22 checks passed
@bert-e
bert-e deleted the bugfix/ZENKO-5358-validate-registry branch September 16, 2026 12:12
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.

4 participants