Skip to content

refactor(azure,gcp): use common.HoursPerYear instead of 8760 literals - #568

Merged
cristim merged 3 commits into
mainfrom
refactor/hours-per-year-constant
Oct 20, 2026
Merged

cristim merged 3 commits into
mainfrom
refactor/hours-per-year-constant

Conversation

@cristim

@cristim cristim commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Summary

Part of #109 (go part only). Adds common.HoursPerYear (8760) in pkg/common and replaces the bare 8760 literals with it in azure cache, compute, cosmosdb, database, managedredis, search and synapse, and in gcp computeengine pricing.go (dropping its private copy). Behavior-preserving: no existing test changed.

Pin note

Commit 1 adds the pkg constant; commit 2 pins azure and gcp go.mod to commit 1 (the go#535 pattern) so GOWORK=off builds. A chore: pin pkg to main follow-up is needed after merge (as #537 did for #535).

Test plan

build, vet, go test -count=1 ./..., golangci-lint for pkg, providers/azure, providers/gcp, each with and without GOWORK=off: all pass. Secrets allowlist 44 PASS.

🤖 Generated with Claude Code

cristim and others added 2 commits October 20, 2026 07:43
Part of #109

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace the bare 8760 term-hours literals in the azure cache, compute,
cosmosdb, database, managedredis, search and synapse clients and the gcp
computeengine pricing helper (which carried its own copy) with the shared
constant, and pin pkg to the commit that adds it. No behavior change.

Part of #109

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 11 billable files and costs up to $2.75.

  • 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 3 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 88 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: 76e18690-7377-4737-94c0-025e3d2b2155
📥 Commits

Reviewing files that changed from the base of the PR and between c223501 and e9f38c8.

⛔ Files ignored due to path filters: 2
  • providers/azure/go.sum is excluded by !**/*.sum
  • providers/gcp/go.sum is excluded by !**/*.sum
📒 Files selected for processing: 11
  • pkg/common/hours.go
  • providers/azure/go.mod
  • providers/azure/services/cache/client.go
  • providers/azure/services/compute/client.go
  • providers/azure/services/cosmosdb/client.go
  • providers/azure/services/database/client.go
  • providers/azure/services/managedredis/client.go
  • providers/azure/services/search/client.go
  • providers/azure/services/synapse/client.go
  • providers/gcp/go.mod
  • providers/gcp/services/computeengine/pricing.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@cristim

cristim commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

Merge gate verdict (claude-cc-libs)

Every gate holds at head e9f38c8:

  • Two independent reviews approve the reviewed head a1598c2. The branch was then updated from main, and the PR diff is byte-identical to the reviewed diff (compared mechanically).
  • CI is green on e9f38c8, 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.

@cristim
cristim merged commit 8b17ccb into main Oct 20, 2026
15 checks passed
cristim added a commit that referenced this pull request Oct 20, 2026
Squash merges #564 and #568 left providers/aws, providers/azure and
providers/gcp pinned to pkg pseudo-versions of branch commits (ff6225d,
66c6c61) that are not on main. Re-pin all provider modules and
ci_cd_sanity_tests to main 92722e6.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@cristim
cristim deleted the refactor/hours-per-year-constant branch October 20, 2026 09:55
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