Skip to content

Handle a special case with a single artefact download#1546

Merged
luhmirin-s merged 1 commit into
mainfrom
hotfix/single-test-group-sonar-fix
Jan 20, 2026
Merged

Handle a special case with a single artefact download#1546
luhmirin-s merged 1 commit into
mainfrom
hotfix/single-test-group-sonar-fix

Conversation

@luhmirin-s
Copy link
Copy Markdown
Contributor

Will be released in: 2026.1.0

Root cause analysis (for bugfixes only)

  • Downloaded artefacts are usually unpacked into separate folders. But if there is a single test artefact (i.e. there were changes in a single module group) downloading of said artefact automatically unpacks it into the destination folder. So in the "move" step those test reports cannot be found unless there are multiple test artefacts.

Notable changes

  • Changed the test report collection step to first look into the subfolders and copy them if present. And if there were no subfolders, just copy everything from the root folder.

Testing guidance

  • Run a workflow with changes to a single module. Sonar report should be correct.

Additional work checklist

  • Effect on other features and security has been considered
  • Design document marked as "In development" (if applicable)
  • External (Gitbook) and internal (Confluence) Documentation is up to date (or ticket created)
  • Test cases in Testiny are up to date (or ticket created)
  • Other teams notified about the changes (if applicable)

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses a special case in the GitHub Actions workflow where downloading a single test artifact behaves differently than downloading multiple artifacts. When a single artifact is downloaded, it's automatically unpacked into the destination folder rather than into a subfolder, causing the subsequent report collection step to fail.

Changes:

  • Replaced hardcoded module-specific rsync commands with a dynamic loop-based approach
  • Added fallback logic to handle the single artifact case by copying from test-reports root when no subfolders exist
  • Enhanced error handling with bash strict mode and nullglob option

ALL_SKIPPED=false

# Copy the contents of each artifact folder into the workspace root
rsync -arv "${ARTIFACT_DIR}" . || true
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The rsync command is copying the artifact directory itself rather than its contents. This will create subdirectories in the workspace root (e.g., 'core/', 'infra1/') instead of copying the contents directly to the root as intended. To copy only the contents, append a trailing slash to the source path.

Suggested change
rsync -arv "${ARTIFACT_DIR}" . || true
rsync -arv "${ARTIFACT_DIR}/" . || true

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is intended behaviour.

Comment thread .github/workflows/reusable-sonar-scan.yml
@luhmirin-s luhmirin-s force-pushed the hotfix/single-test-group-sonar-fix branch from f31b3eb to b818f21 Compare January 20, 2026 10:29
@sonarqubecloud
Copy link
Copy Markdown

@luhmirin-s luhmirin-s merged commit 9736d65 into main Jan 20, 2026
14 checks passed
@luhmirin-s luhmirin-s deleted the hotfix/single-test-group-sonar-fix branch January 20, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants