-
Notifications
You must be signed in to change notification settings - Fork 44
Add AI PR review workflow #3890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+62
−0
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| name: PR Review | ||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled] | ||
|
|
||
| permissions: | ||
| actions: read | ||
| contents: read | ||
| copilot-requests: write | ||
| issues: read | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| run: | ||
| if: >- | ||
| github.event.pull_request.draft == false && | ||
| !contains(github.event.pull_request.labels.*.name, 'skip-auto-pr-review') && | ||
| (github.event.action != 'labeled' && github.event.action != 'unlabeled' || github.event.label.name == 'skip-auto-pr-review') | ||
| uses: elastic/ai-github-actions/.github/workflows/gh-aw-pr-review.lock.yml@v0 | ||
|
Mpdreamz marked this conversation as resolved.
|
||
| with: | ||
| allowed-bot-users: "github-actions[bot],dependabot[bot]" | ||
| intensity: aggressive | ||
| minimum_severity: nitpick | ||
| additional-instructions: | | ||
| This is the elastic/docs-builder repo — Elastic's documentation build toolchain. | ||
| It processes Markdown from multiple repos into a unified documentation site, | ||
| validates cross-repo references, and ships as native AOT binaries for CI. | ||
|
|
||
| ## Language and frameworks | ||
| - C# (.NET) with xUnit v3 + AwesomeAssertions for tests. Do NOT suggest TUnit APIs — the migration hasn't happened yet. | ||
| - TypeScript/React frontend under src/Elastic.Documentation.Site/. | ||
| - Test naming convention: Method_Scenario_Expected. | ||
|
|
||
| ## AOT / source-generated JSON (critical) | ||
| Both CLIs (docs-builder, essc) and the Lambda functions are Native AOT or AOT-compatible. | ||
| Any new serialized type MUST be registered with [JsonSerializable] on the relevant | ||
| JsonSerializerContext (see src/Elastic.Documentation/Serialization/SourceGenerationContext.cs). | ||
| Reflection-based serialization silently passes compile-time but fails at AOT runtime. | ||
| Flag any use of JsonSerializer without a matching context registration. | ||
|
|
||
| ## Code style rules to enforce | ||
| - Public async methods: PascalCaseAsync. Private async: PascalCase. Never .Result/.Wait(). | ||
| - Always accept CancellationToken. Use ConfigureAwait(false) in library code. | ||
| - Max 4 parameters — use a record/options object beyond that. | ||
| - Boolean parameters must be named at call sites. | ||
| - Never return null from collections — return []. | ||
| - Guard clauses first, happy path last. | ||
| - Max 5–7 branches per method. | ||
| - No #region. No multi-paragraph docstrings. | ||
|
|
||
| ## Architecture boundaries | ||
| - Elastic.Documentation is the domain project — don't suggest extracting a .Domain sub-project. | ||
| - Heavy dependencies belong in Tooling projects, not the core domain. | ||
| - Never strip attributes (e.g. [CommandIntent], [MutationScope], [RequiresAuth]) from types to satisfy architectural moves. | ||
| - The shared search contract (src/services/search/Elastic.Documentation.Search.Contract/) | ||
| must stay dependency-light — both the docs indexer and essc reference it. | ||
|
|
||
| ## Destructive commands | ||
| Flag any changes to commands tagged [CommandIntent(Intent.Destructive)], | ||
| [MutationScope(MutationScope.Global)], or [RequiresAuth] — these have high blast radius | ||
| (mass S3 deletes, repo-wide link rewrites). Similarly flag changes to essc IndicesCommands.cs | ||
| that affect unify/copy/cleanup/sync-remote against production clusters. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.