Git Product home page Git Product logo

Comments (5)

tisoft avatar tisoft commented on September 28, 2024

Added PR #70 for adding the link to SonarQube into the PR comments.

from sonarqube-community-branch-plugin.

kortov avatar kortov commented on September 28, 2024

Hi I'd like to ask a question. The link the issue about is the dashboard url? Because I'd like to notice that sonar dumps https://github.com/SonarSource/sonarqube/blob/f61e29bce771e56f8d45ad07a235c0399a1a9772/sonar-scanner-engine/src/main/java/org/sonar/scanner/report/ReportPublisher.java#L230 dashboardUrl to report-task.txt file. There is a similar plugin which works with this file and I opened a PR about this dashboardUrl gabrie-allaigre/sonar-gitlab-plugin#268
maybe it would be interesting for you. But I don't see that this plugin used report-task.txt before

from sonarqube-community-branch-plugin.

tisoft avatar tisoft commented on September 28, 2024

The summary comment links to the dashboard, the issue comments link to the issue in the file.

from sonarqube-community-branch-plugin.

mc1arke avatar mc1arke commented on September 28, 2024

For the link from Sonarqube to the PR, this functionality is currently provided by Sonarqube core if we set the url property on the BranchDto, which we don't currently do. This should be do-able in PullRequestPostAnalysisTask by having the constructor take a DbClient instance, getting the PullRequestBuildStatusDecorator to generate the PR URL (I've not yet decided if it's best to do this as a return value on the decorateQualityGateStatus call, or as another method), and then using something similar to

        try (DbSession dbSession = dbClient.openSession(false)) {
            BranchDao branchDao = dbClient.branchDao();
            Optional<BranchDto> optionalBranchDto = branchDao.selectByPullRequestKey(dbSession, projectAnalysis.getProject().getUuid(), projectAnalysis.getScannerContext().getProperties().get("sonar.pullrequest.key"));
            if (optionalBranchDto.isPresent()) {
                BranchDto branchDto = optionalBranchDto.get();
                DbProjectBranches.PullRequestData.Builder pullRequestDataBuilder = DbProjectBranches.PullRequestData.newBuilder(branchDto.getPullRequestData());
                pullRequestDataBuilder.setUrl(url);
                branchDto.setPullRequestData(pullRequestDataBuilder.build());
                branchDao.upsert(dbSession, branchDto);
            }
        }

I'll try this out when I get time and get a PR raised.

from sonarqube-community-branch-plugin.

mc1arke avatar mc1arke commented on September 28, 2024

Release in version 1.3.1

from sonarqube-community-branch-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.