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

Error with sonar SNAPSHOT version for example '8.9.1-SNAPSHOT' #297

Closed
zorikmostly opened this issue Jan 18, 2022 · 5 comments · Fixed by #302
Closed

Error with sonar SNAPSHOT version for example '8.9.1-SNAPSHOT' #297

zorikmostly opened this issue Jan 18, 2022 · 5 comments · Fixed by #302
Assignees
Labels
bug Something isn't working done This issue was solved but not merged in master
Milestone

Comments

@zorikmostly
Copy link

Application is not working when sonarqube version is SNAPSHOT. The issue is coming from

this.versionRevision = Integer.parseInt(numbers[2]);

public void setVersion(final String pVersion, final boolean pSupported) {
    final String[] numbers = pVersion.split("\\.");
    // case when version is X.Y
    if(numbers.length >= 2) {
        this.versionMajor = Integer.parseInt(numbers[0]);
        this.versionMinor = Integer.parseInt(numbers[1]);
        // case when version is X.Y.Z
        if(numbers.length >= 3) {
            this.versionRevision = Integer.parseInt(numbers[2]);
            // case when version is X.Y.Z.build
            if(numbers.length >= 4) {
                this.versionBuild = Integer.parseInt(numbers[3]);
            }
        }
    }
    this.supported = pSupported;
}
@zorikmostly zorikmostly added the bug Something isn't working label Jan 18, 2022
@Sancretor
Copy link
Contributor

Hi @zorikmostly
Thanks for your feedback, and sorry for this issue.
We'll look into it as soon as possible.

@Sancretor Sancretor added this to the 4.1.0 milestone Jan 19, 2022
@Sancretor Sancretor self-assigned this Jan 20, 2022
@Sancretor
Copy link
Contributor

Hi @zorikmostly
As I was working on this issue, I was not able to find any SonarQube release in SNAPSHOT.
Could you please tell me where you found yours ?
It'll help me make sure the fix will work in real conditions.

@zorikzaqaryan
Copy link

This is the link for sonarqube
https://github.com/SonarSource/sonarqube/archive/refs/tags/8.9.1.44547.tar.gz

I just downloaded it, unzip and run ./start.sh
I checked version in
http://localhost:9000/api/system/status
and got something like this

{
id: "BF41A1F2-AX5xg_BeK-H7vXvCIKmF",
version: "8.9.1-SNAPSHOT",
status: "UP"
}

@Sancretor Sancretor added the done This issue was solved but not merged in master label Jan 26, 2022
@Sancretor
Copy link
Contributor

Hi @zorikzaqaryan
For the sake of simplicity, we changed the way the version was handled so this issue won't happen again.
The fix is merged in the dev branch and a new release may come soon.
Thanks for your feedback !

@Sancretor Sancretor mentioned this issue Jan 26, 2022
17 tasks
@zorikzaqaryan
Copy link

Hi @zorikzaqaryan For the sake of simplicity, we changed the way the version was handled so this issue won't happen again. The fix is merged in the dev branch and a new release may come soon. Thanks for your feedback !

@Sancretor Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working done This issue was solved but not merged in master
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants