Skip to content

.github: harden codegenie review (key preflight, CLAUDE_API_KEY, config)#2324

Merged
pratikspatil024 merged 2 commits into
developfrom
ppatil/codegenie-verify-key
Jul 24, 2026
Merged

.github: harden codegenie review (key preflight, CLAUDE_API_KEY, config)#2324
pratikspatil024 merged 2 commits into
developfrom
ppatil/codegenie-verify-key

Conversation

@pratikspatil024

Copy link
Copy Markdown
Member

Summary

Follow-up to #2320, which added the initial CodeGenie review workflow. That workflow referenced ANTHROPIC_API_KEY_GITHUB_ACTIONS, which is not provisioned for bor — so triggered reviews failed with a generic config_error. This PR fixes that and adds config.

Validated end-to-end on a throwaway test PR (#2322): with CLAUDE_API_KEY, CodeGenie authenticated and posted a full review + inline comments. With the old/repo-local ANTHROPIC_API_KEY it failed the LLM call (stale/model-restricted key).

Changes:

  • Preflight guard — a first step that fails fast with a clear error (CLAUDE_API_KEY is missing or empty for this repo) instead of a buried config_error.
  • Key — point llm-api-key at the org-wide CLAUDE_API_KEY (resolves for bor; the org-wide ANTHROPIC_API_KEY_GITHUB_ACTIONS Peter referenced is not scoped here).
  • codegenie.toml — skip generated code (gencodec gen_*.go, *.pb.go, mocks, generated CLI docs) and mark consensus-critical zones (consensus, miner, core/vm, params, core/txpool, core/state, core/blockstm) per .claude/rules.

Trigger stays comment-only (codegenie review) as set in #2320 — no auto-review on open/push.

Executed tests

Rollout notes

Not consensus-affecting. CI-only. No coordinated upgrade. Non-blocking review lane — no required status check added. Inert until merged to develop (comment triggers resolve from the default branch).

Follow-up to the initial codegenie workflow (#2320):
- add a preflight step that fails fast with a legible error when the LLM
  key secret is missing, instead of a generic config_error deep in the run
- point llm-api-key at CLAUDE_API_KEY (the org-wide key that resolves for
  bor; ANTHROPIC_API_KEY_GITHUB_ACTIONS is not provisioned here)
- add codegenie.toml: skip generated code (gencodec, protobuf, mocks, CLI
  docs) and mark consensus-critical zones per .claude/rules

Trigger stays comment-only ("codegenie review"); no auto-review on push.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@pratikspatil024
pratikspatil024 marked this pull request as ready for review July 24, 2026 15:36
Copilot AI review requested due to automatic review settings July 24, 2026 15:36

@claude claude 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.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens the on-demand CodeGenie PR review workflow in .github/ by ensuring the correct LLM secret is used for this repo, failing fast when it’s missing, and adding a repository-scoped codegenie.toml to better classify/skip generated code and prioritize consensus-critical paths.

Changes:

  • Add an early workflow preflight step that errors clearly when CLAUDE_API_KEY is missing/empty.
  • Switch CodeGenie to use the org-provisioned CLAUDE_API_KEY secret for llm-api-key.
  • Introduce codegenie.toml with skip rules for generated code and critical-priority classifications for consensus/EVM/state/txpool/hardfork-related directories.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/codegenie-review.yml Adds API-key preflight and updates the action input to use CLAUDE_API_KEY for CodeGenie authentication.
codegenie.toml Adds repository CodeGenie classification rules to skip generated code and prioritize consensus-critical areas.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/codegenie-review.yml Outdated
cffls
cffls previously approved these changes Jul 24, 2026
The rest of bor's workflows pin actions/checkout@v5; align the codegenie
lane (v7 came from the upstream template) for consistency.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 24, 2026 15:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@pratikspatil024
pratikspatil024 merged commit aa4319f into develop Jul 24, 2026
16 checks passed
@pratikspatil024
pratikspatil024 deleted the ppatil/codegenie-verify-key branch July 24, 2026 15:57
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.07%. Comparing base (abb8465) to head (1334d79).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2324      +/-   ##
===========================================
+ Coverage    54.05%   54.07%   +0.02%     
===========================================
  Files          907      907              
  Lines       162012   162012              
===========================================
+ Hits         87578    87612      +34     
+ Misses       69017    68992      -25     
+ Partials      5417     5408       -9     

see 23 files with indirect coverage changes
see 23 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

5 participants