Skip to content

Remove unused variable in changeset test (CodeQL alert #496)#22772

Merged
pelikhan merged 4 commits into
mainfrom
copilot/fix-code-scanning-alerts-496
Mar 24, 2026
Merged

Remove unused variable in changeset test (CodeQL alert #496)#22772
pelikhan merged 4 commits into
mainfrom
copilot/fix-code-scanning-alerts-496

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 24, 2026

CodeQL flagged an unused local variable changesetModule in scripts/changeset.test.js — a require() result assigned but never referenced, left over from an unfinished test stub.

Changes

  • scripts/changeset.test.js: Remove the dead assignment const changesetModule = require(CHANGESET_SCRIPT) and its stale comments describing the unimplemented test approach; retain the single comment describing the manual testing intent.

⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

Copilot AI and others added 2 commits March 24, 2026 21:53
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/605f9b59-7462-4bed-b499-00caa842f1e2
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/605f9b59-7462-4bed-b499-00caa842f1e2
Copilot AI changed the title [WIP] Fix code scanning alert 496 Remove unused variable in changeset test (CodeQL alert #496) Mar 24, 2026
Copilot AI requested a review from pelikhan March 24, 2026 21:58
@pelikhan pelikhan marked this pull request as ready for review March 24, 2026 22:00
Copilot AI review requested due to automatic review settings March 24, 2026 22:00
@pelikhan pelikhan merged commit 9179b4d into main Mar 24, 2026
@pelikhan pelikhan deleted the copilot/fix-code-scanning-alerts-496 branch March 24, 2026 22:00
Copy link
Copy Markdown
Contributor

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

Removes a CodeQL-reported unused local variable from the changeset script test harness to eliminate dead code and stale commentary.

Changes:

  • Removed an unused require() assignment (changesetModule) that was never referenced.
  • Deleted outdated comments describing an unimplemented test approach, keeping the manual-testing note.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/changeset.test.js
Comment on lines 182 to 185
// Test 6: No changesets with explicit release type (simulate updateChangelog)
console.log("\n=== Test 6: CHANGELOG entry for release without changesets ===");
// We'll test the updateChangelog function directly by requiring the module
const changesetModule = require(CHANGESET_SCRIPT);
// Since we can't easily access internal functions, we'll just verify the version command works
// The actual changelog update behavior will be tested manually

Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

The "Test 6" block no longer performs any checks (it only logs a header and then proceeds to results). Consider either removing the Test 6 header entirely, or adding a small automated assertion that exercises the intended behavior, and keep the manual-testing note as a fallback.

See below for a potential fix:


Copilot uses AI. Check for mistakes.
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