Skip to content

feat(ci): GitHub Actions annotations, step summary, and full docs#3

Merged
machado144 merged 4 commits into
mainfrom
docs/comprehensive-improvements
May 6, 2026
Merged

feat(ci): GitHub Actions annotations, step summary, and full docs#3
machado144 merged 4 commits into
mainfrom
docs/comprehensive-improvements

Conversation

@machado144

Copy link
Copy Markdown
Contributor

Summary

  • Adds inline GitHub PR annotations for failing assertions
  • Adds step-summary rendering of results on the workflow run page
  • Fills out the docs (index, comparison, recipes, troubleshooting, contributing, changelog) and refreshes the README

Code changes

  • services/fmt_ghactions.go — new formatter emitting ::error file=...,line=...:: workflow commands
  • services/discovery.go — walk yaml.Node tree to capture per-assertion source line
  • domain/{models,results,config}.go — thread SourceFile / SourceLine through, both omitempty in JSON/YAML
  • flags.go + actions/validate.go + main.go — wire up --github-annotations (auto-on when GITHUB_ACTIONS=true)
  • .github/workflows/reusable.yml — write EMD to $GITHUB_STEP_SUMMARY, pass --github-annotations
  • integration/validate_test.go — 2 new E2E tests (failing assertions emit annotations, passing suite emits none)

Docs changes

  • docs/index.md — landing page with cross-links
  • docs/comparison.md — vs helm-unittest, chart-testing, conftest, kyverno, datree, kubeconform
  • docs/recipes.md — cookbook (multi-env, security, image pinning, labels, HPA/PDB, NetworkPolicy)
  • docs/troubleshooting.md — common authoring and runtime errors
  • examples/README.md — what each example shows + run command
  • CONTRIBUTING.md — dev setup, layer conventions, release flow
  • CHANGELOG.md — Keep a Changelog format, bootstrapped with 0.1.0
  • README.md — badges, sample output, field-path quick-ref, cross-links, honest install instructions

Test plan

  • go test ./... — 120 passed (118 existing + 2 new)
  • go vet ./... — clean
  • gofmt -l . — clean
  • golangci-lint run — 0 issues (via lefthook pre-commit)
  • Verify annotations render inline in this PR's "Files changed" view once CI runs
  • Verify step summary appears on the workflow run page

machado144 added 2 commits May 6, 2026 20:26
- Track per-assertion source line via yaml.Node walk in discovery
- Add SourceFile / SourceLine on Spec, SpecResult, AssertionResult
- New services/fmt_ghactions.go emits ::error file=...,line=...:: lines
- Add --github-annotations flag (auto-on when GITHUB_ACTIONS=true)
- Reusable workflow writes EMD output to $GITHUB_STEP_SUMMARY
- Reusable workflow passes --github-annotations to validate
- Integration tests for failing-assertion and passing-suite cases
- Add docs/index.md as docs landing page with cross-links
- Add docs/comparison.md vs helm-unittest, ct, conftest, kyverno, datree, kubeconform
- Add docs/recipes.md cookbook (multi-env, security, image pinning, labels, HPA/PDB, etc.)
- Add docs/troubleshooting.md for common authoring/runtime errors
- Add examples/README.md describing each example and run command
- Add CONTRIBUTING.md (dev setup, layer conventions, release flow)
- Add CHANGELOG.md (Keep a Changelog format) bootstrapped with 0.1.0
- README: badges, sample output block, field-path quick-ref
- README: cross-links to docs and examples
- README: honest install instructions (no tagged release yet)
- Back-link spec-format.md and reusable-workflow.md to docs index

@github-actions github-actions 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.

Core Changes

  • Implemented GitHub Actions annotations for failing assertions, allowing inline error reporting in PR diffs.
  • Added SourceLine tracking to assertions by parsing the YAML node tree during discovery.
  • Enhanced CI workflow to output test results to the GitHub Step Summary.
  • Added comprehensive documentation for users and contributors.

Concerns (if any)

  • The annotateSourceLines function uses yaml.Node parsing which is robust, but ensure that the SourceLine mapping remains accurate if the YAML structure is heavily modified by pre-run commands (though currently, it maps against the original spec.yaml).

Verdict

  • Approve: The changes are well-implemented, follow the project's design constraints, and significantly improve the developer experience in CI.

Code review performed by GEMINI - gemini-3.1-flash-lite-preview.

- Add docs/demo.gif (146KB, ~28s) showing spec, manifest, passing run, broken run
- Keep docs/demo.cast for future re-renders
- Embed GIF below README intro paragraph
- Allowlist *.gif and *.cast in structlint
@machado144 machado144 changed the title docs+ci: full docs refresh, GitHub Actions annotations, step summary feat(ci): GitHub Actions annotations, step summary, and full docs May 6, 2026

@github-actions github-actions 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.

Core Changes

  • Implemented GitHub Actions annotations for failing assertions, allowing inline error reporting in PR diffs.
  • Added step summary support to display test results directly on the workflow run page.
  • Enhanced spec discovery to track source file paths and line numbers for assertions.
  • Added comprehensive documentation for users and contributors.

Concerns (if any)

  • The annotateSourceLines function uses yaml.Node to track line numbers. While this is robust, it adds complexity to the discovery service. Ensure that future changes to the YAML structure don't break the node traversal logic.

Verdict

  • Approve: The changes are well-implemented, include necessary E2E tests, and follow the project's architectural constraints.

Code review performed by GEMINI - gemini-3.1-flash-lite-preview.

@github-actions github-actions 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.

Core Changes

  • Implemented GitHub Actions annotations for failing assertions, allowing inline error reporting in PR diffs.
  • Added step summary support to display test results directly on the workflow run page.
  • Enhanced spec discovery to track source file paths and assertion line numbers.
  • Added comprehensive documentation for users and contributors.

Concerns (if any)

  • The annotateSourceLines function uses yaml.Node traversal which is robust but adds complexity to the discovery service. The implementation is marked as best-effort, which is appropriate.

Verdict

  • Approve: The changes are well-structured, include necessary E2E tests, and follow the project's design principles.

Code review performed by GEMINI - gemini-3.1-flash-lite-preview.

- Remove docs/comparison.md
- Drop references from README, docs/index.md, CHANGELOG.md
@machado144 machado144 merged commit 4c7344d into main May 6, 2026
2 of 4 checks passed

@github-actions github-actions 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.

Core Changes

  • Implemented GitHub Actions annotations for failing assertions, allowing inline error reporting in PR diffs.
  • Added step summary support to display test results directly on the workflow run page.
  • Enhanced spec discovery to track source file paths and assertion line numbers.
  • Added comprehensive documentation for users and contributors.

Concerns (if any)

  • None. The changes are additive and follow the project's existing patterns.

Verdict

  • Approve: The changes are well-implemented, include necessary E2E tests, and follow the project's architectural constraints.

Code review performed by GEMINI - gemini-3.1-flash-lite-preview.

@github-actions github-actions 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.

Core Changes

  • Implemented GitHub Actions annotations for failing assertions, allowing inline error reporting in PR diffs.
  • Added step summary support to display test results directly on the workflow run page.
  • Enhanced spec discovery to track source file paths and assertion line numbers.
  • Added comprehensive documentation for users and contributors.

Concerns (if any)

  • None. The changes are additive and follow the project's existing patterns.

Verdict

  • Approve: The changes are well-implemented, include necessary E2E tests, and follow the project's architectural constraints.

Code review performed by GEMINI - gemini-3.1-flash-lite-preview.

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