Skip to content

GitHub Issues Intake - #477

Closed
fkukuck wants to merge 4 commits into
fabro-sh:mainfrom
fkukuck:feat/github-issues-intake
Closed

GitHub Issues Intake#477
fkukuck wants to merge 4 commits into
fabro-sh:mainfrom
fkukuck:feat/github-issues-intake

Conversation

@fkukuck

@fkukuck fkukuck commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

PR Summary: GitHub Issue Intake

Adds github_issue automation triggers. Labeling a matching GitHub issue now creates and starts an automation run, passes issue metadata as inputs, records the run's issue source, and optionally comments back on the issue.

Highlights

  • New AutomationTrigger::GithubIssue with trigger_label, optional issue_label, and comment.
  • GitHub issues.labeled starts matching automations; PR-shaped issue events are ignored.
  • issues.unlabeled closes the trigger cycle so re-labeling can start another run.
  • Delivery IDs and open-cycle markers prevent duplicate runs.
  • Webhooks acknowledge quickly; materialization/start happens in the background.
  • Shared automation_runner path now handles API, scheduled, and GitHub issue-triggered runs.
  • Runs expose RunSourceContext::GithubIssue and issue links in API/web projections.
  • Workflows receive issue inputs like github_issue_url, github_issue_title, github_issue_body, github_repository, and github_delivery_id.

Surface Area

  • Server: webhook parsing/dispatch, trigger matching, dedupe, comments, source context.
  • Store: persisted trigger run records and open-cycle markers.
  • API/client: OpenAPI, Rust replacements/tests, generated TypeScript models.
  • Web: automation form trigger controls and GitHub issue source links in run UI.
  • Docs: GitHub integration section, API nav, changelog entry.

Tests

  • Server coverage for label matching, PR filtering, dedupe, relabel behavior, comments, and prompt webhook ack.
  • Store coverage for delivery markers, open cycles, close behavior, and encoded paths.
  • API/type/web tests updated for github_issue triggers and GitHub issue run source context.

fkukuck added 4 commits June 8, 2026 11:49
Adds automation-based GitHub issue intake: trigger model, run source context, trigger-cycle persistence, webhook dispatch, issue comments, OpenAPI/client updates, and web UI support.

Verification:

- cargo +nightly-2026-04-14 fmt --all

- bun test app/routes/automations-new.test.tsx app/routes/runs.test.tsx

- bun run typecheck

- cargo nextest run -p fabro-automation -p fabro-types -p fabro-store -p fabro-github -p fabro-server -p fabro-api: fails on pre-existing fabro-server server::tests::get_graph_returns_svg

- bun run test: fails on app/routes/run-detail.test.ts when run in full suite; test passes standalone
Add developer-focused documentation for GitHub issue intake automations, including trigger setup, injected issue inputs, local workflow development, and troubleshooting. Link the new guide from the GitHub integration docs, surface automation/webhook API pages in navigation, and add a changelog entry for the feature.\n\nContext:\n- Advanced docs and changelog skill watermarks after processing this branch.
@fkukuck

fkukuck commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

#474 now limited the use of templating vars. We should discuss on how to proceed. Should we populate env vars instead?

@swerner

swerner commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

@fkukuck I browsed through this PR, but I'm not exactly sure where you'd be using vars or env. In the [run.inputs] block? Do you have any examples?

We're really interested in learning about the use cases to make sure we have everything covered that should allow interpolation. Once this track of work is finished, for most things you'll be able to select from env vars inputs and secrets and there should be consistent handling across the fields that support them.

@fkukuck

fkukuck commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Well the solution was a little cumbersome, but worked. It was a node in workflow.fabro:

    intake [
        label="Intake",
        shape=parallelogram,
        script="mkdir -p artifacts/intake/raw && \
cat > artifacts/intake/raw/github_issue_title.txt <<'FABRO_GITHUB_ISSUE_TITLE_EOF'
{{ inputs.github_issue_title }}
FABRO_GITHUB_ISSUE_TITLE_EOF
cat > artifacts/intake/raw/github_issue_url.txt <<'FABRO_GITHUB_ISSUE_URL_EOF'
{{ inputs.github_issue_url }}
FABRO_GITHUB_ISSUE_URL_EOF
cat > artifacts/intake/raw/github_issue_number.txt <<'FABRO_GITHUB_ISSUE_NUMBER_EOF'
{{ inputs.github_issue_number }}
FABRO_GITHUB_ISSUE_NUMBER_EOF
cat > artifacts/intake/raw/github_issue_author.txt <<'FABRO_GITHUB_ISSUE_AUTHOR_EOF'
{{ inputs.github_issue_author }}
FABRO_GITHUB_ISSUE_AUTHOR_EOF
cat > artifacts/intake/raw/github_repository.txt <<'FABRO_GITHUB_REPOSITORY_EOF'
{{ inputs.github_repository }}
FABRO_GITHUB_REPOSITORY_EOF
cat > artifacts/intake/raw/github_issue_body.txt <<'FABRO_GITHUB_ISSUE_BODY_EOF'
{{ inputs.github_issue_body }}
FABRO_GITHUB_ISSUE_BODY_EOF
FABRO_GITHUB_ISSUE_TITLE_FILE=artifacts/intake/raw/github_issue_title.txt \
FABRO_GITHUB_ISSUE_URL_FILE=artifacts/intake/raw/github_issue_url.txt \
FABRO_GITHUB_ISSUE_NUMBER_FILE=artifacts/intake/raw/github_issue_number.txt \
FABRO_GITHUB_ISSUE_AUTHOR_FILE=artifacts/intake/raw/github_issue_author.txt \
FABRO_GITHUB_REPOSITORY_FILE=artifacts/intake/raw/github_repository.txt \
FABRO_GITHUB_ISSUE_BODY_FILE=artifacts/intake/raw/github_issue_body.txt \
.fabro/workflows/software_factory/scripts/intake_markdown.sh"
    ]

and the script would make use of these env variables. But probably we need a better solution

@brynary

brynary commented Jun 29, 2026

Copy link
Copy Markdown
Member

Closing in favor of #519 to keep the PR list tidy.

@brynary brynary closed this Jun 29, 2026
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.

3 participants