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

[boot version validation] add progress support and error messages #1115

Closed
martinlippert opened this issue Oct 3, 2023 · 7 comments
Closed
Assignees
Labels
for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode theme: validation type: enhancement

Comments

@martinlippert
Copy link
Member

At the moment, the validation that checks the boot version of the project for newer versions and support ranges operates silently (and fails silently). We should add progress support for this validation as well as showing an error message in case something fundamentally goes wrong, for example if the validation can't retrieve the information about versions from the API at spring.io. The error message should be shown as a popup.

In order to not have annoying error messages showing up all the time due to the API not being available or accessible from the users machine, in case the user has this validation set to IGNORE, the API should not be accessed at all and the error message should therefore not show up.

@martinlippert martinlippert added type: enhancement for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode theme: validation labels Oct 3, 2023
@martinlippert martinlippert added this to the 4.20.1.RELEASE milestone Oct 3, 2023
@BoykoAlex
Copy link
Contributor

Should be fixed with 8ef70e9
Validation progress is per project. The validation itself is fast so one would rarely see the progress bar.

@martinlippert
Copy link
Member Author

It looks quite strange from a user perspective that I get the same error message for every project in my workspace when the language server has trouble accessing the API. I would expect that the error message shows up once, not per project.

In addition to that I am not sure I fully understand the "validation progress bar is per project". I guess the validation runs as a result to a "project created/updated" event and therefore has no idea how many projects are stacking up to be validated. Is that correct? In that case, the the progress bar indeed doesn't make a lot of sense, since there are no individual steps that you could visualize for the progress within one project, right?

@martinlippert martinlippert reopened this Oct 11, 2023
@BoykoAlex
Copy link
Contributor

BoykoAlex commented Oct 11, 2023

Yes, validation is scheduled once a project event is received (See BootVersionValidationConfig#bootVersionValidationScheduler(...). Currently project version validation are ran per project rather than a batch of projects. Batching so far only makes sense when the whole workspace is clean/built but it can be implemented. Project validation is done by iterating over validators (generators and latest version validators) - see ProjectVersionDiagnosticProvider. The progress bar has a step for each validator.

Anyway, if we really want to validate a bunch of projects at once - it is doable. It would depend though on the project events arrival. If they come in for a bunch of projects roughly within the same 500ms frame then the support for a batch of project would make sense and we can make this support work.

I can look into showing this particular error with fetching data from spring.io endpoint message only once...

@martinlippert
Copy link
Member Author

I can look into showing this particular error with fetching data from spring.io endpoint message only once...

This would be the important thing to tackle from my point of view.

Anyway, if we really want to validate a bunch of projects at once - it is doable. It would depend though on the project events arrival. If they come in for a bunch of projects roughly within the same 500ms frame then the support for a batch of project would make sense and we can make this support work.

It feels to me like this is not worth implementing it. The time consuming part here is fetching the version and generation data from the API, so showing progress even for hundreds of projects will probably look like watching project 1 to complete, and everything else would run super fast, so the progress bar wouldn't really bring any benefit.

We should probably reduce the progress bar report to the "fetch the data from the API" step (in case it is not cached locally yet), so that the user sees what is going on in the background ("fetching version and generation data"), and once that is done, the progress bar is complete as well. It would also not show intermediate steps (I guess), but at least you would be able to see that the language server tries to fetch data from the API and see the error message afterwards, if something went wrong. Let's focus the progress reporting here on this part.

@BoykoAlex
Copy link
Contributor

I'm thinking of caching the error state in spring io client for a 30 sec. Therefore, the error would show up only once and re-attempted in at least 30 sec, i.e. next time boot version validation needs to be computed again for project(s). Consequently, cases where internet connection is restored for example would be handled...

@BoykoAlex
Copy link
Contributor

Should behave better now with 4fe5be7

@martinlippert
Copy link
Member Author

Sounds good to me. If the network is permanently not reachable, users could switch off the validation in general to avoid the error message showing up repeatedly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode theme: validation type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants