labels: PR list and cross-repo search pass labels= by name — org-label filters silently no-op on Gitea (follow-up to #12) #64

Closed
opened 2026-07-14 21:33:26 +00:00 by hexajon · 0 comments
hexajon commented 2026-07-14 21:33:26 +00:00 (Migrated from codeberg.org)

#12 fixed org-label name resolution and switched the issue-list labels= filter to numeric IDs, because Gitea's per-repo by-name filter is org-label-blind and fails open (returns the full unfiltered list). Two label-filter paths still pass raw NAMES upstream (found during #12's adversarial review, explicitly scoped out by the builder):

  • internal/service/pr.go:94ListPRs passes opts.Labels as names to the per-repo pulls list endpoint. Filtering PRs by an org-label name on Gitea silently returns ALL PRs unfiltered.
  • internal/service/issue_search.go:19 — cross-repo SearchIssues passes label names. (Upstream uses the name-global GetLabelIDsByNames here, so behavior differs from the per-repo case — verify what org labels do before choosing IDs vs client-side filtering.)

Acceptance

  • PR list filtered by an org-label name returns the correctly filtered set against Gitea (IDs or client-side filtering — mirror #12's approach where it fits).
  • Cross-repo search behavior with org-label names verified and documented; fixed if it exhibits the same fail-open.
  • Hermetic tests for both paths; existing name-filter behavior for repo labels regression-pinned.
  • docs/COMPAT.md row updated if the Forgejo/Gitea divergence applies to these endpoints too.

Refs #12.

#12 fixed org-label name resolution and switched the **issue-list** `labels=` filter to numeric IDs, because Gitea's per-repo by-name filter is org-label-blind and fails open (returns the full unfiltered list). Two label-filter paths still pass raw NAMES upstream (found during #12's adversarial review, explicitly scoped out by the builder): - `internal/service/pr.go:94` — `ListPRs` passes `opts.Labels` as names to the per-repo pulls list endpoint. Filtering PRs by an org-label name on Gitea silently returns ALL PRs unfiltered. - `internal/service/issue_search.go:19` — cross-repo `SearchIssues` passes label names. (Upstream uses the name-global `GetLabelIDsByNames` here, so behavior differs from the per-repo case — verify what org labels do before choosing IDs vs client-side filtering.) ## Acceptance - PR list filtered by an org-label name returns the correctly filtered set against Gitea (IDs or client-side filtering — mirror #12's approach where it fits). - Cross-repo search behavior with org-label names verified and documented; fixed if it exhibits the same fail-open. - Hermetic tests for both paths; existing name-filter behavior for repo labels regression-pinned. - docs/COMPAT.md row updated if the Forgejo/Gitea divergence applies to these endpoints too. Refs #12.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sixfold-space/madtea#64
No description provided.