Skip to content

CLI-1555 Generate GitHub onboarding workflows and PR content - #1310

Merged
zglicz merged 4 commits into
codex/CLI-1554-github-bindingsfrom
codex/CLI-1555-github-workflows
Nov 26, 2026
Merged

zglicz merged 4 commits into
codex/CLI-1554-github-bindingsfrom
codex/CLI-1555-github-workflows

Conversation

@zglicz

@zglicz zglicz commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Generates .github/workflows/sonarqube.yml and onboarding PR descriptions with guidance for reviewing credentials, runners and analysis results (CLI-1555).

  • Use the official scan action, the connected Server URL, an existing analysis secret, and PR/default-branch triggers.
  • Support complete workflow templates, replacing only {{SONAR_PROJECT_KEY}}; validate YAML and conflicting options.
  • Keep the default workflow in YAML, with SHA-pinned actions maintained by Renovate’s GitHub Actions manager.
  • Reject expressions in scanner properties and escape default-branch filter patterns.

Validation: template unit tests, GitHub onboarding integration tests, typecheck and CLI build pass. Verified standalone YAML bundling and Renovate action extraction and SHA/version updates.

Stacked on #1296.

@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

CLI-1555

@netlify

netlify Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for sonarqube-cli ready!

Name Link
🔨 Latest commit 2b07b03
🔍 Latest deploy log https://app.netlify.com/projects/sonarqube-cli/deploys/6b06f85e2e48a755c7099211
😎 Deploy Preview https://deploy-preview-1310--sonarqube-cli.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@zglicz
zglicz force-pushed the codex/CLI-1555-github-workflows branch from a622648 to aeda86d Compare November 18, 2026 15:44
@zglicz
zglicz marked this pull request as ready for review November 19, 2026 09:19
@zglicz
zglicz requested review from a team as code owners November 19, 2026 09:19
@zglicz
zglicz requested review from a team and vnaskos-sonar November 19, 2026 09:19
@zglicz
zglicz force-pushed the codex/CLI-1555-github-workflows branch from aeda86d to 15b914d Compare November 19, 2026 14:53
@zglicz
zglicz requested a review from a team as a code owner November 23, 2026 10:13
@datadog-sonarsource

datadog-sonarsource Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Pipelines

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 2b07b03 | Docs | Give us feedback!

@nquinquenel
nquinquenel requested review from tsiaraskon-sonar and removed request for vnaskos-sonar November 23, 2026 13:56
@zglicz
zglicz requested review from sophio-japharidze-sonarsource and removed request for tsiaraskon-sonar November 24, 2026 09:44
@zglicz
zglicz force-pushed the codex/CLI-1555-github-workflows branch from b6570b2 to 3915c40 Compare November 24, 2026 13:37
@zglicz
zglicz force-pushed the codex/CLI-1555-github-workflows branch from 4c2fdc8 to 2b07b03 Compare November 25, 2026 15:01
@sonarqubecloud

sonarqubecloud Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

@gitar-bot

gitar-bot Bot commented Nov 25, 2026

Copy link
Copy Markdown

Reviewing your code

Code Review ✅ Approved 🔴 High risk 1 closed / 1 findings

Generating PR-triggered workflows that pass SONAR_TOKEN to the scan action could expose the analysis credential through PR-controlled workflow changes.

Generates .github/workflows/sonarqube.yml and onboarding PR descriptions, using the official scan action with SHA-pinned actions, the connected Server URL, and PR/default-branch triggers. Template validation now rejects mappings that aren't workflows, addressing that finding.

✅ 1 closed
✅ Edge Case: Template validation accepts mappings that aren't workflows

📄 src/commands/admin/onboard-ci/github/templates.ts:65-79 📄 tests/unit/commands/admin/onboard-ci/github/templates.test.ts:149-158
validateWorkflowTemplate only checks two things: the raw text contains {{SONAR_PROJECT_KEY}}, and it parses as a single YAML mapping. Some templates pass both checks but are not GitHub workflows, for example name: {{SONAR_PROJECT_KEY}}, or jobs: {} followed by # {{SONAR_PROJECT_KEY}} (a placeholder inside a comment still satisfies includes). The command would then open onboarding PRs in every repository with a .github/workflows/sonarqube.yml that has no on/jobs, which GitHub rejects as an invalid workflow. This contradicts the PR's claim that it validates complete workflow templates.

The test rejects incomplete or invalid templates doesn't cover this. Its 'jobs: {}' case fails only because the placeholder is missing, not because the template is incomplete. Fix: after parsing, require top-level on and a non-empty jobs mapping, and add a test with the placeholder present but on or jobs missing.

Verification Rules 3/3 met

Functional validation No results

Rules 3 passed 2 not applicable

✅ Internal artifact registries
✅ Release secrets usage
✅ Repository license compliance

Auto-approval Re-evaluating

For more verification details, comment gitar display:verbose.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@zglicz
zglicz merged commit 3e35011 into master Nov 26, 2026
28 checks passed
@zglicz
zglicz deleted the codex/CLI-1555-github-workflows branch November 26, 2026 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants