SonarCloud Integration with .Net core project

Dinesh Prajapati's Avatar

Dinesh Prajapati

27 Sep, 2024 05:15 PM

Hi Team,

I am working on integrating sonarcloud scan to trigger with every PR request raise. I am checking on the documentation but could you please let me know how I can integrate this in appveyor.yaml file.

  1. Support Staff 1 Posted by Owen McDonnell on 27 Sep, 2024 09:11 PM

    Owen McDonnell's Avatar

    I'm not sure if you're asking how to install sonarscanner from the command line or how to only do so on PR events.
    Regarding the latter question you can use "tweak variables" to determine if the build is triggered by a PR (i.e. check if APPVEYOR_PULL_REQUEST_NUMBER variable exists), and if so download and run sonarscanner.
    Does that help?

  2. 2 Posted by Dinesh Prajapat... on 28 Sep, 2024 11:35 AM

    Dinesh Prajapati's Avatar

    Restricted

    Hi Owen,

    It did not help the way it is needed. I want it to be set as another build in the bitbucket repository and only if both the builds passed successfully then only it should be allowed to merge into master.

    Below is the screenshot for snyk integration, in the same fashion I want to replace snyk with sonarcloud scan.

    [cid:[email blocked]]

    Regards,
    Dinesh Prajapati

    From: Owen McDonnell <[email blocked]>
    Sent: 27 September 2024 22:11
    To: Dinesh Prajapati <[email blocked]>
    Subject: Re: SonarCloud Integration with .Net core project [Problems #37201]

    CAUTION: This message originates from outside our organisation and may contain suspicious content. Please take care when clicking links or opening attachments, especially from unknown senders! If in doubt, please contact [email blocked]<mailto:[email blocked]>.

  3. 3 Posted by Dinesh Prajapat... on 28 Sep, 2024 05:29 PM

    Dinesh Prajapati's Avatar

    Restricted

    Also Owen I have the sonarcloud.sh setup script at my root level. I just want the script to be called whenever a PR is raised in bitbucket and only if the main build (code one) and then the sonarcloud scan is successful, PR should be allowed to merge.

    From: Dinesh Prajapati <[email blocked]>
    Sent: 28 September 2024 12:36
    To: Owen McDonnell <[email blocked]>
    Subject: RE: SonarCloud Integration with .Net core project [Problems #37201]

    Hi Owen,

    It did not help the way it is needed. I want it to be set as another build in the bitbucket repository and only if both the builds passed successfully then only it should be allowed to merge into master.

    Below is the screenshot for snyk integration, in the same fashion I want to replace snyk with sonarcloud scan.

    [cid:[email blocked]]

    Regards,
    Dinesh Prajapati

    From: Owen McDonnell <[email blocked]<mailto:[email blocked]>>
    Sent: 27 September 2024 22:11
    To: Dinesh Prajapati <[email blocked]<mailto:[email blocked]>>
    Subject: Re: SonarCloud Integration with .Net core project [Problems #37201]

    CAUTION: This message originates from outside our organisation and may contain suspicious content. Please take care when clicking links or opening attachments, especially from unknown senders! If in doubt, please contact [email blocked]<mailto:[email blocked]>.

  4. Support Staff 4 Posted by Owen McDonnell on 01 Oct, 2024 05:06 PM

    Owen McDonnell's Avatar

    I'm not 100% clear on the intention here, but before trying to clarify can you make sure to read the section of the docs on build matrix. It sounds like you need to employ some feature/dimension of that to achieve what you want

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

 

26 Sep, 2024 03:49 PM
26 Sep, 2024 09:02 AM
25 Sep, 2024 07:07 PM
24 Sep, 2024 08:39 PM
24 Sep, 2024 06:47 AM
20 Sep, 2024 05:50 PM