Cannot make the plugin work with BB 7.6

Issue #26 resolved
Maxime Lemanissier created an issue

Hi,

I had the plugin work fine with BB 6.10.2, and after upgrading it to 7.6.2, i can’t make it work.

Here’s how it used to work on BB6

/data/jenkins/tools/hudson.tasks.Maven_MavenInstallation/3.6.1/bin/mvn com.atlassian.bitbucket:code-coverage-maven-plugin:publish -Dbitbucket.url=https://bitbucket.domain.com -Dbitbucket.user=**** -Dbitbucket.password=**** -Dbitbucket.commit.id=commitId -Dcoverage.format=LCOV -Dcoverage.file=coverage-server/lcov.info -Dproject.directory=/data/jenkins/workspace/PR-4285/sources

Running this on BB7 returns a success, but i cannot see any coverage information in my pull request.

I saw in the documentation that optional parameters are available to provide the project and repository id and when they’re not provided, the commit may not be found. I thought that maybe that’s why the coverage info is not displayed so i tried to add these parameters:

/data/jenkins/tools/hudson.tasks.Maven_MavenInstallation/3.6.1/bin/mvn com.atlassian.bitbucket:code-coverage-maven-plugin:publish -Dbitbucket.url=https://bitbucket.domain.com -Dbitbucket.user=**** -Dbitbucket.password=**** -Dbitbucket.project.key=projectId -Dbitbucket.repository.slug=repositoryId -Dbitbucket.commit.id=commitId -Dcoverage.format=LCOV -Dcoverage.file=coverage-server/lcov.info -Dproject.directory=/data/jenkins/workspace/PR-4285/sources

But in this case, the mvn plugin gets an http404 from the Bitbucket plugin

[ERROR] Failed to execute goal com.atlassian.bitbucket:code-coverage-maven-plugin:3.2.2:publish (default-cli) on project standalone-pom: Failed to post coverage info to bitbucket: [Failure: com.github.kittinunf.fuel.core.HttpException: HTTP Exception 404 ] -> [Help 1]

I saw that the version of the client was 3.2.2 while the version of the BB plugin was 3.1.1, and thought that maybe the error is due to this misalignement of versions. The thing is, my BB instance says that the version 3.1.1 is the latest one on the marketplace, which is confirmed by the version tab of the plugin. Can you please publish the latest version to the marketplace?

I tried to build locally the latest version of the plugin and install it in BB, but it does not solve the issue, i still get a 404.

Any idea why i get this error?

Thanks,

Maxime

Comments (7)

  1. Maxime Lemanissier reporter

    As i got an error 404, it was failing my jenkins pipeline, so i revert the changes i made in the jenkins pipeline to provide the Bitbucket project and repository, but after that, i still get the error 404…

    I uninstalled the version 3.2.2 built locally and reinstalled 3.1.1 from the marketplace. Now i don’t have the error anymore, but i do not have the coverage info either in BB PR.

  2. Artem Koshelev

    Sorry, i didn’t get notifications for some reason. I’ll check if marketplace needs to be updated, but in general client and server versions doesn’t have to be same.

  3. Антон Павлович

    I got a similar behavior. Bitbucket logs contains next warning:

    2021-10-21 16:38:57,609 WARN  [http-nio-7990-exec-4] admin @1N8GR66x998x541x0 1ukfrlw 172.17.0.1 "POST /rest/code-coverage/1.0/commits/2af0f664709697cc65dd2570444dc70ed4e72d32 HTTP/1.1" c.a.b.coverage.InsightReportManager Unable to create insight report for commit ID 2af0f664709697cc65dd2570444dc70ed4e72d32 as it has not been indexed
    

  4. Artem Koshelev

    Hi there, i’ve published latest version of server plugin on marketplace, could you please try if it fixes the problem for you?

    @Антон Павлович had you tried to post coverage data using project/repo endpoint instead of commit?

  5. Антон Павлович

    @Artem Koshelev I’ve updated the addon to 3.2.6. Now project/repo endpoint works. Before the update, it returned 404. Thank you for updating!

    commits endpoint returns

    {
        "errors": [
            {
                "context": null,
                "message": "Commit 2af0f664709697cc65dd2570444dc70ed4e72d32 has not been indexed.",
                "exceptionName": "com.atlassian.bitbucket.NoSuchEntityException"
            }
        ]
    }
    

  6. Log in to comment