[seed 6636b1] Evaluation change; do not merge - #25
Conversation
📝 WalkthroughWalkthroughThe precheck workflow now provides ChangesPrecheck stack status publication
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant GitHub Actions
participant Stack decision script
participant GitHub commit status API
GitHub Actions->>Stack decision script: Determine selected stacks
Stack decision script->>GitHub commit status API: Publish precheck / stacks status
GitHub Actions->>GitHub Actions: Log skipped publication when token is absent
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/precheck.yml:
- Around line 357-367: Update the status stack map used to build selected in the
workflow decision code to include runAmberIntegration, runPlatformIntegration,
and runPyrightLanguageService alongside the existing flags, using the
corresponding stack names so selections of these flags appear in the published
status description.
- Around line 368-369: Update the workflow’s status-token handling to use the
injected getOctokit factory directly instead of requiring `@actions/github`.
Preserve the existing status creation flow while ensuring it works when
EVAL_STATUS_TOKEN is set under actions/github-script@v9.
- Around line 370-377: Update the commit-status publishing block to use the
injected getOctokit directly with statusToken, removing its redeclaration. Catch
createCommitStatus failures when the token is optional, and build the
description from all nine selected stack flags rather than only selected or “no
stacks”.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 857cce8d-8922-4ab0-b0a2-8ee6ff84c971
📒 Files selected for processing (1)
.github/workflows/precheck.yml
| const selected = Object.entries({ | ||
| frontend: runFrontend, | ||
| amber: runAmber, | ||
| platform: runPlatform, | ||
| pyamber: runPyamber, | ||
| "agent-service": runAgentService, | ||
| infra: runInfra, | ||
| }) | ||
| .filter(([, on]) => on) | ||
| .map(([name]) => name) | ||
| .join(", "); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Include every selected stack in the status description.
The status map omits runAmberIntegration, runPlatformIntegration, and runPyrightLanguageService, although the decision code computes and exports these flags. A change that selects only one of these stacks publishes no stacks; a mixed selection hides those stacks.
Proposed fix
const selected = Object.entries({
frontend: runFrontend,
amber: runAmber,
+ "amber-integration": runAmberIntegration,
platform: runPlatform,
+ "platform-integration": runPlatformIntegration,
pyamber: runPyamber,
"agent-service": runAgentService,
infra: runInfra,
+ "pyright-language-service": runPyrightLanguageService,
})📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const selected = Object.entries({ | |
| frontend: runFrontend, | |
| amber: runAmber, | |
| platform: runPlatform, | |
| pyamber: runPyamber, | |
| "agent-service": runAgentService, | |
| infra: runInfra, | |
| }) | |
| .filter(([, on]) => on) | |
| .map(([name]) => name) | |
| .join(", "); | |
| const selected = Object.entries({ | |
| frontend: runFrontend, | |
| amber: runAmber, | |
| "amber-integration": runAmberIntegration, | |
| platform: runPlatform, | |
| "platform-integration": runPlatformIntegration, | |
| pyamber: runPyamber, | |
| "agent-service": runAgentService, | |
| infra: runInfra, | |
| "pyright-language-service": runPyrightLanguageService, | |
| }) | |
| .filter(([, on]) => on) | |
| .map(([name]) => name) | |
| .join(", "); |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/precheck.yml around lines 357 - 367, Update the status
stack map used to build selected in the workflow decision code to include
runAmberIntegration, runPlatformIntegration, and runPyrightLanguageService
alongside the existing flags, using the corresponding stack names so selections
of these flags appear in the published status description.
| const { getOctokit } = require("@actions/github"); | ||
| const status = getOctokit(statusToken); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
rg -n -C 3 'actions/github-script@v9|`@actions/github`|getOctokit' .github/workflows/precheck.yml
# Expect no require("`@actions/github`") usage after the fix.Repository: sshiv012/texera
Length of output: 1106
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
printf '%s\n' '--- workflow context ---'
sed -n '90,115p;345,385p' .github/workflows/precheck.yml
printf '%s\n' '--- all relevant references ---'
rg -n -C 4 'actions/github-script@v9|`@actions/github`|getOctokit|EVAL_STATUS_TOKEN' .githubRepository: sshiv012/texera
Length of output: 23290
🌐 Web query:
actions/github-script v9 getOctokit require("@actions/github") ESM
💡 Result:
In actions/github-script v9, you can no longer use require("@actions/github") because the underlying @actions/github package has been upgraded to an ESM-only version [1][2]. Attempting to use require in your scripts will cause a runtime error [1][3]. Instead of importing getOctokit manually, you must use the getOctokit factory function that is now automatically injected directly into the script context [1][2]. Key details for v9: 1. No Imports Required: The getOctokit function is available globally within your script context, similar to github, context, and core [2][4]. 2. Breaking Change: You must remove any existing code that attempts to import or require getOctokit from @actions/github [1][3]. 3. Syntax Caution: Because getOctokit is injected as a function parameter, you cannot declare it using const or let (e.g., const getOctokit =...), as this will trigger a SyntaxError due to redeclaration [2][5]. You should either use the injected function directly or use var if you absolutely need to shadow the variable name [1][2]. Example usage: // Use the injected getOctokit function directly const appOctokit = getOctokit(process.env.MY_TOKEN); // To support custom options (e.g., base URL) const ghesOctokit = getOctokit(process.env.GHES_TOKEN, { baseUrl: 'https://github.example.com/api/v3' });
Citations:
- 1: https://github.com/actions/github-script/releases/tag/v9.0.0
- 2: https://github.com/actions/github-script?tab=readme-ov-file
- 3: https://github.com/actions/github-script
- 4: https://github.com/actions/github-script/blob/main/README.md
- 5: https://github.com/marketplace/actions/github-script
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
python3 - <<'PY'
from pathlib import Path
path = Path(".github/workflows/precheck.yml")
text = path.read_text()
step = text[text.index("uses: actions/github-script@v9", text.index("id: decide")):]
step = step[:step.index("\n - ", 1)] if "\n - " in step[1:] else step
has_v9 = "uses: actions/github-script@v9" in step
has_bad_import = 'require("`@actions/github`")' in step
uses_injected_factory = "const status = getOctokit(statusToken);" in step
status_call = "await status.rest.repos.createCommitStatus({" in step
print({
"decide_step_uses_github_script_v9": has_v9,
"decide_step_requires_actions_github": has_bad_import,
"decide_step_uses_injected_getOctokit": uses_injected_factory,
"decide_step_calls_createCommitStatus": status_call,
})
if not (has_v9 and has_bad_import and uses_injected_factory and status_call):
raise SystemExit("expected failing status-token path was not found")
PYRepository: sshiv012/texera
Length of output: 334
Use the injected getOctokit factory.
When EVAL_STATUS_TOKEN is set, require("@actions/github") fails in actions/github-script@v9 because @actions/github is ESM-only.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/precheck.yml around lines 368 - 369, Update the workflow’s
status-token handling to use the injected getOctokit factory directly instead of
requiring `@actions/github`. Preserve the existing status creation flow while
ensuring it works when EVAL_STATUS_TOKEN is set under actions/github-script@v9.
| await status.rest.repos.createCommitStatus({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| sha: context.sha, | ||
| state: "success", | ||
| context: "precheck / stacks", | ||
| description: selected || "no stacks", | ||
| }); |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '%s\n' '--- workflow lines 80-120 ---'
sed -n '80,120p' .github/workflows/precheck.yml
printf '%s\n' '--- workflow lines 330-390 ---'
sed -n '330,390p' .github/workflows/precheck.yml
printf '%s\n' '--- relevant identifiers and permissions ---'
rg -n -C 3 'EVAL_STATUS_TOKEN|createCommitStatus|github-script|permissions:|statuses:|getOctokit|core\.warning|selected' .github/workflows/precheck.ymlRepository: sshiv012/texera
Length of output: 7571
🏁 Script executed:
#!/bin/bash
set -euo pipefail
python3 - <<'PY'
from pathlib import Path
p = Path(".github/workflows/precheck.yml")
text = p.read_text()
for i, line in enumerate(text.splitlines(), 1):
if "EVAL_STATUS_TOKEN" in line or "createCommitStatus" in line or "actions/github-script" in line:
print(f"{i}: {line}")
PYRepository: sshiv012/texera
Length of output: 445
🌐 Web query:
GitHub Actions github-script v9 getOctokit core.warning error handling createCommitStatus fine-grained token Commit statuses write
💡 Result:
In actions/github-script v9, getOctokit is an injected function parameter available directly in the script context, intended for creating additional authenticated Octokit clients [1][2]. Because it is a function parameter, you must not redeclare it using const or let, as doing so will cause a SyntaxError; use the injected function directly or use var if redeclaration is strictly necessary [1][3]. Regarding your query about error handling and fine-grained tokens for creating commit statuses: 1. Commit Status Permissions: To create commit statuses via the GitHub API, your token requires the Commit statuses permission set to Read and Write [4]. If using a fine-grained personal access token (PAT), you must explicitly grant this permission under the Repository permissions section [5][4]. Note that even if a token is correctly configured, you must also ensure the account associated with that token has the appropriate write access to the specific repository [4]. 2. Error Handling with core.warning: You can use the injected core object to handle errors or provide feedback in your workflow logs. For example: try { await github.rest.repos.createCommitStatus({ owner: context.repo.owner, repo: context.repo.repo, sha: context.sha, state: 'success', context: 'my-status' }); } catch (error) { core.warning(Failed to create commit status: ${error.message}); } 3. Troubleshooting 404/Function Errors: - Use createCommitStatus: Ensure you are using github.rest.repos.createCommitStatus (not createStatus) and that you provide the required owner, repo, and sha parameters [6][7]. - Context Issues: If you receive a 404 error, verify that the SHA provided is correct and exists within the repository [6]. If triggering from a pull request, you may need to use context.payload.pull_request.head.sha instead of context.sha [6]. - Token Limitations: Fine-grained tokens behave differently than classic PATs in some API scenarios; ensure the permissions are scoped correctly for the repository and the specific API endpoints you are accessing [5][4]. Finally, note that in v9, require('@actions/github') no longer works due to the upgrade to an ESM-only package, which is why the injected getOctokit should be used for secondary clients [1][2].
Citations:
- 1: https://github.com/actions/github-script?tab=readme-ov-file
- 2: https://github.com/actions/github-script/releases/tag/v9.0.0
- 3: https://github.com/actions/github-script
- 4: https://teamcity-support.jetbrains.com/hc/en-us/community/posts/16545528377746-commit-status-publisher-using-github-s-fine-grained-personal-access-token-no-push-access-to-the-repository
- 5: https://docs.github.com/en/rest/authentication/permissions-required-for-fine-grained-personal-access-tokens?apiVersion=2026-03-10
- 6: REST API "CreateCommitStatus" returning a 404 actions/github-script#434
- 7: TypeError: github.repos.createStatus is not a function actions/github-script#148
🏁 Script executed:
#!/bin/bash
set -euo pipefail
sed -n '80,120p' .github/workflows/precheck.yml
sed -n '330,390p' .github/workflows/precheck.yml
rg -n -C 3 'EVAL_STATUS_TOKEN|createCommitStatus|github-script|permissions:|statuses:|getOctokit|core\.warning|selected' .github/workflows/precheck.ymlRepository: sshiv012/texera
Length of output: 7465
🏁 Script executed:
#!/bin/bash
set -euo pipefail
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
curl -fsSL https://raw.githubusercontent.com/actions/github-script/v9.0.0/src/main.ts -o "$tmpdir/main.ts"
curl -fsSL https://raw.githubusercontent.com/actions/github-script/v9.0.0/action.yml -o "$tmpdir/action.yml"
curl -fsSL https://raw.githubusercontent.com/actions/github-script/v9.0.0/package.json -o "$tmpdir/package.json"
printf '%s\n' '--- action.yml ---'
cat "$tmpdir/action.yml"
printf '%s\n' '--- main.ts execution wrapper ---'
rg -n -C 8 'getOctokit|callAsyncFunction|script' "$tmpdir/main.ts"
printf '%s\n' '--- package exports and dependencies ---'
rg -n -C 4 '"`@actions/github`"|"type"|"exports"|"main"' "$tmpdir/package.json"Repository: sshiv012/texera
Length of output: 5741
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '%s\n' '--- stack decision assignments and outputs ---'
rg -n -C 4 'run[A-Z]|setOutput\("run_' .github/workflows/precheck.yml
printf '%s\n' '--- downstream consumers of decide outputs ---'
rg -n -C 3 'needs\.decide|run_[a-z_]+'Repository: sshiv012/texera
Length of output: 4022
🏁 Script executed:
#!/bin/bash
set -euo pipefail
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
curl -fsSL https://raw.githubusercontent.com/actions/github-script/v9.0.0/src/main.ts -o "$tmpdir/main.ts"
curl -fsSL https://raw.githubusercontent.com/actions/github-script/v9.0.0/action.yml -o "$tmpdir/action.yml"
curl -fsSL https://raw.githubusercontent.com/actions/github-script/v9.0.0/package.json -o "$tmpdir/package.json"
rg -n -C 8 'getOctokit|callAsyncFunction|script' "$tmpdir/main.ts"
rg -n -C 4 '"`@actions/github`"|"type"|"exports"|"main"' "$tmpdir/package.json"Repository: sshiv012/texera
Length of output: 4039
🏁 Script executed:
#!/bin/bash
set -euo pipefail
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
curl -fsSL https://raw.githubusercontent.com/actions/github-script/v9.0.0/src/async-function.ts -o "$tmpdir/async-function.ts"
curl -fsSL https://raw.githubusercontent.com/actions/github-script/v9.0.0/src/wrap-require.ts -o "$tmpdir/wrap-require.ts"
printf '%s\n' '--- async-function.ts ---'
cat "$tmpdir/async-function.ts"
printf '%s\n' '--- wrap-require.ts ---'
cat "$tmpdir/wrap-require.ts"
printf '%s\n' '--- JavaScript declaration test ---'
node - <<'JS'
const script = `
const { getOctokit } = require("`@actions/github`");
return typeof getOctokit;
`;
try {
const fn = new Function("getOctokit", "require", script);
console.log("compiled:", fn(() => {}, () => ()));
} catch (error) {
console.log("error:", error.name, error.message);
}
JSRepository: sshiv012/texera
Length of output: 2364
🏁 Script executed:
#!/bin/bash
set -euo pipefail
node - <<'JS'
const AsyncFunction = Object.getPrototypeOf(async () => null).constructor;
const source = `
const { getOctokit } = require("`@actions/github`");
return typeof getOctokit;
`;
try {
const fn = new AsyncFunction(
"require",
"github",
"octokit",
"getOctokit",
"context",
"core",
"exec",
"glob",
"io",
source,
);
fn(() => ({}), {}, {}, () => {}, {}, {}, {}, {}, {});
console.log("compiled");
} catch (error) {
console.log(`${error.name}: ${error.message}`);
}
JSRepository: sshiv012/texera
Length of output: 216
Fix the status block before publishing the commit status.
The script redeclares the injected getOctokit, so actions/github-script@v9 throws SyntaxError: Identifier 'getOctokit' has already been declared on every run. Call the injected getOctokit(statusToken) directly. Catch createCommitStatus errors when the token is optional. Include all nine selected stack flags in the description.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/precheck.yml around lines 370 - 377, Update the
commit-status publishing block to use the injected getOctokit directly with
statusToken, removing its redeclaration. Catch createCommitStatus failures when
the token is optional, and build the description from all nine selected stack
flags rather than only selected or “no stacks”.
Evaluation PR. Do not merge.
EVAL_STATUS_TOKENsupport to the precheck workflow.precheck / stackscommit status when the token is available.