Sage-Bionetworks / sage-monorepo

Where OpenChallenges, Schematic, and other Sage open source apps are built
https://sage-bionetworks.github.io/sage-monorepo/
Apache License 2.0
23 stars 12 forks source link

chore(sage-monorepo): test new Sonar PR workflow #2596

Closed tschaffter closed 6 months ago

tschaffter commented 6 months ago

Related to #2590

Preview

Environment reviewer-based solution

This new approach requires a user from an environment reviewer list to review and approve the workflow before it can run. A benefit is that we can have a fine-grained control over this list compared to the list of users who can add labels to a PR (every users with Write permissions).

This approach requires the reviewer to approve ALL commits, compared to the label-based system that only needs the user to add the label once. Hence, a benefit of this approach is to save compute time.

Approaching the workflows takes more clicks (4-5) than when using a label.

Step 1

The "Sonar Scan" task requires an approval because the workflow needs access to a secret SONAR_TOKEN that could potentially be extracted by an ill-intentioned user.

image

Step 2

Click on "Details" for the "Sonar Scan" task. Note the orange clock icon that indicates that the workflow is waiting on a manual review.

Step 3

Click on "Review pending deployments"

image

Step 4

Approve the Sonar deployment.

image

Requires branches to be up-to-date

At least one check must be marked as Required in the branch protection to enable this feature.

image image

The Developer has two options to update their feature branch:

sonarcloud[bot] commented 6 months ago

Quality Gate Passed Quality Gate passed for 'openchallenges-app'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud