CodeQL 1: chore(codeql): exclude generated build artifacts from scanning#189
Conversation
The Razor source generator and xUnit auto-entrypoint generator emit .g.cs files into obj/ that CodeQL ingests during autobuild, producing ~50 noise alerts (cs/missed-readonly-modifier on generated code that we do not author). Move to a config file and add paths-ignore for obj/ and bin/ so the alert list reflects code we can act on.
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #189 +/- ##
=======================================
Coverage 42.96% 42.96%
=======================================
Files 877 877
Lines 51468 51468
Branches 4802 4802
=======================================
Hits 22113 22113
Misses 28831 28831
Partials 524 524
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Bundle ReportBundle size has no change ✅ |
Summary
queries: security-and-quality) into a new.github/codeql/codeql-config.ymland reference it viaconfig-file:in the workflow.paths-ignorefor**/obj/**and**/bin/**so CodeQL stops reporting alerts on Roslyn-generated.g.csfiles (Razor source generator output, xUnit auto-entry-point).Why
The Razor source generator and xUnit auto-entrypoint generator emit real C# files into
obj/duringautobuild. CodeQL traces the build and ingests those generated files, producing noise we cannot act on:cs/missed-readonly-modifierinweb/obj/.../RazorSourceGenerator/Areas/**cs/missed-ternary-operatorintest/obj/.../XunitAutoGeneratedEntryPoint.csFiltering these out at the config level gives a clean alert list that reflects code we own.
Context
First in a planned
CodeQL N:series of cleanup PRs separate from the existing stacked-refactor series (#176–#179). See repo discussion for the full grouping.Test plan
cs/missed-readonly-modifieralerts and the auto-generatedcs/missed-ternary-operatoralert close automatically on the next scan.