Skip to content

Update sonar analysis workflow to new YAML file - #1101

Open
chetankh239 wants to merge 1 commit into
mosip:release-1.4.xfrom
chetankh239:sonarfix
Open

Update sonar analysis workflow to new YAML file#1101
chetankh239 wants to merge 1 commit into
mosip:release-1.4.xfrom
chetankh239:sonarfix

Conversation

@chetankh239

@chetankh239 chetankh239 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Chores
    • Updated the automated code-quality analysis workflow to use the latest analysis configuration.

Signed-off-by: Chetan Kumar Hirematha <chetankumar.h.239@gmail.com>
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The sonar_analysis job now references maven-sonar-analysis-new.yml@develop instead of maven-sonar-analysis.yml@master; its inputs and secrets are unchanged.

Changes

CI workflow configuration

Layer / File(s) Summary
Update Sonar workflow reference
.github/workflows/push-trigger.yml
The sonar_analysis reusable workflow reference changes to the new workflow on the develop branch while retaining existing inputs and secrets.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related PRs

Poem

Sonar shifts its workflow lane,
From master’s path to develop’s domain.
Inputs stay steady, secrets remain,
A tiny CI change keeps the pipeline in train.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the workflow file update and matches the main change in the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/push-trigger.yml:
- Line 75: Update the reusable workflow reference in push-trigger.yml to pin
maven-sonar-analysis-new.yml to a specific immutable commit SHA instead of the
mutable develop branch. Use the approved commit corresponding to the intended
workflow revision and leave the forwarded secret configuration unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: cfebc495-7cef-4fcf-a50a-13345ac91c9e

📥 Commits

Reviewing files that changed from the base of the PR and between 3d77f0a and 6a5dda8.

📒 Files selected for processing (1)
  • .github/workflows/push-trigger.yml

needs: build-maven-mosip-compliance-toolkit
if: "${{ github.event_name != 'pull_request' }}"
uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master
uses: mosip/kattu/.github/workflows/maven-sonar-analysis-new.yml@develop

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== workflow occurrences =="
fd -a 'push-trigger\.yml|push-trigger\.yaml' .github/workflows 2>/dev/null || true

echo "== relevant reference =="
if [ -f .github/workflows/push-trigger.yml ]; then
  nl -ba .github/workflows/push-trigger.yml | sed -n '60,90p'
  echo "== secret references in workflow =="
  rg -n '\$\{\{\s*secrets\.' .github/workflows/push-trigger.yml || true
fi

echo "== remote refs/tags for target repo/tag-ish? =="
if command -v git >/dev/null 2>&1; then
  tmp="$(mktemp -d)"
  cd "$tmp"
  git init -q
  git remote add origin https://github.com/mosip/kattu.git
  git fetch --depth=1 origin develop 2>/dev/null || true
  git ls-remote origin develop | sed -n '1,5p' || true
  git ls-remote --tags origin mosip-kattu-sonar|maven-sonar-analysis-* 2>/dev/null | sed -n '1,20p' || true
fi

Repository: mosip/mosip-compliance-toolkit

Length of output: 314


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== files =="
git ls-files .github/workflows/push-trigger.yml || true

echo "== relevant reference =="
if [ -f .github/workflows/push-trigger.yml ]; then
  awk 'NR>=60 && NR<=90 {printf "%d\t%s\n", NR, $0}' .github/workflows/push-trigger.yml
  echo "== secret references in workflow =="
  grep -n '\${{\s*secrets\.' .github/workflows/push-trigger.yml || true
fi

echo "== remote refs for target reusable workflow branch/tag candidates =="
tmp="$(mktemp -d)"
cd "$tmp"
git init -q >/dev/null 2>&1
git remote add origin https://github.com/mosip/kattu.git >/dev/null 2>&1 || true
git fetch --depth=1 origin develop >/dev/null 2>&1 || true
echo "develop:"
git ls-remote origin develop || true
git ls-remote --tags origin | grep -E '(^|[:/])mozip/kattu|(?i)sonar|maven-sonar' | sed -n '1,20p' || true
git ls-remote --tags origin maven-sonar-analysis-new.yml* develop* 2>/dev/null | sed -n '1,20p' || true

Repository: mosip/mosip-compliance-toolkit

Length of output: 2793


Pin the reusable workflow to an immutable commit SHA.

.github/workflows/push-trigger.yml:75 references mosip/kattu/.github/workflows/maven-sonar-analysis-new.yml@develop, while this reusable job forwards sensitive credentials including SONAR_TOKEN, GPG_SECRET, and SLACK_WEBHOOK_URL. Because develop is mutable, later mosip/kattu changes could execute with MOSIP repository secrets without a review of this repository, impacting GDPR/MOSIP security and supply-chain integrity.

🔒 Proposed fix
-    uses: mosip/kattu/.github/workflows/maven-sonar-analysis-new.yml@develop
+    uses: mosip/kattu/.github/workflows/maven-sonar-analysis-new.yml@af9db722acf8f74269375d71136efc2c240efa43
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
uses: mosip/kattu/.github/workflows/maven-sonar-analysis-new.yml@develop
uses: mosip/kattu/.github/workflows/maven-sonar-analysis-new.yml@af9db722acf8f74269375d71136efc2c240efa43
🧰 Tools
🪛 zizmor (1.28.0)

[error] 75-75: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/push-trigger.yml at line 75, Update the reusable workflow
reference in push-trigger.yml to pin maven-sonar-analysis-new.yml to a specific
immutable commit SHA instead of the mutable develop branch. Use the approved
commit corresponding to the intended workflow revision and leave the forwarded
secret configuration unchanged.

Source: Linters/SAST tools

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.

1 participant