← Back to Pull requests

Assign partner tags on API application approval #4630

Closed
unknown closed this pull request without merging on Oct 07, 2026 22:27 UTC
View on GitHub
unknown unknown commented on Oct 06, 2026 18:52 UTC
Author

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

Summary by CodeRabbit

New Features
Partner tags can be assigned when approving program applications by tag ID or name. Existing tags are retained, and IDs take precedence when both are provided.
Tag names are matched without regard to capitalization, and duplicate tags are added only once.
Added an option to copy a partner tag’s ID from the tag menu.
Bug Fixes
Invalid tags prevent application approval and leave the application pending.
* Bounty and campaign tag updates now validate supplied partner tags consistently.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---

How to test

1. From the repo root, run pnpm dev.
2. Sign in to the acme workspace at http://localhost:8888/acme. Open API Keys at http://localhost:8888/acme/settings/tokens. If you do not already have a workspace key, click Create API key and copy it. This call needs a workspace on the Business plan or above. A lower plan returns Unauthorized: Need higher plan.
3. Open Applications at http://localhost:8888/acme/program/partners/applications and stay on Pending. You need two pending partners. Open the first one. In the Program application sheet, under Tags, click Manage. Type a new name and click Create new tag "…". Click Cancel, not Save, so that partner is not tagged yet.
4. In the browser Network tab, copy the ids you will send:
- From GET /api/program-applications, copy partner.id for both pending partners.
- From GET /api/partners/tags, copy the id of the tag you just created. It starts with ptag_.
5. Send a tag that does not exist. This must not approve the partner.

   curl -X POST http://localhost:8888/api/program-applications/approve \
     -H "Authorization: Bearer <api key>" \
     -H "content-type: application/json" \
     -d '{"partnerId":"<first partner id>","tagIds":["ptag_invalid"]}'
   

- The response is 400, with the message Invalid partner tag IDs detected: ptag_invalid.
- That partner is still on Pending.
- Open the sheet again. Tags still shows Add tag.
6. Approve that same partner and send the real tag id twice.

   curl -X POST http://localhost:8888/api/program-applications/approve \
     -H "Authorization: Bearer <api key>" \
     -H "content-type: application/json" \
     -d '{"partnerId":"<first partner id>","tagIds":["<tag id>","<tag id>"]}'
   

- The response is 200 and the body is { "partnerId": "<first partner id>" }.
- The partner is gone from Pending and listed on Approved.
- Open them from All Partners at http://localhost:8888/acme/program/partners. Tags shows the new tag once.
7. Approve the second partner from the app. Open their Program application sheet and click Approve. In Approve application, click Approve.
- They move to Approved.
- Tags does not show the tag from step 3.
- Approve application still only asks you to Assign to group.

Diff: 393 lines (+294 / -99) across 4 files Reviewer: pepeladeira Review duration: 1654m
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 393 lines diff across 4 files
0.48
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.358
Shallow Review Depth shallow_review_depth
0.289
Ai Authored ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #4630"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 48.1% (MEDIUM) · Higher = larger blast radius
48.1%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 19% · Safe to merge
19%
Repository