Repository navigation
feat(feedback): anonymous feedback submission via GitHub Issues proxy - #95
Merged
Merged
Conversation
Implements group 2 of the add-anonymous-feedback-reporting OpenSpec
change: a POST /feedback handler accepting type (bug|feature), title,
body, and optional reporter_email/source, that files a labeled GitHub
Issue on sweetrpg/platform via a new feedback package wrapping the
GitHub Issues API (go-github). GitHub failures/timeouts return 502
without retrying. Adds a feedback-specific Redis-backed rate-limit
tier (api-core.go/ratelimit, bumped to v0.3.1) stricter than and
layered on top of the service-wide limiter, scoped to only this
route. Adds title/body length caps and a honeypot + minimum-fill-time
bot-detection check that silently accepts (200, no issue created)
instead of rejecting, so a bot gets no signal. Adds swaggo annotations
and regenerates docs/swagger.{json,yaml,go}.
Adds a secretRef to the api-feedback Secret (produced by an ExternalSecret pulling /sweetrpg/admin/api/feedback from Akeyless, containing GITHUB_FEEDBACK_TOKEN) alongside the existing api-db/ api-misc secretRefs, matching this repo's existing pattern for secret-backed env vars. The ExternalSecret manifest itself (kubernetes/overlays/dev/secrets/ feedback.yaml) still needs to be added by someone with access to that path - this session's sandbox denies all read/write access to any **/secrets path, so kustomization.yaml does not yet list it.
Add Redis cache configuration (REDIS_HOST/REDIS_PORT) to admin-api's development deployment, enabling the feedback endpoint's feedback-tier rate limiter to back against a real cache instance instead of failing closed with 503. Wire the cache auth secret (REDIS_PASS) via ExternalSecret pulling from Akeyless. Resolves sweetrpg/platform#112. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
paulyhedral
force-pushed
the
feat/anonymous-feedback-proxy
branch
from
October 7, 2026 13:36
91cb3f0 to
da77113
Compare
2 of 3 tasks
1 of 2 tasks
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.
Part of sweetrpg/platform#112
Summary
Implements group 2 (
admin-api feedback endpoint) of the OpenSpec changeadd-anonymous-feedback-reporting(seeopenspec/changes/add-anonymous-feedback-reporting/insweetrpg/platformfor proposal/design/spec/tasks).POST /feedbackacceptstype(bug|feature),title,body, optionalreporter_email, optionalsource. Missing/invalid required fields -> 400.sweetrpg/platformvia a newfeedbackpackage wrappinggoogle/go-github, labeledsource:in-app-feedbackplusbug/feature. Optional fields are appended to the issue body only when present.api-core.goto v0.3.1 for theratelimitpackage), mounted only on this route - the service's existing global limiter and all other routes are unaffected.docs/swagger.{json,yaml}anddocs/docs.goregenerated via this repo's documentedswag initinvocation.GITHUB_FEEDBACK_TOKENenv var read the same way this repo reads other secret-backed vars (envFrom.secretRef). Wiredkubernetes/base/deployment.yaml'sapi-feedbacksecretRef to match. TheExternalSecretmanifest itself (kubernetes/overlays/dev/secrets/feedback.yaml, pulling Akeyless path/sweetrpg/admin/api/feedback) still needs to be added by someone with access to that path - this session's sandbox hard-denies all read/write access to any**/secretspath, sokustomization.yamldoes not yet reference it. Content needed:secrets/feedback.yamltokubernetes/overlays/dev/kustomization.yaml'sresourceslist.Env var name for CORS/verification wiring elsewhere:
GITHUB_FEEDBACK_TOKEN.Known follow-up: admin-api had no Redis/cache instance
Before this change,
admin-apihad no Redis-backed anything (no cache, no per-client rate limiting) - the feedback endpoint's dedicated rate-limit tier needed one, socmd/admin-api/main.gonow builds a Redis pool (same pattern asgame-room-api'ssetupRedisPool) that isnilwhenREDIS_HOSTisn't set. With no pool,feedback.RateLimitMiddlewarefails closed - everyPOST /feedbackgets a 503 - rather than running unlimited; this is the correct behavior per the platform's rate-limiting spec, not a bug to fix in this PR. A separate infra task needs to provisionadmin-api's Redis cache viasupport/infrastructure's per-service cache overlay pattern (REDIS_HOST/REDIS_PORTwired into this service's configmap) before/feedbackworks end-to-end in an environment that needs it live.Test plan
go build ./...go vet ./...go test ./...- covers: valid bug/feature submission creates issue with correct labels; missing/invalid type, title, body -> 400; oversized title/body -> 400; honeypot populated -> silent 200/no issue; too-fast submission -> silent 200/no issue; optional fields included in body when present, omitted when absent; GitHub API failure -> 502; feedback rate-limit tier 429s on its own budget (miniredis-backed) while an unrelated route stays unaffectedgolangci-lint run ./...- 0 issueskustomize build kubernetes/overlays/devstill succeedsExternalSecretand Redis cache land (manual submission creating a real labeled issue) - out of this PR's scope