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

Indicate the version outdated only when it really is #668

Open
2 tasks done
IncandescentChrysalis opened this issue Nov 22, 2024 · 5 comments
Open
2 tasks done

Indicate the version outdated only when it really is #668

IncandescentChrysalis opened this issue Nov 22, 2024 · 5 comments
Assignees
Labels
good first issue Up for grabs scope/backend Related to backend changes status/triage/completed Automatic triage completed type/enhancement En enhancement/improvement to an already existing feature

Comments

@IncandescentChrysalis
Copy link

IncandescentChrysalis commented Nov 22, 2024

Issue submitter TODO list

  • I've searched for an already existing issues here
  • I'm running a supported version of the application which is listed here and the feature is not present there

Is your proposal related to a problem?

No response

Describe the feature you're interested in

Today, when not building the application directly from a release, a warning icon and a message Your app version is outdated. is displayed next to the commit ID having been compiled.

When building from a commit more recent than the latest release, this is wrong and can be confusing for a user, despite the maintainer knowing what they are doing.

The current behaviour merely rely on the latest release API (https://api.github.com/repos/kafbat/kafka-ui/releases/latest) and makes a strict equality comparison between the release tag name and the built version, for instance in ApplicationInfoBuildDTO.isLatestRelease (and maybe somewhere else too?)

The idea here would be to add a few steps to the comparison to decide whether the built version is:

  • behind
  • identical to
  • ahead of

the latest release.

The additional step would be using the GitHub's REST API to compare the latest release and the built version (be it a tag name or a commit ID): https://api.github.com/repos/kafbat/kafka-ui/compare/<latest release tag name>...<built version>
The status field from the answer provides either:

  • behind (for instance https://api.github.com/repos/kafbat/kafka-ui/compare/01aa8ab36387c5f1d66d098e71488bfb0eb5f39c...v1.0.0, 01aa8ab36387c5f1d66d098e71488bfb0eb5f39c being the latest commit from main at the moment)
  • identical (for instance https://api.github.com/repos/kafbat/kafka-ui/compare/v1.0.0...2956664bd712266f7340659dc9fbb83e6f3f1923, comparing the v1.0.0 tag against its own commit)
  • ahead (for instance https://api.github.com/repos/kafbat/kafka-ui/compare/v1.0.0...01aa8ab36387c5f1d66d098e71488bfb0eb5f39c, 01aa8ab36387c5f1d66d098e71488bfb0eb5f39c being the latest commit from main at the moment)

➽ The warning could then only be displayed in the behind case.

Additional/Optional: Maybe another message advising (warning?) to use the release tag in the identical case, if the build version is not exactly the latest release tag name, the comparison being done at the moment.

Describe alternatives you've considered

No response

Version you're running

01aa8ab

Additional context

No response

@IncandescentChrysalis IncandescentChrysalis added status/triage Issues pending maintainers triage type/feature A brand new feature labels Nov 22, 2024
@kapybro kapybro bot added status/triage/manual Manual triage in progress status/triage/completed Automatic triage completed and removed status/triage Issues pending maintainers triage labels Nov 22, 2024
@Haarolean
Copy link
Member

Sounds good. Additionally, we have to still display a warning in case of a diverged branch (having commits not present in our main branch, like here, where one of the commits is from a forked repo)

@Haarolean Haarolean added type/enhancement En enhancement/improvement to an already existing feature scope/backend Related to backend changes good first issue Up for grabs and removed type/feature A brand new feature status/triage/manual Manual triage in progress labels Nov 24, 2024
@Haarolean Haarolean moved this to Todo in Up for grabs Nov 24, 2024
@IncandescentChrysalis
Copy link
Author

IncandescentChrysalis commented Nov 25, 2024

Sounds good. Additionally, we have to still display a warning in case of a diverged branch (having commits not present in our main branch, like here, where one of the commits is from a forked repo)
Yet another message I guess, but that is interesting to detect indeed.

I would however not consider this case a warning, as there is little-to-no chance someone would build against something like this by chance, ie without knowing they are trying something special.
Maybe a discreet blue question mark icon (conveying an "unknown/undecidable situation" meaning) would fit this case?

@aguacero7
Copy link

I’d like to take care of this. Can you assign it to me?

@Haarolean
Copy link
Member

Haarolean commented Nov 26, 2024

Sounds good. Additionally, we have to still display a warning in case of a diverged branch (having commits not present in our main branch, like here, where one of the commits is from a forked repo)
Yet another message I guess, but that is interesting to detect indeed.

I would however not consider this case a warning, as there is little-to-no chance someone would build against something like this by chance, ie without knowing they are trying something special. Maybe a discreet blue question mark icon (conveying an "unknown/undecidable situation" meaning) would fit this case?

as a maintainer, sometimes a screenshot is everything I receive, so I need to deduct the version from it. It won't be the first time someone tried to report some issue having a fork with custom commits, so, the warning is needed :) Perhaps with a different text, but that doesn't sound important to me. What do you think?

@Haarolean Haarolean moved this from Todo to In Development in Up for grabs Nov 26, 2024
@IncandescentChrysalis
Copy link
Author

as a maintainer, sometimes a screenshot is everything I receive, so I need to deduct the version from it. It won't be the first time someone tried to report some issue having a fork with custom commits, so, the warning is needed :) Perhaps with a different text, but that doesn't sound important to me. What do you think?

For you maintainer use case, if you need an indicator, one bonus of my proposal is that it would be specific to the case of a commit not part of the repository history: you could spot that case at a glance from a screenshot.

For a user use case, it would keep the other advantage of not being a warning icon, hence allowing such edge case to live on without conveying the feeling of it being a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Up for grabs scope/backend Related to backend changes status/triage/completed Automatic triage completed type/enhancement En enhancement/improvement to an already existing feature
Projects
Status: In Development
Development

No branches or pull requests

3 participants