Skip to content

Conversation

@TravisEz13
Copy link
Member

Backport of #26322 to release/v7.6

Triggered by @TravisEz13 on behalf of @copilot-swe-agent

Original CL Label: CL-Tools

/cc @PowerShell/powershell-maintainers

Impact

REQUIRED: Choose either Tooling Impact or Customer Impact (or both). At least one checkbox must be selected.

Tooling Impact

  • Required tooling change
  • Optional tooling change (include reasoning)

This is a CI/CD infrastructure change that refactors the CodeQL analysis job into a reusable workflow pattern and enables it on Windows CI. While the analyze job is currently disabled in v7.6, this backport ensures the infrastructure is ready when CodeQL analysis is re-enabled. It also adds Windows security scanning capability.

Customer Impact

  • Customer reported
  • Found internally

Regression

REQUIRED: Check exactly one box.

  • Yes
  • No

This is not a regression.

Testing

Verified by cherry-picking to release/v7.6 branch. The new reusable workflow follows the same pattern as the original inline analyze job. Changes to tools/ci.psm1 add a Configuration parameter with default 'Release' to maintain backward compatibility. The backport includes the complete refactoring: creation of analyze-reusable.yml, refactoring of linux-ci.yml to use the reusable workflow, and addition of analyze job to windows-ci.yml.

Risk

REQUIRED: Check exactly one box.

  • High
  • Medium
  • Low

Medium risk: This refactors CI infrastructure by extracting the CodeQL analyze job into a reusable workflow and extends it to Windows CI. While it changes workflow structure, it maintains the same CodeQL analysis behavior. The analyze job is currently commented out in v7.6 due to .NET SDK compatibility, so this backport positions the branch to use the new pattern when analysis is re-enabled. The tools/ci.psm1 change adds an optional parameter with safe defaults.

Merge Conflicts

The file .github/workflows/linux-ci.yml had a conflict during cherry-pick.

Conflict Type: Code replacement - inline job vs reusable workflow
Cause: The release/v7.6 branch has the analyze job commented out (temporarily disabled due to .NET SDK 10-rc.2 compatibility issues), while the PR wants to replace it with a call to the new reusable workflow.
Resolution: Removed the commented-out analyze job (approximately 58 lines) and replaced it with the new reusable workflow call from the PR (11 lines). This maintains the refactoring intent - when CodeQL analysis is re-enabled in v7.6, it will use the new reusable workflow pattern.
Manual Changes: None - applied the incoming change exactly as intended in the original PR, preserving the workflow structure and permissions.

…owerShell#26322)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
@TravisEz13 TravisEz13 added the CL-Tools Indicates that a PR should be marked as a tools change in the Change Log label Nov 20, 2025
Copilot AI review requested due to automatic review settings November 20, 2025 00:49
@TravisEz13 TravisEz13 requested a review from a team as a code owner November 20, 2025 00:49
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

This PR refactors the CodeQL security analysis infrastructure by extracting the analyze job into a reusable workflow and enabling it on Windows CI. The changes position the release/v7.6 branch to use this new pattern when CodeQL analysis is re-enabled.

  • Adds a Configuration parameter to Invoke-CIBuild with a default of 'Release' to support different build configurations including 'StaticAnalysis' for CodeQL
  • Creates a new reusable workflow analyze-reusable.yml that can be shared across Linux and Windows CI pipelines
  • Updates both Linux and Windows CI workflows to use the new reusable analyze workflow

Reviewed Changes

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

File Description
tools/ci.psm1 Adds optional Configuration parameter to Invoke-CIBuild with default 'Release' to maintain backward compatibility while supporting 'StaticAnalysis' for CodeQL
.github/workflows/analyze-reusable.yml New reusable workflow for CodeQL analysis that can be called from multiple CI pipelines with platform-specific runner configuration
.github/workflows/linux-ci.yml Replaces commented-out inline analyze job with call to new reusable workflow
.github/workflows/windows-ci.yml Adds CodeQL analysis job using the reusable workflow and includes it in the ready-to-merge gate

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

@TravisEz13 TravisEz13 merged commit 0e83f60 into PowerShell:release/v7.6 Nov 20, 2025
36 checks passed
@TravisEz13 TravisEz13 deleted the backport/release/v7.6/26322-5e5e17766 branch November 20, 2025 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-Tools Indicates that a PR should be marked as a tools change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants