feat(api): issues endpoint, readiness probe, Jira webhook (Phase 4 — T4.1–T4.3) - #4
Open
canonical-muhammadbassiony wants to merge 1 commit into
Open
Conversation
…ebhook T4.1: POST /api/v1/issues runs orchestrator dry-run and creates GitHub issue T4.1: IssueRequest accepts doc_id, github_repo, chunk_size, page_refresh, model, figma_url T4.1: github.CreateIssue updated to also return issue number (string, int, error) T4.2: GET /api/v1/health/ready checks credentials file, GitHub token, gh CLI T4.2: returns 503 with missing map if anything is not ready T4.3: POST /api/v1/webhooks/jira validates secret, extracts doc_id, fires workflow async T4.3: internal/jira/payload.go WebhookPayload + ExtractDocID T4.3: BAUER_JIRA_WEBHOOK_SECRET and BAUER_JIRA_DOC_FIELD env vars documented
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds three new API endpoints completing Phase 4 of spec 001.
Tasks Implemented
POST /api/v1/issues: Runs orchestrator in dry-run mode (extraction + prompt only, no Copilot), formats result as markdown issue body categorising suggestions, creates GitHub issue via REST API, returns{ issue_url, issue_number }.GET /api/v1/health/ready: K8s readiness probe on public mux (no auth). Checks credentials file readable + GitHub token set +ghCLI in PATH. Returns 503 withmissingmap if any check fails.POST /api/v1/webhooks/jira: Validates shared secret with constant-time comparison (crypto/hmac.Equal), parses Jira payload, extracts doc ID from configurable custom field, fires full workflow in goroutine, responds 202 Accepted immediately.Security
Files Changed
cmd/app/v1/issues.go— new:IssuesHandler,formatIssueBodycmd/app/v1/api.go—ReadinessHandlercmd/app/v1/jira.go— new:JiraWebhookHandlercmd/app/v1/helpers.go— new: sharedhttpError,firstNonEmpty,firstNonZerointernal/github/issue.go—CreateIssuenow returns(string, int, error)internal/jira/payload.go— new:WebhookPayload,ExtractDocIDcmd/app/main.go— route registration.env—BAUER_JIRA_WEBHOOK_SECRET,BAUER_JIRA_DOC_FIELDdocsHow to Review
git diff feat/phase-3-api-foundation..feat/phase-4-api-endpoints -- .Part of the Bauer v2 stacked PR series (Branch 10 of 12).