Skip to content

docs(csharp): fix stale comment on codeql/csharp-queries dependency - #211

Merged
felickz merged 1 commit into
mainfrom
felickz-csharp-remove-unused-queries-dep
Aug 3, 2026
Merged

docs(csharp): fix stale comment on codeql/csharp-queries dependency#211
felickz merged 1 commit into
mainfrom
felickz-csharp-remove-unused-queries-dep

Conversation

@felickz

@felickz felickz commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

What

Fixes an inaccurate inline comment on the codeql/csharp-queries dependency in csharp/src/qlpack.yml.

Why

The comment said this dependency was # Required for Dependencies.ql. That was true when it was added in 2023, but stopped being true in commit 8913c63 ("Fix various compilation issues", Jan 2025), which switched csharp/src/audit/explore/Dependencies.ql's import from Telemetry.ExternalApi (a module that only lives in the codeql/csharp-queries pack) to semmle.code.csharp.telemetry.ExternalApi (which ships inside codeql/csharp-all). Nobody updated the comment (or checked whether the dependency itself could be dropped) at the time.

Investigation

I initially assumed the dependency itself was now unused and could be removed (matching go/java/python/javascript/ruby, none of which depend on their -queries pack). That's wrong: suites/csharp-audit.qls and suites/csharp-external-api.qls both explicitly pull the upstream cs/untrusted-data-to-external-api query from: codeql/csharp-queries — that query only exists in the queries pack, not -all. Both suites are actively used (configs/audit.yml, configs/synthetics.yml), so the dependency must stay. This mirrors cpp's codeql/cpp-queries dependency, which pulls cpp/untrusted-data-to-external-api the same way (and cpp's Dependencies.ql still genuinely needs Metrics.Dependencies.ExternalDependencies, which is queries-pack-only upstream).

Change

Only the comment changes, to correctly explain why the dependency is kept:

-  codeql/csharp-queries: "1.8.0" # Required for Dependencies.ql
+  codeql/csharp-queries: "1.8.0" # Required by suites/csharp-audit.qls and suites/csharp-external-api.qls for upstream cs/untrusted-data-to-external-api

No dependency versions, lock files, or query logic changed. Verified csharp/src/audit/explore/Dependencies.ql still compiles.

Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com
Copilot-Session: e78d3f00-2ea0-459b-86a2-91adc0e31c50

The comment claimed this dependency was 'Required for Dependencies.ql',
but that stopped being true in commit 8913c63 (Jan 2025), which switched
Dependencies.ql's import from the queries-pack-only 'Telemetry.ExternalApi'
to 'semmle.code.csharp.telemetry.ExternalApi', which ships in codeql/csharp-all.

The dependency is still required, but for a different reason:
suites/csharp-audit.qls and suites/csharp-external-api.qls both pull the
upstream cs/untrusted-data-to-external-api query 'from: codeql/csharp-queries',
which only lives in the queries pack, not csharp-all.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e78d3f00-2ea0-459b-86a2-91adc0e31c50
Copilot AI review requested due to automatic review settings August 3, 2026 21:11
@felickz
felickz merged commit da57fe2 into main Aug 3, 2026
21 checks passed
@felickz
felickz deleted the felickz-csharp-remove-unused-queries-dep branch August 3, 2026 21:11

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.

Pull request overview

This PR updates an inline comment in the C# query pack’s qlpack.yml to correctly explain why the codeql/csharp-queries dependency is still required (it is referenced by shipped suite files, not by audit/explore/Dependencies.ql anymore).

Changes:

  • Corrected the codeql/csharp-queries dependency comment to point to suites/csharp-audit.qls and suites/csharp-external-api.qls as the reason the dependency must remain.
  • No version, lockfile, or query logic changes.
Show a summary per file
File Description
csharp/src/qlpack.yml Updates the dependency comment to reflect the actual suite-level dependency on codeql/csharp-queries.

Review details

  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

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.

2 participants