Skip to content

feat: add feedback endpoint for bug reports and feature requests (BDMS-897)#717

Merged
jirhiker merged 2 commits into
stagingfrom
BDMS-897
Jun 12, 2026
Merged

feat: add feedback endpoint for bug reports and feature requests (BDMS-897)#717
jirhiker merged 2 commits into
stagingfrom
BDMS-897

Conversation

@jeremyzilar

Copy link
Copy Markdown
Contributor

What this does

Adds POST /feedback, a new authenticated endpoint that accepts a bug report or feature request submitted from the Ocotillo UI and does two things:

  1. Creates a Jira issue in the BDMS project via the Jira API
  2. Posts a Slack notification to a configurable webhook (optional)

Endpoint

POST /feedback
Authorization: Bearer <token>   (any authenticated Ocotillo user)

Bug report payload

{
  "type": "bug",
  "page_url": "https://ocotillo.nmbgmr.nmt.edu/ocotillo/well",
  "reporter_name": "Jane Field",
  "reporter_email": "jane@nmt.edu",
  "browser": "Chrome 125",
  "submitted_at": "2026-06-11T20:00:00Z",
  "what_happened": "The export button does nothing when I click it.",
  "severity": "High"
}

Feature request payload

{
  "type": "feature",
  "page_url": "https://ocotillo.nmbgmr.nmt.edu/ocotillo/well",
  "reporter_name": "Jane Field",
  "problem": "I can't filter wells by aquifer.",
  "who_would_use": "Hydrogeologists running regional studies",
  "what_it_should_do": "Add an aquifer dropdown to the wells filter bar."
}

Response

{
  "jira_key": "BDMS-999",
  "jira_url": "https://nmbgmr.atlassian.net/browse/BDMS-999"
}

What gets created in Jira

  • Bug → Jira issue type Bug, priority mapped from severity (Low/Medium/High), description includes what happened, severity, and context (page, reporter, browser, timestamp)
  • Feature request → Jira issue type Task, priority Medium, description includes the problem, who would use it, and what it should do

What gets posted to Slack

A formatted Slack message with the Jira ticket link, reporter name, page URL, and a summary of the report. The Slack notification is best-effort — if the webhook call fails, the endpoint still returns the Jira key to the UI so the user sees confirmation.

Files changed

File Change
api/feedback.py New router — schema, Jira builder, Slack builder, POST endpoint
core/initializers.py Register the feedback router
.env.example Document the four new env vars

Environment variables

Three are required for the endpoint to work. One is optional.

Variable Required Description
JIRA_BASE_URL Yes e.g. https://nmbgmr.atlassian.net
JIRA_EMAIL Yes Jira account email used for API auth
JIRA_API_TOKEN Yes Jira API token (not your password)
JIRA_DEFAULT_PROJECT No Jira project key, defaults to BDMS
SLACK_FEEDBACK_WEBHOOK_URL No Slack incoming webhook URL — will be provided separately. Leave blank to skip Slack.

These need to be added to the staging and production Secret Manager / environment config before deploying. The SLACK_FEEDBACK_WEBHOOK_URL will be provided outside of this PR.

Auth

The endpoint uses viewer_dependency — any logged-in Ocotillo user can submit feedback. Anonymous submissions are not accepted.

Adds POST /feedback, which accepts a bug report or feature request from
any authenticated user and does two things:

1. Creates a Jira issue in the BDMS project using the Jira API v3
2. Optionally posts a Slack notification if SLACK_FEEDBACK_WEBHOOK_URL is set

Bug reports create a Jira Bug issue with severity and a link to the page
where the report was filed. Feature requests create a Jira Task with the
problem description, intended audience, and expected behaviour.

Slack notification is best-effort — if it fails the HTTP response still
returns the Jira key and URL so the UI can confirm the report was filed.

Three env vars are required (JIRA_BASE_URL, JIRA_EMAIL, JIRA_API_TOKEN).
JIRA_DEFAULT_PROJECT defaults to BDMS. SLACK_FEEDBACK_WEBHOOK_URL is
optional and will be provided separately.
Fetch jira-email, jira-api-token, and slack-feedback-webhook-url from
Secret Manager in all three deploy workflows and render them into the
App Engine config alongside JIRA_BASE_URL / JIRA_DEFAULT_PROJECT repo
vars (with sensible defaults). The deploy service account needs
roles/secretmanager.secretAccessor on these secrets in each project.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jirhiker jirhiker changed the title BDMS-897: Feedback endpoint — bug reports and feature requests feat: add feedback endpoint for bug reports and feature requests (BDMS-897) Jun 12, 2026
@jirhiker jirhiker merged commit 6f840c5 into staging Jun 12, 2026
9 of 10 checks passed
@jirhiker jirhiker deleted the BDMS-897 branch June 12, 2026 21:44
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