Skip to content

Conversation

@cuisongliu
Copy link
Collaborator

…e files

@cuisongliu cuisongliu requested review from a team as code owners October 17, 2025 10:24
@cuisongliu cuisongliu changed the title refactor: update code style and improve error handling across multiple files refactor(golint): update code style and improve error handling across multiple files Oct 17, 2025
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

@codecov
Copy link

codecov bot commented Oct 18, 2025

Codecov Report

❌ Patch coverage is 73.60000% with 33 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.12%. Comparing base (9c07d8a) to head (0df09cf).
⚠️ Report is 28 commits behind head on main.

Files with missing lines Patch % Lines
lifecycle/pkg/apply/scale.go 60.78% 20 Missing ⚠️
lifecycle/pkg/apply/run.go 50.00% 2 Missing and 3 partials ⚠️
lifecycle/pkg/env/env.go 0.00% 4 Missing ⚠️
lifecycle/pkg/apply/reset.go 0.00% 2 Missing and 1 partial ⚠️
lifecycle/pkg/apply/apply.go 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6105      +/-   ##
==========================================
+ Coverage   61.86%   64.12%   +2.25%     
==========================================
  Files           8        8              
  Lines         653      722      +69     
==========================================
+ Hits          404      463      +59     
- Misses        202      212      +10     
  Partials       47       47              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

@cuisongliu cuisongliu added this to the v5.1 milestone Oct 18, 2025
@cuisongliu
Copy link
Collaborator Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

func (c *ScaleProcessor) RunGuest(cluster *v2.Cluster) error {
logger.Info("Executing pipeline RunGuest in ScaleProcessor.")
hosts := append(c.MastersToJoin, c.NodesToJoin...)
hosts := append(append([]string{}, c.MastersToJoin...), c.NodesToJoin...)
Copy link
Member

Choose a reason for hiding this comment

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

Can we use slices.Clone followed by append?

func (c ScaleProcessor) UnMountRootfs(cluster *v2.Cluster) error {
logger.Info("Executing pipeline UnMountRootfs in ScaleProcessor.")
hosts := append(c.MastersToDelete, c.NodesToDelete...)
hosts := append(append([]string{}, c.MastersToDelete...), c.NodesToDelete...)
Copy link
Member

Choose a reason for hiding this comment

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

Same issue, and there are other places as well.

@cuisongliu
Copy link
Collaborator Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 29 to +40

time.Sleep(trySleepTime * time.Duration(2*i+1))
}
return fmt.Errorf("retry action timeout: %v", err)
return fmt.Errorf("retry action timeout: %w", err)
}

// RetryWithBackoff provides exponential backoff retry with jitter
func RetryWithBackoff(maxAttempts int, baseDelay time.Duration, action func() error) error {
var lastErr error
for attempt := range maxAttempts {
if err := action(); err == nil {
return nil

Choose a reason for hiding this comment

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

P0 Badge Replace invalid range loops with counted for

The new loops call for i := range tryTimes (and similarly range maxAttempts) where tryTimes and maxAttempts are integers. In Go an int is not iterable, so this code does not compile at all; the range keyword only works with arrays, slices, maps, strings or channels. The original counted for loop compiled correctly. Please switch back to a standard for i := 0; i < tryTimes; i++ style loop (and likewise for the other two retry helpers) so that the package builds.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants