fix(ci): build zredis modules for CodeQL - #11
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR replaces the existing CodeQL workflow’s autobuild-based setup with an explicit matrix that runs actions analysis with build-mode: none and c-cpp analysis with build-mode: manual, including a deterministic build of the zredis modules and a structural “contract” test to prevent workflow drift.
Changes:
- Replace CodeQL autobuild with an explicit
actions/none+c-cpp/manualmatrix and manual module build checks. - Add a
workflow_dispatchinput to control whether analysis uploads results, and pin actions to immutable SHAs. - Add a Zsh-based workflow contract test that validates the expected workflow structure via
yq.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/workflows/codeql-analysis.yml | Switches to an explicit CodeQL matrix and performs a manual C/C++ build + feature/module-output checks before analysis. |
| .github/tests/codeql-workflow.zsh | Adds a structural contract test that asserts the workflow’s matrix, permissions, pins, and analysis/upload behavior. |
Comments suppressed due to low confidence (2)
.github/workflows/codeql-analysis.yml:94
workflow_dispatchboolean inputs are exposed as strings in expressions; comparinginputs.upload-resultsto the boolean literaltruecan prevent uploads when the checkbox is selected because the value is typically the string "true".
- name: Analyze and upload
if: github.event_name == 'push' || github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.upload-results == true)
uses: github/codeql-action/analyze@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3
.github/tests/codeql-workflow.zsh:142
- This contract test asserts the workflow uses
inputs.upload-results == true, butworkflow_dispatchboolean inputs are represented as strings ("true"/"false") in expressions. The contract should match the corrected string comparison so uploads occur when the checkbox is selected.
.uses ==
"github/codeql-action/analyze@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81" and
.if ==
"github.event_name == '\''push'\'' || github.event_name == '\''schedule'\'' || (github.event_name == '\''workflow_dispatch'\'' && inputs.upload-results == true)" and
.with.category == "/language:${{ matrix.language }}" and
(.with | has("upload") | not))] |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Sal <59910950+ss-o@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Sal <59910950+ss-o@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root cause
Default C/C++ setup reached the bundled module configure step, but generated autobuild could not complete the headless build and did not detect GDBM. The existing advanced workflow also used autobuild, mutable action tags, and incomplete build dependencies.
Safety and migration
upload: neverwhile default setup remains activeValidation
zsh -nand compiled Zsh test syntaxRelates to #10.