Skip to content

chore(lint): reorder providers/gcp structs and re-enable fieldalignment - #596

Merged
cristim merged 6 commits into
mainfrom
chore/100-fieldalignment-gcp
Oct 20, 2026
Merged

cristim merged 6 commits into
mainfrom
chore/100-fieldalignment-gcp

Conversation

@cristim

@cristim cristim commented Oct 20, 2026

Copy link
Copy Markdown
Member

Closes #100. Last of four per-module PRs (pkg #589, providers/aws #590, providers/azure #593, providers/gcp). Merge this one last: it removes fieldalignment from govet.disable, so CI lint on the other modules only passes once their PRs are in.

Changes

  • Reorder providers/gcp struct fields to the fieldalignment-optimal layout (15 findings).
  • Six //nolint:govet // fieldalignment: file owned by open PR #471 on Client, SQLPricing, StoragePricing and RedisPricing in services/{cloudsql,cloudstorage,memorystore}/client.go.
  • .golangci.yml: drop fieldalignment from govet.disable; exclude fieldalignment: findings in _test.go (matched by message, so other govet checks still run in tests), mirroring cloud-commitments-cli#2262. Test-table layout is irrelevant and reordering positional table literals risks silent misassignment.

Checks

  • No unsafe.Sizeof or binary.Read/Write on these structs; cli, mcp and platform at origin/main have no unkeyed composite literals of module structs (AST scan).
  • go build, go vet, go test -timeout 300s -count=1 ./... and golangci-lint with the new config pass in providers/gcp and ci_cd_sanity_tests, with and without GOWORK=off; pkg, aws and azure pass with the same config once their PRs land.

🤖 Generated with Claude Code

cristim and others added 2 commits October 20, 2026 17:16
Reorder struct fields to the fieldalignment-optimal layout. SQLPricing, StoragePricing, RedisPricing and the three service Client structs keep their order with a nolint because open PR #471 modifies those files.

Part of #100

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Remove fieldalignment from govet.disable now that pkg and every provider module pass. Findings in _test.go files are excluded by message text, so other govet checks still run in tests; test-table layout is irrelevant and reordering positional table literals risks silent misassignment. Mirrors cloud-commitments-cli#2262.

Closes #100

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 9 billable files and costs up to $2.25.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 51 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 89 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: LeanerCloud/cloud-commitments-go/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 32b54aac-52f4-4fc2-afb0-bde064d53eeb
📥 Commits

Reviewing files that changed from the base of the PR and between d8c5f60 and 5703c8b.

📒 Files selected for processing: 9
  • .golangci.yml
  • providers/gcp/internal/billingguard/billingguard.go
  • providers/gcp/provider.go
  • providers/gcp/recommendations.go
  • providers/gcp/services/cloudsql/client.go
  • providers/gcp/services/cloudstorage/client.go
  • providers/gcp/services/computeengine/client.go
  • providers/gcp/services/computeengine/pricing.go
  • providers/gcp/services/memorystore/client.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

cristim and others added 4 commits October 20, 2026 17:57
…r in providers/gcp

Rebuild each reordered struct body so every field keeps its own doc comment directly above it and group headers head only the fields they describe (repeated per contiguous run where the layout splits a group). Documented fields are blank-line separated so no undocumented field sits under another field comment.

Part of #100

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cristim

cristim commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

Gate note (claude-cc-libs)

Head 5703c8b is the reviewed e9e4556 plus main (after #589 and #606). Excluding CHANGELOG.md, the added and removed lines are identical to the reviewed diff. Only .golangci.yml context lines differ, because #606 pruned neighbouring exclusions on main. Both reviewers simulated main + #589 + #596 with 0 lint issues in all 5 modules.

@cristim

cristim commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

Merge gate verdict (claude-cc-libs)

Every gate holds at head 5703c8b:

  • Two independent reviews approve the reviewed head 5703c8b. The branch was then updated from main, and the PR diff is byte-identical to the reviewed diff (compared mechanically).
  • CI is green on 5703c8b, which is the reviewed change on top of current main.
  • 0 unresolved threads; MERGEABLE/CLEAN.

CodeRabbit is waived as a merge gate under the 2026-10-19 decision. Squash-merging.

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.

lint: complete fieldalignment cleanup and re-enable the linter [go part]

1 participant