Skip to content

chore(router): gofmt check in CI (#2576)#2583

Merged
dkorittki merged 9 commits intomainfrom
dominik/formatting-check-in-ci
Mar 31, 2026
Merged

chore(router): gofmt check in CI (#2576)#2583
dkorittki merged 9 commits intomainfrom
dominik/formatting-check-in-ci

Conversation

@dkorittki
Copy link
Copy Markdown
Contributor

@dkorittki dkorittki commented Mar 4, 2026

Summary by CodeRabbit

  • Chores
    • Added automated Go code formatting validation to the CI/CD pipeline
    • Added code formatting build targets across project modules

Checklist

Adds gofmt validation in go-linter Github action, which is enforced in router/, router-tests/, aws-lambda-router/, graphqlmetrics/ and composition-go/ directories

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 4, 2026

Caution

Review failed

The head commit changed during the review from 7430d69 to d74a0c7.

Walkthrough

This PR adds Go code formatting enforcement across the repository. A new GitHub Action step verifies gofmt compliance in CI, while format Makefile targets are added to multiple modules to run go fmt ./... locally.

Changes

Cohort / File(s) Summary
GitHub Action
.github/actions/go-linter/action.yaml
Adds a new step "Check gofmt formatting" that runs gofmt -l to identify unformatted files and fails if any are found.
Makefile Format Targets
aws-lambda-router/Makefile, composition-go/Makefile, graphqlmetrics/Makefile, router-tests/Makefile, router/Makefile
Adds a format target executing go fmt ./... across all modules; .PHONY declaration updated in composition-go/Makefile.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • chore(router): gofmt #2576: Applies gofmt formatting to repository files, complementing this PR's addition of formatting checks and targets.
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore(router): gofmt check in CI' clearly and concisely summarizes the main change—adding gofmt formatting validation to the CI pipeline.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dkorittki dkorittki changed the title chore(router): gofmt check in CI (#2576) chore(router, router-tests, aws-lambda-router, graphqlmetrics and composition-go): gofmt check in CI (#2576) Mar 4, 2026
@dkorittki dkorittki changed the title chore(router, router-tests, aws-lambda-router, graphqlmetrics and composition-go): gofmt check in CI (#2576) chore(router): gofmt check in CI (#2576) Mar 4, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 4, 2026

Router-nonroot image scan passed

✅ No security vulnerabilities found in image:

ghcr.io/wundergraph/cosmo/router:sha-1334fad30bb43a8ab59533a68b69352ba97fe19b-nonroot

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.34%. Comparing base (9be9143) to head (d545e8d).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2583       +/-   ##
===========================================
+ Coverage   45.67%   63.34%   +17.66%     
===========================================
  Files        1032      249      -783     
  Lines      138877    26643   -112234     
  Branches     8628        0     -8628     
===========================================
- Hits        63435    16876    -46559     
+ Misses      73716     8404    -65312     
+ Partials     1726     1363      -363     
Files with missing lines Coverage Δ
router/pkg/trace/meter.go 45.16% <ø> (ø)

... and 786 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/actions/go-linter/action.yaml:
- Around line 25-34: The gofmt check in the "Check gofmt formatting" workflow
step currently uses a non-recursive pattern (`gofmt -l .`) which misses
subdirectories; update the shell command that populates the `files` variable to
use the recursive pattern (`gofmt -l ./...`) so it matches the project's `make
format`/`go fmt ./...` behavior and detects unformatted Go files in
subdirectories.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4370e009-40b3-4349-9061-26db807de6af

📥 Commits

Reviewing files that changed from the base of the PR and between cba52c3 and d4ab132.

📒 Files selected for processing (6)
  • .github/actions/go-linter/action.yaml
  • aws-lambda-router/Makefile
  • composition-go/Makefile
  • graphqlmetrics/Makefile
  • router-tests/Makefile
  • router/Makefile

Comment thread .github/actions/go-linter/action.yaml
@dkorittki
Copy link
Copy Markdown
Contributor Author

fyi I removed the Makefile, husky, etc. stuff because #2579 already adds that

@comatory
Copy link
Copy Markdown
Contributor

comatory commented Mar 4, 2026

If we merge my PR first, you could then just call make format <package>, this way we have the formatter centralized. Up to you though.

@github-actions
Copy link
Copy Markdown

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions Bot added the Stale label Mar 19, 2026
Comment thread .github/actions/go-linter/action.yaml
@github-actions github-actions Bot removed the Stale label Mar 31, 2026
@dkorittki dkorittki requested a review from SkArchon as a code owner March 31, 2026 09:25
@dkorittki dkorittki merged commit 4e2b146 into main Mar 31, 2026
38 checks passed
@dkorittki dkorittki deleted the dominik/formatting-check-in-ci branch March 31, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants