Add local Moon-based validation via scripts/check#256599
Add local Moon-based validation via scripts/check#256599tylersmalley merged 9 commits intoelastic:mainfrom
Conversation
57daa3d to
d5c0edb
Compare
Part of #256599 — extracts the shared validation runner infrastructure into its own package to land incrementally. --------- Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
Part of elastic#256599 — extracts the shared validation runner infrastructure into its own package to land incrementally. --------- Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co> (cherry picked from commit edea080)
Part of elastic#256599 — extracts the shared validation runner infrastructure into its own package to land incrementally. --------- Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co> (cherry picked from commit edea080) # Conflicts: # .github/CODEOWNERS
Part of elastic#256599 — extracts the shared validation runner infrastructure into its own package to land incrementally. --------- Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co> (cherry picked from commit edea080) # Conflicts: # .github/CODEOWNERS
Part of #256599 — extracts the shared validation runner infrastructure into its own package to land incrementally. --------- Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
d5c0edb to
01da88b
Compare
Part of elastic#256599 — extracts the shared validation runner infrastructure into its own package to land incrementally. --------- Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
f26378d to
4f623c6
Compare
4f623c6 to
5a4feda
Compare
352d6a1 to
b394cb3
Compare
b394cb3 to
f3fc49d
Compare
Introduce a new `scripts/check` entrypoint that uses Moon changed-file resolution to run eslint, jest, and type_check against local, staged, or branch-scoped changes. Keep the existing `eslint`, `jest`, and `type_check` commands intact for their default direct usage, and only route them through the new validation contract when scoped validation flags are present. This also adds dedicated contract runners for jest, eslint, and type_check, plus clearer help and shallow-repo warnings for the new workflow.
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
8aa3974 to
abc02a8
Compare
src/dev/run_check.ts
Outdated
| let tsconfig = ''; | ||
| if (fileMatch) { | ||
| let dir = Path.dirname(Path.resolve(REPO_ROOT, fileMatch[1])); | ||
| while (dir !== REPO_ROOT && dir !== Path.dirname(dir)) { |
There was a problem hiding this comment.
🟢 Low dev/run_check.ts:856
The while loop in the tsc error handling uses dir !== REPO_ROOT && dir !== Path.dirname(dir) as its condition, so when dir equals REPO_ROOT, the loop exits before checking for tsconfig.json at the root. If a TypeScript error occurs in a file whose only owning config is at the repository root, tsconfig remains empty and the suggested rerun command incorrectly omits the --project flag.
- while (dir !== REPO_ROOT && dir !== Path.dirname(dir)) {
+ while (true) {🤖 Copy this AI Prompt to have your agent fix this:
In file src/dev/run_check.ts around line 856:
The `while` loop in the tsc error handling uses `dir !== REPO_ROOT && dir !== Path.dirname(dir)` as its condition, so when `dir` equals `REPO_ROOT`, the loop exits before checking for `tsconfig.json` at the root. If a TypeScript error occurs in a file whose only owning config is at the repository root, `tsconfig` remains empty and the suggested rerun command incorrectly omits the `--project` flag.
Evidence trail:
src/dev/run_check.ts lines 854-878 at REVIEWED_COMMIT. The while loop condition at line 856 `while (dir !== REPO_ROOT && dir !== Path.dirname(dir))` prevents the loop body from executing when dir equals REPO_ROOT, so tsconfig.json at the repository root is never checked. Lines 871-877 show that when tsconfig is empty, the fallback command `--profile quick` is used instead of `--project tsconfig.json`.
abc02a8 to
9a7c860
Compare
Part of elastic#256599 — extracts the shared validation runner infrastructure into its own package to land incrementally. --------- Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co> (cherry picked from commit edea080)
Part of elastic#256599 — extracts the shared validation runner infrastructure into its own package to land incrementally. --------- Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co> (cherry picked from commit edea080) # Conflicts: # .github/CODEOWNERS
Part of elastic#256599 — extracts the shared validation runner infrastructure into its own package to land incrementally. --------- Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co> (cherry picked from commit edea080) # Conflicts: # .github/CODEOWNERS
jbudz
left a comment
There was a problem hiding this comment.
LGTM. Code review + local testing.
This review was focused on functionality, design, and UX through the CLI.
When this is added to other areas the review scope will expand -
- agent loop: (e.g. a change in
x-pack/testcan pull in the whole typescript tree and take 20+ minutes to type check) - primary check on CI: the review will enumerate edge cases.
# Backport This will backport the following commits from `main` to `8.19`: - [Add shared validation runner package (#258768)](#258768) <!--- Backport version: 11.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Tyler Smalley","email":"tyler.smalley@elastic.co"},"sourceCommit":{"committedDate":"2026-03-23T22:12:20Z","message":"Add shared validation runner package (#258768)\n\nPart of #256599 — extracts the shared validation runner infrastructure into its own package to land incrementally.\n\n---------\n\nSigned-off-by: Tyler Smalley <tyler.smalley@elastic.co>","sha":"edea0805670d85d180e4f72a0481adaa68ff909b","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport missing","backport:all-open","v9.4.0"],"title":"Add shared validation runner package","number":258768,"url":"https://github.com/elastic/kibana/pull/258768","mergeCommit":{"message":"Add shared validation runner package (#258768)\n\nPart of #256599 — extracts the shared validation runner infrastructure into its own package to land incrementally.\n\n---------\n\nSigned-off-by: Tyler Smalley <tyler.smalley@elastic.co>","sha":"edea0805670d85d180e4f72a0481adaa68ff909b"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/258768","number":258768,"mergeCommit":{"message":"Add shared validation runner package (#258768)\n\nPart of #256599 — extracts the shared validation runner infrastructure into its own package to land incrementally.\n\n---------\n\nSigned-off-by: Tyler Smalley <tyler.smalley@elastic.co>","sha":"edea0805670d85d180e4f72a0481adaa68ff909b"}},{"url":"https://github.com/elastic/kibana/pull/259217","number":259217,"branch":"9.3","state":"OPEN"}]}] BACKPORT-->
# Backport This will backport the following commits from `main` to `9.2`: - [Add shared validation runner package (#258768)](#258768) <!--- Backport version: 11.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Tyler Smalley","email":"tyler.smalley@elastic.co"},"sourceCommit":{"committedDate":"2026-03-23T22:12:20Z","message":"Add shared validation runner package (#258768)\n\nPart of #256599 — extracts the shared validation runner infrastructure into its own package to land incrementally.\n\n---------\n\nSigned-off-by: Tyler Smalley <tyler.smalley@elastic.co>","sha":"edea0805670d85d180e4f72a0481adaa68ff909b","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport missing","backport:all-open","v9.4.0"],"title":"Add shared validation runner package","number":258768,"url":"https://github.com/elastic/kibana/pull/258768","mergeCommit":{"message":"Add shared validation runner package (#258768)\n\nPart of #256599 — extracts the shared validation runner infrastructure into its own package to land incrementally.\n\n---------\n\nSigned-off-by: Tyler Smalley <tyler.smalley@elastic.co>","sha":"edea0805670d85d180e4f72a0481adaa68ff909b"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/258768","number":258768,"mergeCommit":{"message":"Add shared validation runner package (#258768)\n\nPart of #256599 — extracts the shared validation runner infrastructure into its own package to land incrementally.\n\n---------\n\nSigned-off-by: Tyler Smalley <tyler.smalley@elastic.co>","sha":"edea0805670d85d180e4f72a0481adaa68ff909b"}},{"url":"https://github.com/elastic/kibana/pull/259217","number":259217,"branch":"9.3","state":"OPEN"}]}] BACKPORT-->
|
Starting backport for target branches: 8.19, 9.2, 9.3 https://github.com/elastic/kibana/actions/runs/23970240196 |
# Backport This will backport the following commits from `main` to `9.3`: - [Add shared validation runner package (#258768)](#258768) <!--- Backport version: 11.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Tyler Smalley","email":"tyler.smalley@elastic.co"},"sourceCommit":{"committedDate":"2026-03-23T22:12:20Z","message":"Add shared validation runner package (#258768)\n\nPart of #256599 — extracts the shared validation runner infrastructure into its own package to land incrementally.\n\n---------\n\nSigned-off-by: Tyler Smalley <tyler.smalley@elastic.co>","sha":"edea0805670d85d180e4f72a0481adaa68ff909b","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport missing","backport:all-open","v9.4.0"],"title":"Add shared validation runner package","number":258768,"url":"https://github.com/elastic/kibana/pull/258768","mergeCommit":{"message":"Add shared validation runner package (#258768)\n\nPart of #256599 — extracts the shared validation runner infrastructure into its own package to land incrementally.\n\n---------\n\nSigned-off-by: Tyler Smalley <tyler.smalley@elastic.co>","sha":"edea0805670d85d180e4f72a0481adaa68ff909b"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/258768","number":258768,"mergeCommit":{"message":"Add shared validation runner package (#258768)\n\nPart of #256599 — extracts the shared validation runner infrastructure into its own package to land incrementally.\n\n---------\n\nSigned-off-by: Tyler Smalley <tyler.smalley@elastic.co>","sha":"edea0805670d85d180e4f72a0481adaa68ff909b"}},{"url":"https://github.com/elastic/kibana/pull/259217","number":259217,"branch":"9.3","state":"OPEN"}]}] BACKPORT--> --------- Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
Introduce a new `scripts/check` entrypoint that uses Moon changed-file resolution to run eslint, jest, and type_check against local, staged, or branch-scoped changes. Keep the existing `eslint`, `jest`, and `type_check` commands intact for their default direct usage, and only route them through the new validation contract when scoped validation flags are present. This also adds dedicated contract runners for jest, eslint, and type_check, plus clearer help and shallow-repo warnings for the new workflow. Updates elastic#255391 --------- Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
3 similar comments
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Introduce a new
scripts/checkentrypoint that uses Moon changed-file resolution to run eslint, jest, and type_check against local, staged, or branch-scoped changes.Keep the existing
eslint,jest, andtype_checkcommands intact for their default direct usage, and only route them through the new validation contract when scoped validation flags are present. This also adds dedicated contract runners for jest, eslint, and type_check, plus clearer help and shallow-repo warnings for the new workflow.Updates #255391