fix(cost-insight): remove legacy GKE allocation cronjob - #2242
fix(cost-insight): remove legacy GKE allocation cronjob#2242dillon-zheng wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
I have already done a preliminary review for you, and I hope to help you do a better job.
Summary
This PR removes the legacy standalone GKE allocation CronJob from the cronjobs.yaml file to prevent overwriting allocation facts with an outdated approach. The legacy CronJob used an older image and caused fallback behavior in the Cost API due to lack of summary-row lineage. The approach is a straightforward deletion of the entire CronJob definition, while keeping the newer GKE allocation and attribution refresh workflow intact. The YAML syntax and formatting appear valid, and the removal is cleanly scoped without partial edits.
Critical Issues
- None found. The removal of the legacy CronJob is a safe operation that does not introduce bugs or regressions.
Code Improvements
- None needed for this removal. The PR correctly deletes the entire legacy CronJob without leaving dangling references.
Best Practices
-
Documentation:
- File:
apps/gcp/cost-insight/cronjobs.yaml(removed section) - The PR description explains the rationale well, but adding a comment in
cronjobs.yamlnear the remaining GKE allocation jobs could clarify that the legacy job was intentionally removed and why. This helps future maintainers understand the history without digging through PRs. - Suggested comment to add near the newer GKE allocation jobs:
# Legacy GKE allocation CronJob removed in 2024-06 to avoid stale data overwrites. # Current allocation and attribution jobs are sequenced after billing-summary sync.
- File:
-
Testing coverage:
- The PR mentions YAML validation and
git diff --checkbut no runtime or integration tests. Consider if any end-to-end or integration tests exist for the cost-insight jobs that should be updated to confirm the legacy job is no longer expected or invoked.
- The PR mentions YAML validation and
-
Commit message / PR description:
- The PR description is clear, but adding a brief note on how the legacy job caused fallback to current attribution (e.g., a link to an issue or bug report) would improve traceability.
Overall, this PR cleanly removes obsolete infrastructure and improves cost attribution reliability. Adding a brief comment in the YAML about the removal and verifying test coverage would further enhance maintainability.
Summary
Why
The legacy job uses an older image and overwrites allocation facts without summary-row lineage. That forces the Cost API to fall back from
residual_allocatedto current attribution.Validation
ruby -e 'require "yaml"; YAML.load_stream(File.read("apps/gcp/cost-insight/cronjobs.yaml")); puts "YAML valid"'\n-git diff --check