Skip to content

feat: add version drift-check for cluster_setup scripts and docs - #190

Open
kupratyu-splunk wants to merge 1 commit into
mainfrom
feat/scripts-versioning
Open

feat: add version drift-check for cluster_setup scripts and docs#190
kupratyu-splunk wants to merge 1 commit into
mainfrom
feat/scripts-versioning

Conversation

@kupratyu-splunk

Copy link
Copy Markdown
Collaborator

Tags every hardcoded tool/chart version in tools/cluster_setup and docs/deployment/k0s-quick-reference.md with an inline ver: marker, cross-checked against a new versions.env source of truth by check_versions.sh. Wired into cluster-setup-tests.yml so drift fails CI instead of silently diverging between scripts and docs.

Description

Related Issues

  • Related to #

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test improvement
  • CI/CD improvement
  • Chore (dependency updates, etc.)

Changes Made

Testing Performed

  • Unit tests pass (make test)
  • Linting passes (make lint)
  • Integration tests pass (if applicable)
  • E2E tests pass (if applicable)
  • Manual testing performed

Test Environment

  • Kubernetes Version:
  • Cloud Provider:
  • Deployment Method:

Test Steps

Documentation

  • Updated inline code comments
  • Updated README.md (if adding features)
  • Updated API documentation
  • Updated deployment guides
  • Updated CHANGELOG.md
  • No documentation needed

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published
  • I have updated the Helm chart version (if applicable)
  • I have updated CRD schemas (if applicable)

Breaking Changes

Impact:

Migration Path:

Screenshots/Recordings

Additional Notes

Reviewer Notes

Please pay special attention to:


Commit Message Convention: This PR follows Conventional Commits

Tags every hardcoded tool/chart version in tools/cluster_setup and
docs/deployment/k0s-quick-reference.md with an inline ver:<KEY> marker,
cross-checked against a new versions.env source of truth by
check_versions.sh. Wired into cluster-setup-tests.yml so drift fails CI
instead of silently diverging between scripts and docs.

Co-Authored-By: Claude <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b98eb0d65d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +53 to +55
done < <(grep -rn 'ver:[A-Za-z0-9_]\+' \
--include='*.sh' --include='*.md' \
"${REPO_ROOT}/tools/cluster_setup" "${REPO_ROOT}/docs/deployment" 2>/dev/null)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Cover unmarked runtime pins with drift validation

Because this scan only discovers existing ver: markers, it cannot enforce the stated requirement that every pinned version is checked. For example, the online k0s installer still hardcodes the unmarked cert-manager URL at k0s_cluster_with_stack.sh:3337 and KubeRay versions at lines 4844–4851. Bumping K0S_CERT_MANAGER_VERSION and every marked occurrence to v1.14.0 still makes this check pass while the online installer fetches v1.13.0, allowing the online and air-gapped paths to drift.

Useful? React with 👍 / 👎.


# Require a non-identifier char (or start of line) before "ver:" so this
# doesn't false-match inside words like "nvidia-driver:latest-dkms".
[[ "${content}" =~ (^|[^A-Za-z0-9_-])ver:([A-Za-z0-9_]+) ]] || continue

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Validate every marker found on a line

This regex extracts only the first ver:<KEY> occurrence from each grep result. Several newly tagged documentation lines contain multiple markers, such as the binaries row in K0S_README.md:1394; changing its second YQ_VERSION value to v9.99.9 still produces “No version drift” because only the preceding K0S_VERSION marker is checked. Iterate through all marker matches in each line rather than using a single BASH_REMATCH.

Useful? React with 👍 / 👎.

fi

expected="${EXPECTED[${key}]}"
if ! grep -qF -- "${expected}" <<<"${content}"; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject version values that merely contain the expected prefix

The fixed-string containment test accepts a different version whenever it starts with the expected value. For example, with YQ_VERSION=v4.44.10 in versions.env, a tagged site containing v4.44.100 passes this check. This can silently miss ordinary patch-version drift, so the match needs version-token boundaries while still permitting formats such as a leading v or an embedded URL.

Useful? React with 👍 / 👎.

Comment on lines +53 to +55
done < <(grep -rn 'ver:[A-Za-z0-9_]\+' \
--include='*.sh' --include='*.md' \
"${REPO_ROOT}/tools/cluster_setup" "${REPO_ROOT}/docs/deployment" 2>/dev/null)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Propagate failures from the marker scan

The grep runs in a process substitution, so its nonzero status is not propagated, and stderr is discarded. If either configured scan root is missing, renamed, or unreadable while the other still contains markers, the script reports success without checking that entire scope; for example, removing docs/deployment still yields “Checked 50 marker(s). No version drift.” Capture and validate the scan command's status instead of treating partial output as a complete scan.

Useful? React with 👍 / 👎.

Base automatically changed from ai-tier-ga-internal to main August 27, 2026 09:07
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.

1 participant