Skip to content

fix(cost-insight): remove legacy GKE allocation cronjob - #2242

Open
dillon-zheng wants to merge 1 commit into
PingCAP-QE:mainfrom
dillon-zheng:codex/remove-legacy-gke-allocation-cron
Open

fix(cost-insight): remove legacy GKE allocation cronjob#2242
dillon-zheng wants to merge 1 commit into
PingCAP-QE:mainfrom
dillon-zheng:codex/remove-legacy-gke-allocation-cron

Conversation

@dillon-zheng

Copy link
Copy Markdown
Contributor

Summary

  • remove the legacy standalone GKE allocation CronJob
  • keep GKE allocation and attribution refresh sequenced after the GCP billing-summary sync

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_allocated to 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

@ti-chi-bot ti-chi-bot Bot added area/apps env/GCP will deploy on GCP cluster labels Aug 21, 2026
@ti-chi-bot

ti-chi-bot Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign wuhuizuo for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.yaml near 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.
  • Testing coverage:

    • The PR mentions YAML validation and git diff --check but 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.
  • 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.

@ti-chi-bot ti-chi-bot Bot added the size/M label Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apps env/GCP will deploy on GCP cluster size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant