Skip to content

Add semantic YAML diff PR comments via shared workflow#130

Open
weatherhog wants to merge 2 commits into
mainfrom
add-yaml-diff-bot
Open

Add semantic YAML diff PR comments via shared workflow#130
weatherhog wants to merge 2 commits into
mainfrom
add-yaml-diff-bot

Conversation

@weatherhog

Copy link
Copy Markdown
Contributor

Summary

Adopts the new giantswarm/github-workflows/.github/workflows/yaml-diff.yaml reusable workflow. On every PR, a bot now posts a semantic YAML diff (via dyff) of changed source files as a sticky comment, ignoring key reordering.

This is additive infrastructure for giantswarm/roadmap#4121. No existing CI behaviour changes:

  • key-ordering: {} in .yamllint stays in this PR. yamllint continues to enforce alphabetical key ordering as before.
  • The bot just adds a clean semantic-diff comment alongside.

Once the bot has run on real PRs and proves stable (~1–2 weeks), a separate small PR will drop key-ordering: {} from .yamllint, closing #4121.

Changes

  • New .github/workflows/yaml-diff.yaml — thin caller; declares its own pull-requests: write + contents: read permissions (a reusable workflow can only narrow, not grant).
  • .github/workflows/validate.yaml — bump dyff_ver from 1.5.4 to 1.7.1 to match the shared workflow.
  • CHANGELOG.md — entries under Unreleased.

Dependency

Depends on giantswarm/github-workflows#190 being merged. The caller references @main, matching the convention used by other gitops-template reusable callers.

Test plan

  • After merging feat: add yaml-diff reusable workflow github-workflows#190, this PR's own CI should post a YAML-diff comment (nothing semantic to diff in this PR though).
  • Follow-up: open a test PR with a key-reorder-only change → expect yamllint to still fail (rule still in place) and bot to post "No semantic YAML differences" — proves the bot can detect the no-op even with the rule active.
  • Follow-up: open a test PR with a value change → bot posts only the value diff.
  • Follow-up: /no_diffs_printing in PR body → bot skips posting.
  • Confirm the existing rendered-Helm-diff get-diff job still works after the dyff_ver bump.

🤖 Generated with Claude Code

Calls the new giantswarm/github-workflows/yaml-diff reusable workflow on
every PR. It posts a semantic YAML diff (via dyff) of changed source files
as a sticky PR comment, ignoring key reordering. This is the enabling
infrastructure for giantswarm/roadmap#4121 — once the bot proves stable on
real PRs, a follow-up will drop the alphabetical key-ordering rule from
.yamllint, letting users write conventional Kubernetes ordering
(apiVersion, kind, metadata, spec, status).

Also bumps the existing get-diff job's dyff_ver from 1.5.4 to 1.7.1 to
standardize on the version used by the shared workflow.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The new Unreleased entries exceeded the 120-char line-length limit
enforced by the pre-commit markdownlint hook. Bullets wrapped with
2-space continuation; rendered output is unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Validation output log
yamllint: OK
kubeconform: OK

yamllint: OK
kubeconform: OK

yamllint: OK
kubeconform: OK

yamllint: OK
kubeconform: OK

yamllint: OK
kubeconform: OK

yamllint: OK
kubeconform: OK

yamllint: OK
kubeconform: OK

yamllint: OK
kubeconform: OK

yamllint: OK
kubeconform: OK


@github-actions

Copy link
Copy Markdown
Rendered manifest diff output log

No diff detected

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