Skip to content

feat: implement opt out flow with api endpoint, web page and exclusion filters (fixes #23) - #57

Closed
evandroribeiro94 wants to merge 1 commit into
devodii:mainfrom
evandroribeiro94:feat/issue-23-opt-out
Closed

evandroribeiro94 wants to merge 1 commit into
devodii:mainfrom
evandroribeiro94:feat/issue-23-opt-out

Conversation

@evandroribeiro94

Copy link
Copy Markdown

Description

Closes #23.

Implements the complete opt-out workflow allowing project owners and builders to remove their projects or handles from the HackProof index:

  1. Opt-Out Page (apps/web/src/pages/opt-out.tsx):

    • Registered at route /opt-out in App.tsx.
    • Automatically prefills project_id when navigating from links (/opt-out?project_id=...).
    • Collects GitHub handle and optional notes.
    • Displays clear notification: "We honor opt outs within 24h."
    • Includes cross-links on /project/* header and site footer.
  2. API Endpoint (POST /api/opt-out):

    • Files a tracked GitHub issue on the repository using the fixed template.
    • Uses dedicated token setting HACKPROOF_OPT_OUT_GITHUB_TOKEN (or OPT_OUT_GITHUB_TOKEN / fallback).
    • Labels the issue with opt-out for automated triage.
  3. Hackathon Model Configuration (apps/api/src/hackproof/hackathon.py):

    • Adds hidden: list[str] = [] field to Hackathon Pydantic model.
    • Normalizes identifiers via hidden_ids() supporting both repo:owner/name, owner/name, and account IDs (acct:G...).
  4. Exclusion Across the Entire Surface:

    • API (queries.py & routes.py):
      • PROJECTS_SQL, CONTRACTS_SQL, WASM_SQL, FAILED_SQL: filtered via parameter $10/$8.
      • STATS_SQL, INTEGRATIONS_SQL, COUNTRIES_SQL: aggregate metrics exclude hidden projects and contributors.
      • Direct endpoints GET /api/projects/{id} and GET /api/builders/{address} return 404 Not Found for hidden entities.
      • fetch_links, fetch_contributors, and fetch_integration_uses return empty for hidden projects.
    • Export (export/build.py & export/files.py):
      • Hidden projects and their builder handles are filtered out prior to querying related entities.
      • Never appear in HackathonExport JSON or individual project YAML files.
    • Chat Tools (chat/tools.py & chat/briefs.py):
      • get_project and get_builder return not found error.
      • query_projects, query_contracts, query_wasm, query_failed, and summarize_projects never include hidden project IDs.

Verification

  • pytest apps/api/tests/test_opt_out.py: 7 passed in 4.95s
    • test_hackathon_hidden_defaults_and_normalizes: PASSED
    • test_is_hidden_detection: PASSED
    • test_opt_out_endpoint_validates_input: PASSED
    • test_opt_out_endpoint_creates_github_issue: PASSED
    • test_hidden_id_never_appears_in_api_response: PASSED
    • test_hidden_id_never_appears_in_export: PASSED
    • test_hidden_id_never_appears_in_chat_tools: PASSED
  • ruff check src/ tests/test_opt_out.py: All checks passed! (0 errors)
  • pnpm build (tsc -b && vite build): Built in 3.29s (0 errors)
  • pnpm oxlint: 0 errors
  • pnpm prettier: All modified files formatted

@vercel

vercel Bot commented Oct 31, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Payroutes OSS Team on Vercel.

A member of the Team first needs to authorize it.

@devodii devodii closed this Nov 1, 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.

Opt out flow

2 participants