Skip to content

fix: improve CI/CD reliability and security hygiene#1041

Merged
rjmurillo merged 13 commits intomainfrom
fix/990-cicd-reliability
Mar 8, 2026
Merged

fix: improve CI/CD reliability and security hygiene#1041
rjmurillo merged 13 commits intomainfrom
fix/990-cicd-reliability

Conversation

@rjmurillo-bot
Copy link
Copy Markdown
Collaborator

@rjmurillo-bot rjmurillo-bot commented Mar 7, 2026

Summary

Addresses 8 of 10 confirmed CI/CD configuration defects from #990. All changes are configuration-level, no logic changes.

  • Add timeout-minutes to test (30), analyzer-load-test (20), and perf (60) jobs to prevent hung jobs from consuming runner minutes
  • Add /p:ContinuousIntegrationBuild=true to the composite build action for CI/local build parity (enables Roslyn PedanticMode)
  • Restrict linters.yml push trigger to main branch to eliminate duplicate runs on feature branches
  • Add permissions: pull-requests: read to semantic-pr-check.yml for least-privilege token scoping
  • Fix Windows-style path (.\) to Unix-style (./) in powershell.yml (runs on Linux)
  • Pin devskim.yml and linters.yml runners to ubuntu-24.04-arm to match repo convention
  • Add clarifying comment to LangVersion in Compiler.props explaining it uses the SDK default
  • Delete stale pr-labeler-current-milestone.yml one-time backfill workflow

Deferred to follow-on issues

  • Coverage threshold enforcement (requires ReportGenerator or Coverlet migration)
  • Property accessor coverage exclusion review (product decision)

Test plan

  • Verify all workflow YAML passes syntax validation (done locally with Python yaml.safe_load)
  • Confirm main.yml jobs run with timeouts applied
  • Confirm linter workflow no longer double-triggers on feature branch pushes
  • Confirm semantic-pr-check.yml still passes with restricted permissions
  • Confirm devskim.yml runs on ubuntu-24.04-arm
  • Confirm build output includes ContinuousIntegrationBuild=true

Closes #990

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • CI workflows updated to run on Ubuntu 24.04 runners (including architecture adjustments), increased per-job timeouts, and removal of an obsolete scheduled PR-labeling workflow.
    • Build invocation now enables CI-specific build mode while preserving existing options.
  • Documentation
    • Added inline comments noting tool limitations and versioning rationale.
  • Refactor
    • Internal analyzers and symbol-extension logic reorganized to simplify diagnostics and event-handling paths.

- Add timeout-minutes to test (30), analyzer-load-test (20), perf (60)
  jobs in main.yml to prevent hung jobs from wasting runner minutes
- Add /p:ContinuousIntegrationBuild=true to the build command in the
  setup-restore-build composite action for CI/local parity
- Restrict linters.yml push trigger to main branch only, eliminating
  duplicate runs on feature branches already covered by PR triggers
- Add permissions: pull-requests: read to semantic-pr-check.yml for
  least-privilege token scoping
- Fix Windows-style path (.\) to Unix-style (./) in powershell.yml
  since the job runs on ubuntu-latest
- Pin devskim.yml runner to ubuntu-24.04-arm, matching repo convention
- Pin LangVersion to 13 in Compiler.props instead of default, ensuring
  reproducible builds regardless of installed SDK version
- Delete stale pr-labeler-current-milestone.yml one-time backfill
  workflow that re-labels old PRs on a weekly cron

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rjmurillo-bot rjmurillo-bot requested a review from rjmurillo as a code owner March 7, 2026 22:43
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the reliability and security hygiene of the CI/CD pipeline by addressing several configuration defects. The changes focus on standardizing build behavior, optimizing workflow execution, and tightening permissions, all without altering any application logic.

Highlights

  • CI/CD Build Parity: The ContinuousIntegrationBuild=true property was added to the composite build action, ensuring parity between CI and local builds and enabling Roslyn's PedanticMode.
  • C# Language Version Pinning: The C# LangVersion was explicitly pinned to 13 in Compiler.props to match the SDK version specified in global.json.
Changelog
  • .github/actions/setup-restore-build/action.yml
    • Added /p:ContinuousIntegrationBuild=true to the dotnet build command.
  • build/targets/compiler/Compiler.props
    • Pinned the C# LangVersion to 13.
Ignored Files
  • Ignored by pattern: .github/workflows/** (6)
    • .github/workflows/devskim.yml
    • .github/workflows/linters.yml
    • .github/workflows/main.yml
    • .github/workflows/powershell.yml
    • .github/workflows/pr-labeler-current-milestone.yml
    • .github/workflows/semantic-pr-check.yml
Activity
  • The pull request was opened by rjmurillo-bot.
  • No additional human activity or comments have been recorded yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 7, 2026

Warning

Rate limit exceeded

@rjmurillo has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 44 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 28fc8019-3f83-4556-a93c-4dddff4db319

📥 Commits

Reviewing files that changed from the base of the PR and between 1f59178 and 47265f8.

📒 Files selected for processing (1)
  • .github/workflows/devskim.yml
📝 Walkthrough

Walkthrough

Adds CI reliability and configuration fixes plus analyzer refactors: updates GitHub Actions (timeouts, runners, permissions, branch triggers, path fix), appends ContinuousIntegrationBuild to dotnet build, removes a stale labeler workflow, and refactors several analyzers and shared symbol/event helpers without public API changes.

Changes

Cohort / File(s) Summary
CI build action & compiler props
/.github/actions/setup-restore-build/action.yml, build/targets/compiler/Compiler.props
Adds /p:ContinuousIntegrationBuild=true to the dotnet build invocation; adds an XML comment documenting LangVersion default (no behavioral change).
Workflows: timeouts, runners, permissions, triggers, path
.github/workflows/main.yml, .github/workflows/devskim.yml, .github/workflows/linters.yml, .github/workflows/semantic-pr-check.yml, .github/workflows/powershell.yml
Adds per-job timeout-minutes; pins/changes runners to Ubuntu 24.04 variants; adds branches: [main] to linters push trigger; tightens top-level and job permissions; fixes PSScriptAnalyzer path from .\ to ./.
Removed one-time labeler workflow
.github/workflows/pr-labeler-current-milestone.yml
Deletes scheduled one-off labeler workflow that applied labels to a hard-coded set of historical PR numbers.
Shared symbol helper additions
src/Common/ISymbolExtensions.Moq.cs, src/Common/ISymbolExtensions.cs
Adds IsOverridableOrAllowedMockMember(ISymbol, MoqKnownSymbols) extension; removes stray BOM from ISymbolExtensions.cs.
Event helper refactor
src/Common/EventSyntaxExtensions.cs
Converted ValidateEventArgumentTypes to an extension method; consolidated and simplified event parameter extraction helpers and signatures (added optional KnownSymbols parameter).
Mock behavior diagnostic base & analyzers
src/Analyzers/MockBehaviorDiagnosticAnalyzerBase.cs, src/Analyzers/SetExplicitMockBehaviorAnalyzer.cs, src/Analyzers/SetStrictMockBehaviorAnalyzer.cs, src/Analyzers/RaiseEventArgumentsShouldMatchEventSignatureAnalyzer.cs, src/Analyzers/RaisesEventArgumentsShouldMatchEventSignatureAnalyzer.cs, src/Analyzers/VerifyShouldBeUsedOnlyForOverridableMembersAnalyzer.cs, src/Analyzers/SetupShouldBeUsedOnlyForOverridableMembersAnalyzer.cs, src/Analyzers/SetupSequenceShouldBeUsedOnlyForOverridableMembersAnalyzer.cs
Introduces shared diagnostic helpers in MockBehaviorDiagnosticAnalyzerBase; replaces duplicate logic with helper calls; migrates analyzers to use new ISymbolExtensions helper and EventSyntaxExtensions changes; removes several private helper implementations and simplifies control flow.
Minor/CI config metadata
.github/workflows/linters.yml (comments)
Adds comments noting Super-linter ARM64 limitation.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • MattKotsenas
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 57.69% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Out of Scope Changes check ❓ Inconclusive All changes in the PR are directly aligned with addressing #990 objectives. The refactoring of analyzer helpers (MockBehaviorDiagnosticAnalyzerBase, event validation extensions, symbol extensions) supports the code quality improvements but represents internal code consolidation not explicitly scoped in #990. Clarify whether the analyzer refactoring (helper consolidation in MockBehaviorDiagnosticAnalyzerBase and related classes) is in scope for this PR or should be addressed separately.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The PR title directly and concisely summarizes the main change: CI/CD reliability and security improvements. It accurately reflects the configuration-level fixes across multiple workflow and build files.
Description check ✅ Passed The PR description provides a comprehensive summary of all changes made, clear motivation referencing issue #990, and a detailed list of key changes. It includes deferred follow-on issues and test plan checklist, with a closing reference to issue #990.
Linked Issues check ✅ Passed The PR successfully addresses 8 of 10 objectives from #990: timeouts [main.yml], ContinuousIntegrationBuild [action.yml], linters branch filter [linters.yml], permissions scoping [semantic-pr-check.yml], path fix [powershell.yml], runner pinning [devskim.yml, linters.yml], LangVersion comment [Compiler.props], and workflow deletion [pr-labeler]. Coverage threshold enforcement and property accessor exclusion review are appropriately deferred.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/990-cicd-reliability

Comment @coderabbitai help to get the list of available commands and usage tips.

@deepsource-io
Copy link
Copy Markdown

deepsource-io bot commented Mar 7, 2026

DeepSource Code Review

We reviewed changes in a16847e...47265f8 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
C# Mar 8, 2026 11:40p.m. Review ↗

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces several improvements to the CI/CD configuration for reliability and security. The changes are generally positive, addressing timeouts, build consistency, and workflow triggers. However, I've identified a critical issue in build/targets/compiler/Compiler.props where the C# LangVersion is pinned to 13. This requires a .NET 9 SDK, but the version specified in global.json appears to be invalid, which will likely lead to build failures. My feedback includes a suggestion to align the language version with a stable SDK to ensure the build remains functional.

Copy link
Copy Markdown
Collaborator Author

@rjmurillo-bot rjmurillo-bot left a comment

Choose a reason for hiding this comment

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

Reviewer note: Revert the LangVersion pin in Compiler.props. The owner wants to use the latest language version available with the SDK and TFM, not a pinned value. Remove that change from this PR.

Pinning LangVersion to 13 caused 339 build errors because the .NET 10
SDK (10.0.103) ships with C# 14 as default. The Polyfill package
generates C# 14 code, which fails to compile under C# 13. Reverting
to "default" lets LangVersion track the SDK version in global.json.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rjmurillo rjmurillo added github_actions Pull requests that update GitHub Actions code releasable build labels Mar 7, 2026
@github-actions github-actions bot added the bug label Mar 7, 2026
@codacy-production
Copy link
Copy Markdown

codacy-production bot commented Mar 7, 2026

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% (target: -1.00%) (target: 95.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (a16847e) 2508 2247 89.59%
Head commit (47265f8) 2508 (+0) 2247 (+0) 89.59% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#1041) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

- Pin linters.yml runner to ubuntu-24.04-arm to match repo convention
- Move pull-requests: read from top-level to job-level permissions in
  semantic-pr-check.yml, set top-level to empty object

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 8, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
super-linter v8.5.0 only publishes amd64 Docker images. The
ubuntu-24.04-arm runner cannot pull the image because no linux/arm64
manifest exists. Switch to ubuntu-24.04 (x86_64) for this job.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai coderabbitai bot requested a review from MattKotsenas March 8, 2026 19:36
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@build/targets/compiler/Compiler.props`:
- Around line 4-5: The <LangVersion>default</LangVersion> property in
Compiler.props is misleading and can force the repo to use the compiler's latest
major C# version (latestMajor) instead of the TFM/SDK default; either remove the
<LangVersion> element from Compiler.props to let the SDK/TFM determine the C#
version, or replace it with an explicit pinned value such as
<LangVersion>14.0</LangVersion> to make the language version deterministic
across builds. Locate the <LangVersion> entry in Compiler.props and apply one of
these two fixes consistently across the file.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9922daa6-df50-4ea7-9f2b-4caa4f3ca8ce

📥 Commits

Reviewing files that changed from the base of the PR and between 5ef7753 and a337a80.

📒 Files selected for processing (8)
  • .github/actions/setup-restore-build/action.yml
  • .github/workflows/devskim.yml
  • .github/workflows/linters.yml
  • .github/workflows/main.yml
  • .github/workflows/powershell.yml
  • .github/workflows/pr-labeler-current-milestone.yml
  • .github/workflows/semantic-pr-check.yml
  • build/targets/compiler/Compiler.props
💤 Files with no reviewable changes (1)
  • .github/workflows/pr-labeler-current-milestone.yml

coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 8, 2026
Super-linter does not support ARM64 natively (super-linter/super-linter#5070).
The Docker image is x86_64 only. On ARM runners it fails or uses slow
QEMU emulation. ubuntu-latest already resolves to Ubuntu 24.04 since
January 2025, so there is no reproducibility concern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 8, 2026
rjmurillo and others added 2 commits March 8, 2026 15:01
## Summary

Resolves #980. Extracts duplicated logic from three analyzer groups
without changing behavior.

- **Overridable member check**: `IsOverridableOrAllowedMockMember`
extracted to `ISymbolExtensions`, replacing identical private methods
(`IsPropertyOrMethod`, `IsOverridableOrTaskResultMember`,
`IsAllowedMockMember`) in
`SetupShouldBeUsedOnlyForOverridableMembersAnalyzer`,
`SetupSequenceShouldBeUsedOnlyForOverridableMembersAnalyzer`, and
`VerifyShouldBeUsedOnlyForOverridableMembersAnalyzer`
- **MockBehavior reporting**: Added `TryReportMockBehaviorDiagnostic`
and `TryHandleMissingMockBehaviorParameter` overloads with `messageArgs`
plus shared `GetMockedTypeName` to `MockBehaviorDiagnosticAnalyzerBase`,
removing duplicate methods from `SetExplicitMockBehaviorAnalyzer` and
`SetStrictMockBehaviorAnalyzer`
- **Event argument validation**: Replaced
`RaiseEventArgumentsShouldMatchEventSignatureAnalyzer.ValidateArgumentTypesWithEventName`
with existing `EventSyntaxExtensions.ValidateEventArgumentTypes`

Net result: 122 lines added, 285 lines removed (163 lines reduced).

## Test plan

- [x] All 2901 existing tests pass with zero failures
- [x] Build succeeds with zero warnings
- [x] No diagnostic IDs, messages, or categories changed
- [x] No analyzer behavior changed, only structure

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Refactor**
* Consolidated mock-behavior diagnostic reporting to a single path with
support for formatted messages and overload-aware reporting.
* Replaced many inlined helpers with shared reporting/handling flows for
strict/explicit mock analyses.
* Switched event-argument validation to context-based extension calls
for consistency.
* Centralized overridable/allowed-member checks into a single symbol
extension used by setup, verify, and sequence analyzers.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Richard Murillo <rjmurillo@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ rjmurillo
❌ rjmurillo-bot
You have signed the CLA already but the status is still pending? Let us recheck it.

@rjmurillo rjmurillo added the analyzers Change that impacts an analyzer behavior label Mar 8, 2026
@rjmurillo rjmurillo merged commit cfef9ba into main Mar 8, 2026
12 of 17 checks passed
@rjmurillo rjmurillo deleted the fix/990-cicd-reliability branch March 8, 2026 23:40
@rjmurillo rjmurillo added this to the vNext milestone Mar 8, 2026
rjmurillo added a commit that referenced this pull request Mar 8, 2026
Add skill sidecar learnings from PR #1041 ARM64 incident:
- Never fabricate technical compatibility claims without verification
- Always cite upstream issues when making platform support assertions
- Correction protocol: unresolve, correct with sources, fix code

Ignore .claude/ directory (ephemeral worktree artifacts).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
rjmurillo added a commit that referenced this pull request Mar 8, 2026
Update inline comment on devskim.yml to explain why ARM64 runners
cannot be used: DevSkim-Action is a Docker container action, which
GitHub Actions only supports on Linux x64 runners. Link to GitHub
docs as the upstream reference.

Addresses unresolved review feedback from PR #1041.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
rjmurillo added a commit that referenced this pull request Mar 8, 2026
Update inline comment on devskim.yml to explain why ARM64 runners
cannot be used: DevSkim-Action is a Docker container action, which
GitHub Actions only supports on Linux x64 runners. Link to GitHub
docs as the upstream reference.

Addresses unresolved review feedback from PR #1041.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
rjmurillo added a commit that referenced this pull request Mar 8, 2026
)

## Summary
- Update inline comment on `devskim.yml` to document why ARM64 runners
cannot be used
- DevSkim-Action is a Docker container action (`using: 'docker'`), which
GitHub Actions only supports on Linux x64 runners
- Links to [GitHub
docs](https://docs.github.com/en/actions/creating-actions/about-custom-actions#docker-container-actions)
as upstream reference
- Addresses unresolved review feedback from PR #1041

## Test plan
- [ ] CI passes (no functional change, comment-only update)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Richard Murillo <rjmurillo@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

analyzers Change that impacts an analyzer behavior bug build github_actions Pull requests that update GitHub Actions code releasable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build: CI/CD reliability improvements - timeouts, permissions, path fixes

3 participants