Skip to content

CI: Enable AOT analyzers on library projects, skip AOT publish on PRs#2971

Open
reakaleek wants to merge 1 commit intomainfrom
best-pamphlet
Open

CI: Enable AOT analyzers on library projects, skip AOT publish on PRs#2971
reakaleek wants to merge 1 commit intomainfrom
best-pamphlet

Conversation

@reakaleek
Copy link
Member

What

Enable Roslyn's AOT/trim analyzers on all library projects in the docs-builder dependency closure, and skip the native AOT publish step on pull requests.

Why

AOT/trim errors (IL2026/IL3050) only surfaced during the native ILC publish step in CI, not during local builds or the lint job. This made issues like anonymous-type serialization bugs invisible until the container publish stage.

How

  • Add <IsAotCompatible>true</IsAotCompatible> to 12 library projects that were missing it (5 already had PublishAot which enables the same analyzers)
  • Gate the Publish AOT, Publish Containers, and Run Container CI steps behind github.event_name == 'push' so they only run on merges to main, not on PRs

Test plan

  • PR CI should pass with only compile + test (no AOT publish)
  • Verify main branch still runs the full AOT publish + container steps after merge

🤖 Generated with Claude Code

… PRs

Add IsAotCompatible to 12 library projects referenced by docs-builder so
Roslyn's trim/AOT analyzers (IL2026/IL3050) run during regular builds.
This catches AOT issues at compile time, removing the need for the
expensive native ILC publish step on pull requests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Member

@Mpdreamz Mpdreamz left a comment

Choose a reason for hiding this comment

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

Nice!

@coderabbitai
Copy link

coderabbitai bot commented Mar 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5a92f9a6-d485-4844-8e00-b767e6e749cb

📥 Commits

Reviewing files that changed from the base of the PR and between 42b43e9 and 69191f9.

📒 Files selected for processing (13)
  • .github/workflows/ci.yml
  • src/Elastic.Documentation.Configuration/Elastic.Documentation.Configuration.csproj
  • src/Elastic.Documentation.LegacyDocs/Elastic.Documentation.LegacyDocs.csproj
  • src/Elastic.Documentation.LinkIndex/Elastic.Documentation.LinkIndex.csproj
  • src/Elastic.Documentation.Links/Elastic.Documentation.Links.csproj
  • src/Elastic.Documentation.Navigation/Elastic.Documentation.Navigation.csproj
  • src/Elastic.Documentation.ServiceDefaults/Elastic.Documentation.ServiceDefaults.csproj
  • src/Elastic.Documentation/Elastic.Documentation.csproj
  • src/authoring/Elastic.Documentation.Refactor/Elastic.Documentation.Refactor.csproj
  • src/services/Elastic.Changelog/Elastic.Changelog.csproj
  • src/services/Elastic.Documentation.Assembler/Elastic.Documentation.Assembler.csproj
  • src/services/Elastic.Documentation.Isolated/Elastic.Documentation.Isolated.csproj
  • src/services/Elastic.Documentation.Services/Elastic.Documentation.Services.csproj

📝 Walkthrough

Walkthrough

The pull request updates the CI/CD workflow to restrict publish and container steps to push events only, preventing these operations from running on other event types like pull requests. Additionally, all twelve project files across the solution now declare AOT (Ahead-of-Time) compatibility by adding the IsAotCompatible property to their respective project configurations, enabling potential future AOT-based deployments.

Suggested labels

ci, chore

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and clearly summarizes the main changes: enabling AOT analyzers on library projects and skipping AOT publish on PRs.
Description check ✅ Passed The description is well-organized, explains the problem, the solution, and how it was implemented, all relevant to the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch best-pamphlet

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

@reakaleek reakaleek removed the chore label Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants