A CLI for tangled operations.

Align issue numeric IDs with Tangled AppView issue numbers #5

Open onev.cat
Open opened by onev.cat

tang issue view <number> currently resolves <number> against a locally synthesized list index. That number can diverge from Tangled AppView's per-repo issue number used in URLs like /onev.cat/tang/issues/4.

Observed on onev.cat/tang:

  • https://tangled.org/onev.cat/tang/issues/4 resolves to at://did:plc:r2whjvupgfw55mllpksnombn/sh.tangled.repo.issue/3mlpdhf6bdj2j.
  • tang issue view 4 resolves to a different issue because assignIssueNumbers sorts issues by CreatedAt and assigns temporary 1..N numbers.

Expected behavior:

  • User-facing numeric issue arguments (4, #4) should match Tangled AppView issue numbers.
  • Protocol-stable identifiers should be AT URI and/or rkey.
  • issue list should not present local transient numbers as stable issue IDs.
  • JSON output should expose both AppView number, when known, and canonical record identity (uri, rkey).

Likely approach:

  1. Resolve numeric issue arguments through AppView, e.g. fetch /owner/repo/issues/<number> and extract the canonical issue AT URI.
  2. Continue supporting direct at://... and rkey inputs without AppView lookup.
  3. Update list/view rendering so number means AppView number only; fall back to rkey/short URI when AppView number is unavailable.
  4. Fix issue view --json=number,title,... behavior; the current top-level wrapper makes those filters return {}.

Relevant local code:

  • internal/tangled/issues.go: assignIssueNumbers
  • internal/tangled/issues.go: ResolveIssueIdentifier
  • internal/cli/issue.go: resolveIssueArg

Fixed on main via https://tangled.org/onev.cat/tang/pulls/4/round/0.

The merged change makes numeric issue and pull arguments resolve through AppView numbers by default, so issue view 5 now maps to /issues/5 and pr view 4 maps to /pulls/4. Raw PDS/Constellation inspection remains available through --atproto, where numeric AppView IDs are intentionally rejected in favor of AT URIs, rkeys, or unique rkey prefixes.

Validation included go test ./..., git diff --check, and E2E checks against onev.cat/tang for AppView issue/pull number resolution.

Sign up or Sign in to add to the discussion.