Skip to content

Replace yamllint action with make targets, add kyaml mode#705

Open
wikkyk wants to merge 3 commits intomainfrom
claude/yamllint
Open

Replace yamllint action with make targets, add kyaml mode#705
wikkyk wants to merge 3 commits intomainfrom
claude/yamllint

Conversation

@wikkyk
Copy link
Copy Markdown
Collaborator

@wikkyk wikkyk commented Apr 8, 2026

Description of changes:

Replace ibiqlik/action-yamllint GitHub Action with make yamllint. There is no need to use an action (with all its security and maintenance burden) where we have a make target and yamllint can output GitHub annotations.

The yamllint make target runs both yamllint (with -f github when in an action) and yamlfmt -lint -quiet (fails if files need formatting).
The yamlfmt target no longer runs yamlfmt twice, -verbose prints changed files à la go fmt.

Enable yamlfmt's KYAML mode. This might not be acceptable for us just yet.
Cleaned up the yaml{lint,fmt} configs so that they're consistent.

Testing performed:
linting and fmting in action and on my machine.
yamllint is failing correctly: we have files with lints that were previously excluded.

@wikkyk
Copy link
Copy Markdown
Collaborator Author

wikkyk commented Apr 9, 2026

The kyaml linter is documented as not taking any options so if we decide on going through with it then we'll need to adjust the configs a wee bit further.

@wikkyk wikkyk marked this pull request as ready for review April 9, 2026 09:08
@wikkyk wikkyk added the github_actions Pull requests that update GitHub Actions code label Apr 10, 2026
@wikkyk wikkyk marked this pull request as draft April 13, 2026 11:14
@wikkyk wikkyk force-pushed the claude/review-github-workflows-2i3Hc branch from aa99b2e to ade227b Compare April 17, 2026 12:50
Base automatically changed from claude/review-github-workflows-2i3Hc to main April 21, 2026 07:10
Drop the ibiqlik/action-yamllint GitHub Action in favour of a plain
`make yamllint` invocation. The new target runs yamllint (with -f
github for CI annotations) followed by yamlfmt -lint -quiet. Switch
yamlfmt to kyaml mode for Kubernetes-native YAML canonicalization.
Align exclude lists between .yamllint and .yamlfmt configs, tighten
yamllint coverage by removing config/default and config/manager from
the ignore list.

Co-authored-by: Claude <noreply@anthropic.com>
@wikkyk wikkyk added the e2e/none skip all e2e tests (documentation etc) - overrides all e2e/* labels label Apr 21, 2026
wikkyk and others added 2 commits April 21, 2026 09:12
The file mixed 1-space and 2-space indentation across its two
documents. yamllint's spaces: consistent rule catches the mismatch
now that config/default is covered.

Co-authored-by: Claude <noreply@anthropic.com>
- Add document-start markers (---) to .custom-gcl.yaml, .golangci.yml,
  .golangci-kal.yml, .mockery.yaml, and config/manager/kustomization.yaml.
- Add missing space after # in commented-out YAML blocks in examples/.
- Suppress line-length on two unsplittable regex strings in .golangci.yml
  via yamllint disable-line directives.

Co-authored-by: Claude <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

@wikkyk wikkyk marked this pull request as ready for review April 21, 2026 22:15
Copilot AI review requested due to automatic review settings April 21, 2026 22:15
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Reworks YAML linting/formatting in CI and locally by switching from a dedicated GitHub Action to repository make targets, while standardizing YAML formatting (including enabling yamlfmt’s KYAML mode).

Changes:

  • Replace ibiqlik/action-yamllint with make yamllint in the lint workflow and add a yamllint Makefile target that runs both yamllint and yamlfmt -lint.
  • Update yamlfmt/yamllint configs and add YAML document-start markers / indentation fixes across various YAML files.
  • Enable yamlfmt “kyaml” formatting mode.

Reviewed changes

Copilot reviewed 9 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
examples/cluster.yaml Reformat commented IPAM examples to match formatter/linter expectations.
examples/cluster-cilium.yaml Same formatting adjustments as examples/cluster.yaml.
examples/cluster-calico.yaml Same formatting adjustments as examples/cluster.yaml.
config/manager/kustomization.yaml Add --- document start marker to satisfy YAML lint/format rules.
config/default/webhookcainjection_patch.yaml Fix indentation under metadata to satisfy YAML formatting/linting.
Makefile Add yamllint target (yamllint + yamlfmt lint) and adjust yamlfmt invocation.
.yamllint Tighten/adjust ignore set and clarify rationale; keeps document-start required.
.yamlfmt Remove include: list, expand scope, and switch formatter type to kyaml.
.mockery.yaml Add --- document start marker.
.golangci.yml Add --- document start marker and line-length suppressions for yamllint.
.golangci-kal.yml Add --- document start marker.
.github/workflows/lint.yml Replace yamllint action usage with make yamllint.
.custom-gcl.yaml Add --- document start marker.

Comment on lines 37 to +41
- name: Install yamllint
run: |
sudo apt-get update
sudo apt-get install -y yamllint
- uses: ibiqlik/action-yamllint@2576378a8e339169678f9939646ee3ee325e845c # v3.1.1
with:
format: github
- run: make yamllint
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

The yamllint job now runs make yamllint, which calls go tool yamlfmt ..., but this job no longer sets up Go. Please add an actions/setup-go step (with go-version-file: go.mod) before running make yamllint to avoid relying on whatever Go happens to be preinstalled on the runner.

Copilot uses AI. Check for mistakes.
Comment thread .yamlfmt
- config/certmanager
- config/prometheus
- config/rbac
- out
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

.yamlfmt no longer restricts/limits which YAML files are processed (the previous include: list is removed) and it does not exclude directories that are explicitly ignored by .yamllint (e.g. .github/workflows, templates, test/e2e). Since make yamllint runs go tool yamlfmt -lint -quiet after yamllint, this can cause CI to fail or format-check files that yamllint intentionally skips. Consider aligning .yamlfmt scope with .yamllint (add matching excludes, or reintroduce an explicit include: list).

Suggested change
- out
- out
# align with .yamllint ignored paths
- .github/workflows
- templates
- test/e2e

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e/none skip all e2e tests (documentation etc) - overrides all e2e/* labels github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants