Skip to content

Revert "Merge main into releases/v4"#3761

Open
oscarsj wants to merge 1 commit intoreleases/v4from
revert-3588-update-v4.34.0-30c555a52
Open

Revert "Merge main into releases/v4"#3761
oscarsj wants to merge 1 commit intoreleases/v4from
revert-3588-update-v4.34.0-30c555a52

Conversation

@oscarsj
Copy link
Member

@oscarsj oscarsj commented Mar 20, 2026

@oscarsj oscarsj requested a review from a team as a code owner March 20, 2026 16:20
Copilot AI review requested due to automatic review settings March 20, 2026 16:20
@github-actions github-actions bot added the size/XL May be very hard to review label Mar 20, 2026
Copy link
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

Reverts the changes introduced by Merge main into releases/v4 (reverting PR #3588), restoring prior release/version metadata and adjusting related runtime behavior around diff-informed analysis and TRAP caching.

Changes:

  • Revert release metadata/versioning (package version, changelog entry, default CLI/bundle versions, and some devDependency lock state).
  • Rework diff-informed analysis paths to use absolute, normalized paths (and adjust alert filtering accordingly).
  • Move/reshape TRAP caching enablement logic into init-action and thread a trapCachingEnabled boolean into config initialization.

Reviewed changes

Copilot reviewed 22 out of 35 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/upload-lib.ts Makes diff-range alert filtering use an absolute, normalized path derived from checkout_path; makes helper non-exported.
src/upload-lib.test.ts Removes unit test coverage for diff-range alert filtering.
src/testing-utils.ts Updates default Actions env var set used by tests (removes RUNNER_NAME).
src/testdata/valid-sarif-diff-filtered.sarif Removes SARIF fixture used for diff-range filtering tests.
src/testdata/pr-diff-range.yml Removes YAML fixture used for diff-range extension pack tests.
src/overlay/index.ts Removes C++ overlay minimum version constant export.
src/init-action.ts Adds TRAP caching toggling logic and passes trapCachingEnabled into config initialization.
src/feature-flags.ts Removes C++ overlay feature flags and reorders/adds overlay status flags (with a small comment typo).
src/diff-informed-analysis-utils.ts Produces absolute diff range paths using checkout_path and normalizes separators.
src/diff-informed-analysis-utils.test.ts Updates tests to expect absolute diff range paths and stubs checkout_path.
src/defaults.json Reverts default CodeQL bundle/CLI versions.
src/config-utils.ts Adds trapCachingEnabled to init inputs and gates trap-cache download on it; removes older trap caching helper logic.
src/config-utils.test.ts Updates init input helper and removes trap-caching enablement tests; changes overlay enablement test language.
src/codeql.ts Adds CLI-version gating for database cleanup flag (--cache-cleanup vs --mode).
src/analyze.ts Adjusts diff-range extension pack creation to write absolute paths directly; inlines YAML generation.
src/analyze.test.ts Removes unit test for diff-range extension pack YAML generation.
package.json Reverts package version and some devDependency versions.
package-lock.json Reverts lockfile versions to match package.json dependency set.
lib/upload-lib.js Generated output updated (not reviewed).
lib/defaults.json Generated output updated (not reviewed).
CHANGELOG.md Removes the 4.34.0 entry (reverting release notes).
.github/workflows/update-release-branch.yml Downgrades actions/create-github-app-token version.
.github/workflows/rollback-release.yml Downgrades actions/create-github-app-token version.
.github/workflows/post-release-mergeback.yml Downgrades actions/create-github-app-token version.
Comments suppressed due to low confidence (1)

src/upload-lib.test.ts:1015

  • The diff-range alert filtering test coverage was removed (helper + test) without an equivalent replacement. Since filterAlertsByDiffRange behavior changed (absolute paths + Windows separator normalization), it would be good to add a new test that writes a pr-diff-range.json file and verifies post-processing filters results as expected (including path normalization).

Comment on lines 1055 to +1075
@@ -1066,14 +1068,19 @@ export function filterAlertsByDiffRange(
if (!locationUri || locationStartLine === undefined) {
return false;
}
// CodeQL always uses forward slashes as the path separator, so on Windows we
// need to replace any backslashes with forward slashes.
const locationPath = path
.join(checkoutPath, locationUri)
.replaceAll(path.sep, "/");
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

filterAlertsByDiffRange reads checkout_path via actionsUtil.getRequiredInput, even though postProcessSarifFiles already receives checkoutPath as a parameter. This creates a hidden Actions-input dependency (harder to unit test / reuse) and risks mismatches if callers pass a different checkoutPath than the input. Consider passing checkoutPath into filterAlertsByDiffRange (or using the existing checkoutPath parameter) instead of re-reading the input here.

Copilot uses AI. Check for mistakes.
Comment on lines 10 to 14
defaultSuites,
resolveQuerySuiteAlias,
addSarifExtension,
diffRangeExtensionPackContents,
} from "./analyze";
import { createStubCodeQL } from "./codeql";
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

The test for diff range extension pack YAML generation was removed. Given the extension pack format is easy to regress (quoting/escaping, empty ranges behavior, absolute paths), consider adding a replacement test that asserts writeDiffRangeDataExtensionPack (or setupDiffInformedQueryRun) writes the expected pr-diff-range.yml contents for representative ranges.

Copilot uses AI. Check for mistakes.
OverlayAnalysisGo = "overlay_analysis_go",
/** Controls whether the Actions cache is checked for overlay build outcomes. */
OverlayAnalysisStatusCheck = "overlay_analysis_status_check",
/** Controls whether overlay build failures on are stored in the Actions cache. */
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

Typo/grammar in the new comment: "overlay build failures on are stored" reads incorrectly. Suggest rewording to something like "Controls whether overlay build failures are stored in the Actions cache."

Suggested change
/** Controls whether overlay build failures on are stored in the Actions cache. */
/** Controls whether overlay build failures are stored in the Actions cache. */

Copilot uses AI. Check for mistakes.
Comment on lines +616 to +631
if (config.languages.includes(KnownLanguage.cpp)) {
const envVar = "CODEQL_EXTRACTOR_CPP_TRAP_CACHING";
if (process.env[envVar]) {
logger.info(
`Environment variable ${envVar} already set. Not en/disabling CodeQL C++ TRAP caching support`,
);
} else if (
getTrapCachingEnabled() &&
(await codeQlVersionAtLeast(codeql, "2.17.5"))
) {
logger.info("Enabling CodeQL C++ TRAP caching support");
core.exportVariable(envVar, "true");
} else {
logger.info("Disabling CodeQL C++ TRAP caching support");
core.exportVariable(envVar, "false");
}
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

getTrapCachingEnabled() is computed twice (once to populate trapCachingEnabled for config initialization and again when setting CODEQL_EXTRACTOR_CPP_TRAP_CACHING). To avoid divergence and make the flow easier to follow/test, consider computing it once (e.g., const trapCachingEnabled = getTrapCachingEnabled();) and reusing the same value in both places.

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

size/XL May be very hard to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants