Fix "Fill PR description" workflow failure when OPENAI_API_KEY is missing - #3
Fix "Fill PR description" workflow failure when OPENAI_API_KEY is missing#3orelkrylatiy wants to merge 4 commits into
Conversation
d194a16 to
927d42a
Compare
| className?: string; | ||
| } | ||
|
|
||
| export const ActionCard = ({ title, description }: Props) => { |
There was a problem hiding this comment.
🚫 Blocker — className declared but never applied
className is in the Props interface but the destructuring on this line only picks title and description, so passing className has no effect on the rendered output.
Either forward it:
export const ActionCard = ({ title, description, className }: Props) => {
return <div className={cx(styles.card, className)}>or remove it from the interface.
| export const ActionCard = ({ title, description }: Props) => { | ||
| return ( | ||
| <div className={styles.card}> | ||
| <Logo /> |
There was a problem hiding this comment.
🚫 Blocker — <Logo> called without required src prop
Logo's src: string is required (not optional), so <Logo /> is a TypeScript error and the rendered <img> has no source. Every ActionCard will show a broken image.
Pass a meaningful image path, or make src optional in Logo with a fallback:
// Option A: pass actual src
<Logo src={iconSrc} />
// Option B: make src optional in Logo
src?: string;
// then: src={src || ''}| getPullRequestDiff(), | ||
| readOptionalFile("docs/review/code-review-guide.md"), | ||
| readOptionalFile(".github/copilot-instructions.md"), | ||
| readOptionalFile('docs/review/code-review-guide.md'), |
There was a problem hiding this comment.
🚫 Blocker — Wrong path for code-review guide
docs/review/code-review-guide.md does not exist in this repo. readOptionalFile silently returns an empty string on a missing path (the catch block swallows the error), so every generated PR description is built with "No review guide found." as context.
The file was added to .ai/code-review-guide.md in this same PR. Fix:
readOptionalFile('.ai/code-review-guide.md'),| @@ -0,0 +1 @@ | |||
| {"fileNames":[],"fileInfos":[],"root":[],"version":"6.0.3"} No newline at end of file | |||
There was a problem hiding this comment.
💡 Suggestion — Remove compiled artifact from git
tsconfig.tsbuildinfo is a TypeScript incremental build cache generated locally by tsc --build. It should not be committed — it contains machine-specific paths and will produce a spurious diff on every developer machine.
Add to .gitignore:
*.tsbuildinfo
Then remove the file from tracking:
git rm --cached tsconfig.tsbuildinfo| @@ -1,2 +1 @@ | |||
| npm run test | |||
| npx lint-staged No newline at end of file | |||
There was a problem hiding this comment.
💡 Suggestion — Test step removed from pre-commit hook
The hook now only runs lint-staged, dropping the test gate. AGENTS.md (added in this same PR) explicitly documents npm run test as a required pre-commit step and lists it in the Git workflow section.
The hook and the docs are inconsistent from the moment this is merged. If removing tests was intentional (e.g., to speed up commits), either update AGENTS.md to reflect this, or scope Vitest to only changed files via lint-staged:
"*.{ts,tsx}": ["vitest related --run"]| environment: 'jsdom', | ||
| globals: true, | ||
| setupFiles: "", | ||
| setupFiles: '', |
There was a problem hiding this comment.
💡 Suggestion — setupFiles: '' leaves test setup unwired
An empty string means Vitest loads nothing. src/shared/config/tests/setupTests.ts (which imports @testing-library/jest-dom) is never executed, so matchers like toBeInTheDocument() will throw at runtime.
Fix:
setupFiles: ['src/shared/config/tests/setupTests.ts'],Or remove setupFiles entirely and add the import to a dedicated setup entry instead.
Review SummaryThe PR description says it's a one-liner workflow fix ( Blockers (must fix before merge):
Suggestions:
Note on PR scope: The checklist item "I reviewed my own diff before requesting review" is unchecked, and the PR description only describes the workflow change — a reviewer approaching this PR cold has no stated intent for the other 55 files. Worth a self-review pass and description update before merge. |
What was done
80551979332and identified the failing point in.github/scripts/update-pr-description.mjs..github/workflows/ai-pr-description.ymlto run the “Generate and update PR description” step only whensecrets.OPENAI_API_KEYis set:if: ${{ secrets.OPENAI_API_KEY != '' }}Why
OPENAI_API_KEYwas not configured, and the script throws an error when it is missing.How to check
AI PR Descriptionworkflow in an environment withoutOPENAI_API_KEYand confirm the generation step is skipped (job does not fail on missing secret).OPENAI_API_KEYconfigured and confirm the generation step executes normally.Screenshots / Demo
Not applicable.
Checklist
Code Review Principles
For reviewer
For author
Review comment tags
Main tags
qsAdditional tags
praisenotenitthought