Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -400,3 +400,34 @@
- uses: SonarSource/ci-github-actions/promote@v1
with:
promote-pull-request: true

trigger-a3s-integration:
name: Trigger A3S Integration Tests
needs:
- promote
- build
if: ${{ needs.build.outputs.deployed }} #TODO: uncomment: #&& github.ref == 'refs/heads/master' }}

Check warning on line 409 in .github/workflows/build.yml

View check run for this annotation

SonarQube-Next / SonarQube Code Analysis

Complete the task associated to this "TODO" comment.

[S1135] Track uses of "TODO" tags See more on https://next.sonarqube.com/sonarqube/project/issues?id=org.sonarsource.java%3Ajava&pullRequest=5574&issues=37226671-e752-4359-b174-1890ea4804b4&open=37226671-e752-4359-b174-1890ea4804b4
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The && github.ref == 'refs/heads/master' guard is commented out, so this job triggers on every promoted build — including PRs. Based on how the deployed output is used throughout this file, it can be true for PR builds, meaning every PR that reaches the promote stage will fire a workflow dispatch into sonar-analysis-as-a-service. That burns downstream tokens and runner quota, and creates noise/flakiness in that repo. If testing cross-repo triggering on PR builds is intentional and temporary, that should be made explicit — otherwise, uncomment the guard now.

Suggested change
if: ${{ needs.build.outputs.deployed }} #TODO: uncomment: #&& github.ref == 'refs/heads/master' }}
if: ${{ needs.build.outputs.deployed && github.ref == 'refs/heads/master' }}
  • Mark as noise

runs-on: sonar-xs-public
permissions:
id-token: write
steps:
- id: secrets
uses: SonarSource/vault-action-wrapper@320bd31b03e5dacaac6be51bbbb15adf7caccc32 # v3.1.0
with:
secrets: |
development/github/token/{REPO_OWNER_NAME_DASH}-workflow-dispatch token | GITHUB_TOKEN;
- name: Trigger integration tests in sonar-analysis-as-a-service
uses: actions/github-script@v7
with:
github-token: ${{ fromJSON(steps.secrets.outputs.vault).GITHUB_TOKEN }}
#TODO: ref should be master

Check warning on line 423 in .github/workflows/build.yml

View check run for this annotation

SonarQube-Next / SonarQube Code Analysis

Complete the task associated to this "TODO" comment.

[S1135] Track uses of "TODO" tags See more on https://next.sonarqube.com/sonarqube/project/issues?id=org.sonarsource.java%3Ajava&pullRequest=5574&issues=5f363e7a-1efb-45b1-a128-5acc2713cdc3&open=5f363e7a-1efb-45b1-a128-5acc2713cdc3
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'SonarSource',
repo: 'sonar-analysis-as-a-service',
workflow_id: 'update-sonar-java-and-test.yml',
ref: 'lp/add-sonar-java-integration-testing',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dispatch targets the feature branch lp/add-sonar-java-integration-testing in sonar-analysis-as-a-service. If that branch is deleted or force-pushed before this TODO is resolved, every triggered run will fail with a 422 from the GitHub API — actions/github-script surfaces unhandled exceptions as job failures, which could block the pipeline. This needs to be switched to master (or a durable ref) before merging.

Suggested change
ref: 'lp/add-sonar-java-integration-testing',
ref: 'master',
  • Mark as noise

inputs: {
sonar_java_build_number: '${{ needs.build.outputs.build-number }}'
}
});
Loading