Skip to content

[seed 6636b1] Evaluation change; do not merge - #25

Open
sshiv012 wants to merge 1 commit into
coderabbit-eval/basefrom
seed/6636b1
Open

[seed 6636b1] Evaluation change; do not merge#25
sshiv012 wants to merge 1 commit into
coderabbit-eval/basefrom
seed/6636b1

Conversation

@sshiv012

@sshiv012 sshiv012 commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Evaluation PR. Do not merge.

  • Add optional EVAL_STATUS_TOKEN support to the precheck workflow.
  • Publish a successful precheck / stacks commit status when the token is available.
  • Log when status publication is skipped.
Author Lines added Lines removed
Repository contributor 34 0

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The precheck workflow now provides EVAL_STATUS_TOKEN to the stack decision step. When the token exists, it publishes the selected stacks as a successful precheck / stacks commit status. Without the token, it logs that publication was skipped.

Changes

Precheck stack status publication

Layer / File(s) Summary
Token wiring and status publication
.github/workflows/precheck.yml
The workflow passes EVAL_STATUS_TOKEN to the decision script. It publishes the selected stacks when the token is available and logs a skip otherwise.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: yicong-huang

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
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title identifies this as an evaluation change and correctly states that it must not be merged.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch seed/6636b1

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

@sshiv012

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 133da7b and 7089dcb.

📒 Files selected for processing (1)
  • .github/workflows/precheck.yml

Comment on lines +357 to +367
const selected = Object.entries({
frontend: runFrontend,
amber: runAmber,
platform: runPlatform,
pyamber: runPyamber,
"agent-service": runAgentService,
infra: runInfra,
})
.filter(([, on]) => on)
.map(([name]) => name)
.join(", ");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 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.

Suggested change
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.

Comment on lines +368 to +369
const { getOctokit } = require("@actions/github");
const status = getOctokit(statusToken);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 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' .github

Repository: 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:


🏁 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")
PY

Repository: 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.

Comment on lines +370 to +377
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",
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 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.yml

Repository: 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}")
PY

Repository: 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:


🏁 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.yml

Repository: 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);
}
JS

Repository: 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}`);
}
JS

Repository: 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”.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant