Skip to content

Modified the GitHub action for the new code review task - #202

Open
Pavel Elizarov (pavelthei) wants to merge 2 commits into
mainfrom
pepe/modify-code-review-github-action
Open

Modified the GitHub action for the new code review task#202
Pavel Elizarov (pavelthei) wants to merge 2 commits into
mainfrom
pepe/modify-code-review-github-action

Conversation

@pavelthei

Copy link
Copy Markdown

No description provided.

@junie-jetbrains

junie-jetbrains Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Address the validation and configuration concerns before merging to ensure the code review task is correctly triggered and the agent receives necessary instructions.

Comments

  • src/github/junie/junie-tasks.ts:85: suggestion const prNumber = context.isPR ? context.entityNumber : undefined; if (!prNumber) { throw new Error("Code review requires a Pull Request number, but none was found in the event context."); } Use context.isPR to ensure prNumber is only retrieved for Pull Requests. entityNumber can also refer to issue numbers, which should not trigger a code review task.
  • src/mcp/mcp-prompts.ts:10: The removal of mcp_github_inline_comment_server prompt removes the mandatory instruction for code reviews. Verify if this is intended or if the instruction has been moved to another part of the task preparation.

Help us improve Junie code review (EAP): Share feedback

Comment thread src/github/junie/junie-tasks.ts Outdated
Comment on lines 84 to 93
const prNumber = context.entityNumber;
if (!prNumber) {
throw new Error("Code review requires a Pull Request number, but none was found in the event context.");
}
junieCLITask.codeReviewTask = {
description: promptText,
diffCommand
diffCommand,
fetchVcsInfo: true,
reviewTarget: remoteRequestReviewTarget(prNumber),
}

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.

Suggested change
const prNumber = context.entityNumber;
if (!prNumber) {
throw new Error("Code review requires a Pull Request number, but none was found in the event context.");
}
junieCLITask.codeReviewTask = {
description: promptText,
diffCommand
diffCommand,
fetchVcsInfo: true,
reviewTarget: remoteRequestReviewTarget(prNumber),
}
const prNumber = context.isPR ? context.entityNumber : undefined;
if (!prNumber) {
throw new Error("Code review requires a Pull Request number, but none was found in the event context.");
}
junieCLITask.codeReviewTask = {
description: promptText,
diffCommand,
fetchVcsInfo: true,
reviewTarget: remoteRequestReviewTarget(prNumber),
}

Use context.isPR to ensure prNumber is only retrieved for Pull Requests. entityNumber can also refer to issue numbers, which should not trigger a code review task.

Comment thread src/mcp/mcp-prompts.ts
Comment on lines 10 to 12
export const MCP_TOOL_PROMPTS = {
mcp_github_checks_server: 'Use get_pr_failed_checks_info to retrieve detailed information about failed CI/CD checks if needed.',
mcp_github_inline_comment_server: 'MANDATORY for code reviews: Use post_inline_review_comment to provide inline code review comments. IMPORTANT: If you are responding to a question in an existing review thread (user tagged you in <user_instruction> in review thread), DO NOT use this tool - your summary will be automatically posted as a reply in that thread.',
youtrack: 'IMPORTANT: Do not post any comments - your summary will be automatically posted by system. And DO NOT update issue status if user did not request it. ALSO: do not look for other issues or any other external information unless explicitly requested by the user.',

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.

The removal of mcp_github_inline_comment_server prompt removes the mandatory instruction for code reviews. Verify if this is intended or if the instruction has been moved to another part of the task preparation.

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