Skip to content

PRD 4173 M3 rework: YouTrack driver in line with the reviewed PRD - #10

Merged
MirceaTufanDev merged 11 commits into
prd/ws-2from
agent/issue-9
Nov 11, 2026
Merged

MirceaTufanDev merged 11 commits into
prd/ws-2from
agent/issue-9

Conversation

@mirceatufan-uzi

@mirceatufan-uzi mirceatufan-uzi commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Brings the YouTrack issue tracker driver from milestone M3 in line with the reviewed PRD. The driver now answers only to the one repo project it is bound to, never derives a comment number from a comment id, and resolves the eligibility tag strictly by its stored id. Other tags resolve only to tags the connection's account owns. Operators get a separate issue tracker allowlist value in the Helm chart and docker-compose.

Size: 50 files

Category Added Deleted
Code +1,256 −215
Tests +1,061 −95
Docs +91 −7
Config +308 −1
Total +2,716 −318

What changed

  • Every YouTrack issue-side call refuses a project id other than the repo's bound one, before any request, with ErrProjectMismatch.
  • CreateIssueNote returns note ID 0 on YouTrack; no number is derived from a comment id.
  • The eligibility label resolves to its stored tag id for reads, writes and filters, whoever owns the tag.
  • Other label names resolve only to tags owned by the connection's account; a missing tag is created there with the eligibility tag's sharing settings.
  • New ListTags operation and pure functions that report whether the connection's account can apply a tag and whether anyone else can.

Label name to tag id

flowchart LR
  n1["Label name"] --> n2["Equals eligibility name"]
  n2["Equals eligibility name"] -->|"yes"| n3["Stored eligibility tag id"]
  n2["Equals eligibility name"] -->|"no"| n4["Account-owned tag with that name"]
  n4["Account-owned tag with that name"] -->|"missing, on write"| n5["Create account tag (writes only)"]
Loading

Verification

Reported by the agent at 8a8acbe:

  • passed: task check:api (at 3f856c8, after the last code change; later commits change comments and docs only)
  • passed: cd api && go test -race -count=1 ./internal/issuetracker/... ./internal/issuetrackersvc/... ./internal/config/...
  • passed: task test:issue-tracker-forge-fake-contract
  • passed: task test:forge-fake
  • passed: task test:e2e-lib
  • passed: scripts/assert-issue-tracker-allowlist-render.sh (chart test)
  • passed: task render:openshift-check
  • passed: scripts/golangci-lint.sh v2.15.0 run ./internal/issuetracker/... ./internal/issuetrackersvc/...
  • passed: task lint:shell
  • passed: task lint:yaml
  • passed: task check:changelog-entry
  • passed: task check-docs:web
  • passed: task check:token-literals
  • passed: task scan:secrets (canaries DETECTED: api/internal/config/gitleaks_canary_test.go, scripts/gitleaks-canary.txt)

Scope and review notes

  • Changed: ProjectGuard and SameNameTagUsesEligibilityTag contract cases were added; the same-name case runs on YouTrack only, because forge labels have no owners, and the forge subjects check the guard throu…
  • Deferred: The real YouTrack recording is not verified in this run; the sharing-settings parse was tested against an anonymised anonymous read of a public YouTrack instance, and a live check is left for M6.
  • Deferred: The full E2E phase suite was not run; task test:e2e-lib and task test:forge-fake passed.
  • Review: api/internal/issuetracker/youtrack_labels.go resolveTagIDs: the one place a label name becomes a tag id, and the rule that the eligibility name never resolves to another owner's tag.
  • Review: api/internal/issuetracker/tag.go AccountCanApply and OthersCanApply: the link-time readings, which fail closed when YouTrack omits a group's user count.

Describes 8a8acbe against prd/ws-2.

Related to #9.

Closes #9

Internally reviewed by the repository's own agents, not uzi's built-in reviewer.


Opened by uzi from agent/issue-9. A human reviews and merges; uzi never merges.

uzi-agent and others added 11 commits November 11, 2026 14:39
…(D10, D14)

Project guard on every IssueTracker method (ErrProjectMismatch before any
request), CreateIssueNote returns ID 0, Driver.ListTags with owner and
sharing settings, AccountCanApply/OthersCanApply, the eligibility tag
resolved by stored id and other labels only to account-owned tags, the
fake with owned shared tags, and the ProjectGuard and same-name tag
contract cases (forge-fake answers 404 for unknown projects in contract
mode only).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… check (PRD vtmocanu#4173 S3)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…g; CreateIssue resolves tags first

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ry; tighten the render check

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…orded and ticked, changelog

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ue Decision Log facts, trim the changelog

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o the eligibility tag

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ues; record it for M4

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a stale fake comment

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…YouTrack

A second recording, anonymised like the first, with the shapes the
public one lacks: usersCount, an all-users group in the use settings, a
tag only its owner can apply and a tag only its owner can see. The test
runs AccountCanApply and OthersCanApply on each.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@MirceaTufanDev
MirceaTufanDev merged commit 6e0b425 into prd/ws-2 Nov 11, 2026
21 of 24 checks passed
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.

PRD 4173 M3 rework: YouTrack driver in line with the reviewed PRD

2 participants