Skip to content

Run CodeQL across repository Go modules - #2579

Open
George Adams (gdams) with Copilot wants to merge 4 commits into
microsoft/mainfrom
copilot/run-codeql-on-all-go-code
Open

George Adams (gdams) with Copilot wants to merge 4 commits into
microsoft/mainfrom
copilot/run-codeql-on-all-go-code

Conversation

Copilot AI commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

CodeQL only analyzed eng/_util, leaving production code such as cryptobackend unscanned. Expand analysis to all repository Go modules while excluding the upstream go submodule.

  • CodeQL build coverage
    • Replace the eng/_util-only autobuild with module discovery via go.mod.
    • Build each discovered module with go build ./....
    • Exclude paths under ./go/*.
find . -name go.mod -not -path './go/*' -print0

Co-authored-by: gdams <20224954+gdams@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

@gdams
George Adams (gdams) marked this pull request as ready for review October 15, 2026 14:12
@gdams
George Adams (gdams) requested a review from a team as a code owner October 15, 2026 14:12
Copilot AI balanced review requested due to automatic review settings October 15, 2026 14:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The default build excludes the production Linux crypto backend implementations from analysis.

1 open finding
What changed in this PR

Expands CodeQL analysis beyond eng/_util to Go modules throughout the repository.

Changes:

  • Replaces autobuild with module discovery and explicit go build ./... calls.
  • Excludes the upstream go submodule.
File Description
.github/​workflows/​codeql.yml Builds discovered repository Go modules for CodeQL analysis.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/codeql.yml Outdated
Co-authored-by: gdams <20224954+gdams@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The workflow addresses the module and backend coverage gaps with no unresolved findings.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

Comment thread .github/workflows/codeql.yml Outdated
@dagood

Copy link
Copy Markdown
Member

This PR touches the GitHub side CodeQL. What about AzDO side?

@gdams

Copy link
Copy Markdown
Member

This PR touches the GitHub side CodeQL. What about AzDO side?

is there a requirement which says we need to run CodeQL on both sides?

@dagood

Davis Goodin (dagood) commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Requirements don't typically take into account the mirroring process, so I doubt it's cut and dry what they say. Practically it's about s360 alerts I suppose. If we don't need to run both sides, we should remove the other side, which we currently have not.

@gdams

Copy link
Copy Markdown
Member

I was able to significantly simply this by essentially stripping the go submodule from the working directory and running the default CodeQL autobuild.

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.

5 participants