Skip to content

CodeQl: Support repos with no packages.#525

Merged
apop5 merged 1 commit intomicrosoft:mainfrom
apop5:personal/apop5/supportdepreciatedrepos
Feb 25, 2026
Merged

CodeQl: Support repos with no packages.#525
apop5 merged 1 commit intomicrosoft:mainfrom
apop5:personal/apop5/supportdepreciatedrepos

Conversation

@apop5
Copy link
Contributor

@apop5 apop5 commented Feb 24, 2026

The codeql workflow will attempting to locate Packages by finding folders ending with pkg and then attempting to find a .dsc located within that folder.

For repos without any valid pkgs, the codeql workflow will generate an empty matrix. Adding a package_count variable to differentiate this scenario and gate creating and empty matrix.

Most repos list the codeql Analyze task as a required check. With an empty matrix, this would fail. Skipping the Analyze task would result in a pending check that will never execute.

Modify the codeql to create an empty sarif file when the package_count is zero and upload this. This will allow the Analyze step to run and pass CI when a repo contains no valid packages that can have results uploaded.

This is being handled in this manor to allow the same CI checks to exist for repos which still contain a valid release/202502 branch, and a release/202511 branch which deprecates the repo.

The codeql workflow will attempting to locate Packages by finding folders ending with pkg
and then attempting to find a .dsc located within that folder.

For repos without any valid pkgs, the codeql workflow will generate an empty matrix.
Adding a package_count variable to differentiate this scenario and gate creating and
empty matrix.

Most repos list the codeql Analyze task as a required check. With an empty matrix,
this would fail. Skipping the Analyze task would result in a pending check that will never execute.

Modify the codeql to create an empty sarif file when the package_count is zero and upload this.
This will allow the Analyze step to run and pass CI when a repo contains no valid packages
that can have results uploaded.

This is being handled in this manor to allow the same CI checks to exist for repos which
still contain a valid release/202502 branch, and a release/202511 branch which
deprecates the repo.
@apop5 apop5 requested a review from makubacki February 24, 2026 20:43
@apop5
Copy link
Contributor Author

apop5 commented Feb 24, 2026

Code has been verified here:

microsoft/mu_silicon_intel_tiano#342

@apop5 apop5 requested review from Javagedes and os-d February 24, 2026 20:44
@apop5 apop5 merged commit 9e9450f into microsoft:main Feb 25, 2026
2 checks passed
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.

3 participants