Skip to content

Add semantic YAML diff PR comments via shared workflow#130

Merged
weatherhog merged 3 commits into
mainfrom
add-yaml-diff-bot
Jun 30, 2026
Merged

Add semantic YAML diff PR comments via shared workflow#130
weatherhog merged 3 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>
weatherhog and others added 2 commits May 29, 2026 11:18
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

No semantic YAML differences in changed source files. (Key reordering without value changes is ignored.)

Suppress with /no_diffs_printing on its own line in the PR body or as a comment.

@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

@weatherhog weatherhog merged commit 7e41273 into main Jun 30, 2026
10 checks passed
@weatherhog weatherhog deleted the add-yaml-diff-bot branch June 30, 2026 14:27
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.

3 participants