Skip to content

Add integrations and prompt inputs for issue notifications#54

Merged
hawkeyexl merged 4 commits intomainfrom
integrations
Feb 26, 2026
Merged

Add integrations and prompt inputs for issue notifications#54
hawkeyexl merged 4 commits intomainfrom
integrations

Conversation

@hawkeyexl
Copy link
Contributor

@hawkeyexl hawkeyexl commented Feb 26, 2026

Summary

  • Adds integrations input: comma-separated list of integrations (doc-sentinel, promptless, dosu, claude, opencode, copilot) to notify in created GitHub issues via a collapsible accordion section
  • Adds prompt input: text passed to integrations and available as $PROMPT in issue body templates
  • The copilot integration auto-assigns the issue to Copilot instead of adding to the accordion
  • Invalid integration names are warned and ignored

Summary by CodeRabbit

  • New Features

    • Workflows now accept configurable integrations and custom prompts when triggered, enabling integration-assisted analysis.
    • Generated issues include integration-provided analysis and the user prompt to guide investigations.
  • Tests

    • Added a test job that exercises integrations and can create issues on failure to surface suggested fixes.

…eatures

- Add 'integrations' and 'prompt' inputs to workflows for better customization.
- Update 'issue_body' description to include new prompt functionality.
- Implement integration handling in the main action logic to notify relevant integrations in issue creation.
- Create a new job in the test workflow to demonstrate integration functionality.
- Update dependencies in package-lock.json for improved stability and performance.
Copilot AI review requested due to automatic review settings February 26, 2026 19:30
@coderabbitai
Copy link

coderabbitai bot commented Feb 26, 2026

Walkthrough

Adds two new inputs, integrations and prompt, exposed in action.yml and workflow_dispatch across workflows; forwards those inputs into the Doc Detective action and uses them during issue creation (integration accordion, $PROMPT) and to conditionally add an assignee for copilot.

Changes

Cohort / File(s) Summary
Workflow Dispatch Inputs
\.github/workflows/local.yml, \.github/workflows/main.yml
Added integrations and prompt workflow_dispatch inputs and forwarded them into the Run Doc Detective step via with mappings.
Test Workflow Job
\.github/workflows/test.yml
Added a "Fail tests with integrations" job (workflow_dispatch gated) that invokes the action with create_issue_on_fail: true, integrations: doc-sentinel,claude, and a prompt; mirrors the existing fail-tests flow.
Action Metadata
action.yml
Added public inputs integrations (comma-separated) and prompt; updated issue_body description to include the $PROMPT placeholder.
Runtime Integration Logic
index.js
Introduced INTEGRATION_MAP, VALID_INTEGRATIONS, parseIntegrations, buildIntegrationsAccordion; reads integrations and prompt inputs, appends integration content and $PROMPT to issue body, converts assignees to a list and adds copilot-swe-agent when copilot is requested; retries issue creation without assignees on 422.

Sequence Diagram(s)

sequenceDiagram
  participant User as "User (workflow_dispatch)"
  participant GH as "GitHub Actions Runner"
  participant Action as "Doc Detective Action\n(index.js)"
  participant Issue as "GitHub Issues API"
  participant Ext as "External Integrations\n(doc-sentinel, claude, copilot)"

  rect rgba(200,200,255,0.5)
  User->>GH: trigger workflow with `integrations` & `prompt`
  GH->>Action: start action with inputs (integrations, prompt, issue_body...)
  end

  rect rgba(200,255,200,0.5)
  Action->>Action: parse `integrations`, build integrationsAccordion
  Action->>Issue: create/update issue body (includes $RESULTS, $PROMPT, integrationsAccordion)
  end

  rect rgba(255,200,200,0.5)
  Action->>Ext: forward prompt/details to requested integrations (if any)
  Ext-->>Action: integration responses/notifications (async)
  end

  Action->>Issue: optionally assign `copilot-swe-agent` when copilot requested
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 I nudged two inputs into the ground,
Prompts and helpers hopping round,
Copilot lends a paw,
Integrations hum and draw,
Doc Detective files each clue I found 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add integrations and prompt inputs for issue notifications' directly and clearly summarizes the main change in the changeset, which is the addition of two new input parameters (integrations and prompt) to enable configurable issue notifications.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch integrations

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds new GitHub Action inputs to optionally notify external “integrations” when creating failure issues, and to pass a configurable prompt into both issue templates and integration triggers.

Changes:

  • Add integrations (comma-separated) and prompt inputs; append an “Integrations” <details> block to created issues.
  • Special-case copilot integration to auto-assign the issue to copilot-swe-agent.
  • Update workflows to expose the new inputs and add a workflow job covering the new integrations behavior; refresh bundled deps (lockfile + dist).

Reviewed changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
package-lock.json Dependency updates / lockfile refresh (incl. Octokit/tooling packages).
index.js Implements parsing/validation of integrations, prompt handling, accordion generation, and Copilot auto-assignment.
dist/index.js Re-bundled build output reflecting source + dependency updates.
action.yml Documents and defines new integrations and prompt inputs; updates issue_body docs for $PROMPT.
.github/workflows/test.yml Adds a new job to exercise “fail + create issue + integrations accordion” behavior.
.github/workflows/main.yml Adds workflow_dispatch inputs/wiring for integrations and prompt.
.github/workflows/local.yml Adds workflow_dispatch inputs/wiring for integrations and prompt.

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (2)
.github/workflows/local.yml (1)

45-48: Keep prompt default aligned with the action input default.

default: '' here overrides the action-level default and makes $PROMPT empty in manual runs unless users set it every time.

Suggested update
       prompt:
         description: prompt
         required: false
-        default: ''
+        default: 'Investigate the causes of the failures reported in this Doc Detective test output and suggest fixes'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/local.yml around lines 45 - 48, The workflow currently
overrides the action input "prompt" by setting prompt.default to an empty
string, which makes $PROMPT empty for manual runs; change the "prompt" input in
the workflow so it does not override the action-level default (remove the
default: '' line) or set prompt.default to the same default value used by the
action input, ensuring the "prompt" input and $PROMPT retain the intended
action-level default.
.github/workflows/main.yml (1)

49-52: Align workflow prompt default with action.yml.

This empty default overrides the action’s built-in prompt default when dispatched via this workflow.

Suggested update
       prompt:
         description: prompt
         required: false
-        default: ''
+        default: 'Investigate the causes of the failures reported in this Doc Detective test output and suggest fixes'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/main.yml around lines 49 - 52, The workflow input 'prompt'
is overriding the action's built-in default; update the workflow's inputs so
'prompt' does not set an empty default (either remove the default key for
'prompt' or match the default value defined in action.yml) to allow the action's
own default to be used; locate the 'prompt' input in the workflow definition
(the prompt: description/required/default block) and remove or change the
default accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/test.yml:
- Around line 48-66: The job fail-tests-with-integrations currently runs on
every pull_request and will create real issues because create_issue_on_fail:
true; restrict execution or issue creation by adding a guard: either add an if
condition on the job (fail-tests-with-integrations) to only run for safe events
(e.g., workflow_dispatch or pull_request actions like opened/reopened) using
github.event_name and github.event.action, or make create_issue_on_fail
conditional so it is false for routine pull_request synces; update references to
create_issue_on_fail, integrations, and the job name when implementing the
conditional to ensure only intended events open issues.

In `@index.js`:
- Around line 198-203: The issue: building the issue body uses
String.prototype.replace which only replaces the first occurrence, so multiple
occurrences of placeholders like $RUN_URL, $RESULTS, or $PROMPT in the template
won't be substituted; fix the assignment that computes the body (starting from
core.getInput("issue_body") and the chained .replace calls) to use replaceAll
for each placeholder substitution (replace "$RUN_URL" with runURL, "$RESULTS"
with the formatted results, and "$PROMPT" with prompt), then append
integrationsAccordion as before so all instances are replaced.
- Around line 205-208: The current logic appends "copilot-swe-agent" to
assigneesList (symbols: assigneesList, integrations) but doesn't handle the case
where that account is not assignable and causes a 422 from GitHub; change the
flow to (1) sanitize inputs by trimming and deduplicating assigneesList, (2)
before calling the issue creation API verify each assignee is assignable (use
the repo assignee check endpoint — e.g. GET
/repos/:owner/:repo/assignees/:assignee or the equivalent octokit method — and
remove any non-assignable users), and (3) additionally wrap the issue creation
call to catch a 422 response and on that error remove the failing assignee(s)
(filter out "copilot-swe-agent" or the returned invalid assignees) and retry
once so a single bad assignee cannot prevent issue creation.

---

Nitpick comments:
In @.github/workflows/local.yml:
- Around line 45-48: The workflow currently overrides the action input "prompt"
by setting prompt.default to an empty string, which makes $PROMPT empty for
manual runs; change the "prompt" input in the workflow so it does not override
the action-level default (remove the default: '' line) or set prompt.default to
the same default value used by the action input, ensuring the "prompt" input and
$PROMPT retain the intended action-level default.

In @.github/workflows/main.yml:
- Around line 49-52: The workflow input 'prompt' is overriding the action's
built-in default; update the workflow's inputs so 'prompt' does not set an empty
default (either remove the default key for 'prompt' or match the default value
defined in action.yml) to allow the action's own default to be used; locate the
'prompt' input in the workflow definition (the prompt:
description/required/default block) and remove or change the default
accordingly.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7cd1f36 and 825c040.

⛔ Files ignored due to path filters (2)
  • dist/index.js is excluded by !**/dist/**
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • .github/workflows/local.yml
  • .github/workflows/main.yml
  • .github/workflows/test.yml
  • action.yml
  • index.js

@promptless
Copy link

promptless bot commented Feb 26, 2026

📝 Documentation updates detected!

New suggestion: Document GitHub Action issue notifications and AI integrations


Tip: Connect Jira, Linear, Confluence, and more in Integrations to enrich suggestion quality 🔗

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@action.yml`:
- Line 86: The example string describing the prompt for integrations contains an
extra trailing parenthesis in the text that makes the sample malformed; edit the
action.yml description where the example shows `@claude <prompt_value>")` (the
line referencing PROMPT / integrations) and remove the stray `)` so the example
reads correctly (e.g., `@claude <prompt_value>"` or better yet remove the stray
quote if needed) to produce a well-formed example in the `The prompt passed to
integrations.` sentence.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 825c040 and 857d780.

📒 Files selected for processing (1)
  • action.yml

hawkeyexl and others added 2 commits February 26, 2026 11:45
…olerance

- Use replaceAll() for placeholder substitution in issue body templates
- Sanitize labels and assignees with trim + filter(Boolean)
- Add deduplication guard for copilot-swe-agent assignee
- Retry issue creation without assignees on 422 validation errors
- Guard fail-tests-with-integrations job to only run on workflow_dispatch
- Remove empty prompt defaults from workflow_dispatch inputs
- Fix typo in action.yml prompt description

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@hawkeyexl
Copy link
Contributor Author

@CodeRabbit review

@coderabbitai
Copy link

coderabbitai bot commented Feb 26, 2026

✅ Actions performed

Review triggered.

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/workflows/local.yml (1)

69-70: Consider propagating other workflow inputs to the action.

The new integrations and prompt inputs are correctly passed to the action. However, many other workflow_dispatch inputs (lines 10-40) like working_directory, input, create_pr_on_change, exit_on_fail, create_issue_on_fail, and issue_body are defined but not forwarded to the action step.

This is a pre-existing pattern, but you may want to align the workflow to actually use all the dispatch inputs for a more useful manual-dispatch experience.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/local.yml around lines 69 - 70, The workflow step forwards
only integrations and prompt to the action; update the action's step to
propagate all defined workflow_dispatch inputs (e.g., working_directory, input,
create_pr_on_change, exit_on_fail, create_issue_on_fail, issue_body, and any
other inputs declared between lines 10-40) by adding them as key/value pairs
like `<input_name>: ${{ github.event.inputs.<input_name> }}` alongside the
existing integrations and prompt entries so the action receives all
manual-dispatch parameters.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/local.yml:
- Around line 69-70: The workflow step forwards only integrations and prompt to
the action; update the action's step to propagate all defined workflow_dispatch
inputs (e.g., working_directory, input, create_pr_on_change, exit_on_fail,
create_issue_on_fail, issue_body, and any other inputs declared between lines
10-40) by adding them as key/value pairs like `<input_name>: ${{
github.event.inputs.<input_name> }}` alongside the existing integrations and
prompt entries so the action receives all manual-dispatch parameters.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 857d780 and 8336da6.

⛔ Files ignored due to path filters (1)
  • dist/index.js is excluded by !**/dist/**
📒 Files selected for processing (5)
  • .github/workflows/local.yml
  • .github/workflows/main.yml
  • .github/workflows/test.yml
  • action.yml
  • index.js
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/main.yml
  • .github/workflows/test.yml

@hawkeyexl hawkeyexl merged commit adac115 into main Feb 26, 2026
8 checks passed
@promptless
Copy link

promptless bot commented Feb 26, 2026

📝 Documentation updates detected!

Updated existing suggestion: Document GitHub Action issue notifications and AI integrations


Tip: Request one-off documentation tasks in the Dashboard under New Task 🚀

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.

2 participants