Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: always finish progress in autofixing #478

Merged
merged 6 commits into from
Apr 2, 2024

Conversation

bastiandoetsch
Copy link
Collaborator

@bastiandoetsch bastiandoetsch commented Apr 2, 2024

Description

Provide description of this PR and changes, if linked Jira ticket doesn't cover it in full.

Checklist

  • Tests added and all succeed
  • Linted
  • README.md updated, if user-facing
  • License file updated, if new 3rd-party dependency is introduced

🚨After having merged, please update the CLI go.mod to pull in latest language server.

Screenshots / GIFs

Visuals that may help the reviewer. Please add screenshots for any UI change. GIFs are most welcome!

Comment on lines 200 to 203
p.ReportWithMessage(int(math.Max(tries, 99)), "Polling for fix...")
fix, complete := pollFunc()
if !complete {
tries++
Copy link
Contributor

@cat2608 cat2608 Apr 2, 2024

Choose a reason for hiding this comment

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

Is this logic to set a ceiling to the max number of retries?

Copy link
Collaborator Author

@bastiandoetsch bastiandoetsch Apr 2, 2024

Choose a reason for hiding this comment

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

Nope, it's just to not report more than a 100% (timeout is currently set to 120, and didn't want to implement a complicated logic with rounding to integers afterwards). But I should use Min, not Max. Oops.

Comment on lines +200 to +203
p.ReportWithMessage(int(math.Min(tries, 99)), "Polling for fix...")
fix, complete := pollFunc()
if !complete {
tries++
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is going it be showing 99 until tries passes 99, right? We are not aiming to show a progress I understand

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Now, it's gonna show a progress up to the 99s limit - with Max it was only showing 99...

@bastiandoetsch bastiandoetsch merged commit 9d7d19c into main Apr 2, 2024
13 of 14 checks passed
@bastiandoetsch bastiandoetsch deleted the fix/finish-progress-also-when-autofix-fails branch April 2, 2024 14:39
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.

2 participants