Skip to content

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

Closed

Description

@martinlippert

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.

Activity

  1. added
    for: eclipse
    for: vscode
    on Oct 3, 2023
  2. added this to the 4.20.1.RELEASE milestone on Oct 3, 2023
  3. BoykoAlex commented on Oct 10, 2023

    @BoykoAlex
    Contributor

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

  4. martinlippert commented on Oct 11, 2023

    @martinlippert
    MemberAuthor

    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?

  5. BoykoAlex commented on Oct 11, 2023

    @BoykoAlex
    Contributor

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

  6. martinlippert commented on Oct 11, 2023

    @martinlippert
    MemberAuthor

    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.

  7. BoykoAlex commented on Oct 11, 2023

    @BoykoAlex
    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...

  8. BoykoAlex commented on Oct 11, 2023

    @BoykoAlex
    Contributor

    Should behave better now with 4fe5be7

  9. martinlippert commented on Oct 12, 2023

    @martinlippert
    MemberAuthor

    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

Metadata

Metadata

Assignees

Labels

for: eclipsefor: vscodetheme: validationtype: enhancement

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions