Skip to content

πŸ› fix: copy the selected tracker issue or PR link - #16017

Merged
hivecommons-hive[bot] merged 3 commits into
v5from
fix/tracker-copy-link
Oct 31, 2026
Merged

hivecommons-hive[bot] merged 3 commits into
v5from
fix/tracker-copy-link

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Summary

  • Give single covering PR references an explicit menu target instead of inheriting the parent issue row.
  • Reuse tracker row lookup and linked PR adaptation; preserve canonical cross-repository PR identity.
  • Copy only URLs matching each selected item kind and number; fail visibly rather than copy a wrong parent or partial selection.
  • Add regression coverage for root issues/PRs, single linked and nested PRs, cross-repository identity, bulk copy, and clipboard failures.

Validation

  • Read-only code review completed; findings fixed before commit.
  • Dashboard generated with the existing go generator.
  • Changed Go files checked with gofmt -l.
  • No local tests/builds/lint/docs guards run: CI is the sole verdict per AGENTS.md.

Source merge only; no live deployment.

Signed-off-by: Andy Anderson <andy@clubanderson.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 31, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 31, 2026
@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#15890 πŸ› dashboard: point operator-reference help marks at the section sub-pages same files src/pkg/dashboard/static/index.html
#16020 ✨ feature: add opt-in Matrix Rain and Cascade display same files src/pkg/dashboard/static/index.html
#16011 πŸ› fix: explain human requirements and optional tracker actions CONFLICT src/pkg/dashboard/static-src/js/tracker-row-layout.js
src/pkg/dashboard/static/index.html
#16012 πŸ› fix: offer Close issue on every open tracker issue same files src/pkg/dashboard/stage_tracker_row_actions_test.go
src/pkg/dashboard/static-src/js/tracker-actions.js
src/pkg/dashboard/static-src/js/tracker-row-layout.js
src/pkg/dashboard/static/index.html
#16016 πŸ› fix(dashboard): read a registered contributor's PR as their clanker in the Activity Monitor same files src/pkg/dashboard/stage_tracker_ui_rows_test.go
src/pkg/dashboard/static/index.html

Signed-off-by: Andy Anderson <andy@clubanderson.com>
@hivecommons-hive

hivecommons-hive Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Hive status β€” updated in place; edits do not notify. Full history is in the Activity Monitor.

@clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Failing checks:

  • test (dashboard 2/4)
  • test (dashboard shuffle 1/3)

Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path.

Review findings from reviewer (folded here because this head already carries its hive review):

Read the change against the tree at merge-base f2533c5 and traced the key plumbing; this looks correct to me.

  • Target resolution is self-consistent. stageTrackerMenuTargets (static-src/js/tracker-actions.js:780-783) now takes data-ham-target-key from the single-covering-PR cell, and stageTrackerItemsForKeys β†’ stageTrackerItemByKey (tracker-actions.js:159-172) resolves that key by rebuilding the nested item with the same stageTrackerLinkedPRItem, so the URL-derived repo used to mint the key at tracker-row-layout.js:485-486 is the same one used to look it up. All three callers of stageTrackerMenuTargets (contextmenu :793, Shift+F10/ContextMenu :802, kebab hamRowMenu :1121) go through this path, so the PR cell gets PR actions on every entry point, not just copy β€” consistent with the body's "explicit menu target".
  • Sub-row headers are unaffected. stageTrackerHeadColsHtml's new fourth argument is only passed at tracker-row-layout.js:546; the nested sub-row template (:238-248) keeps data-ham-sub-key and never emits data-ham-target-key.
  • Copy validation. stageTrackerCopyLink (tracker-actions.js:2312-2317) is kind- and number-checked, and runRowAction now fails the whole selection on one miss instead of silently copying a partial list (previously filter(Boolean) could report "Link copied" for an empty string). Backend URLs come from overviewItemURL(..., status.GitHubBaseURL) (stage_tracker_build.go:289,373) and linked-PR URLs are backfilled from the PR item at stage_tracker_links.go:356-357, so the regex's host/owner/repo/(issues|pull)/N shape is what the payload carries.

One open question, not a defect I can demonstrate: stageTrackerLinkedPRItem now derives repo from the URL path (tracker-row-layout.js:62-63), while tracker-actions.js:504, :519, :1248 and :2395 still mint PR keys from issue.repo. Those agree whenever the configured repo name matches GitHub's html_url spelling exactly (including case). If a hive configures a repo as e.g. Owner/Repo while GitHub canonicalises it lowercase, nested-PR keys would now diverge from the keys those four sites build. If the config path already normalises case, this is moot β€” worth a one-line confirmation from whoever knows.

static/index.html regen is in the diff. Label conflicts-with-open-pr is from #16011, which also edits tracker-row-layout.js; neither touches the other's functions (stageTrackerHeadColsHtml/stageTrackerLinkedPRItem are untouched by #16011), so it should be a textual rebase, not a semantic conflict.

Evidence bundle `#160179498753` sha256:2304093b97c8f82ea926e62a1147307f4a7a2535711000c0e3f27b96b17e325b β€” download from the dashboard or `hivectl review evidence #16017`.

Signed-off-by: Andy Anderson <andy@clubanderson.com>
@clubanderson

Copy link
Copy Markdown
Member Author

CI investigation: both failing dashboard 2/4 and dashboard shuffle 1/3 jobs in run 41195987700 fail only the new TestStageTrackerCopyLinkTargets fixture: the first expected clipboard write is undefined. CI Node exposes a read-only global navigator, so assignment did not install the clipboard stub. Changed the fixture to a lexical navigator (no production logic changes) and made the success assertion surface the styled error before inspecting writes. Coverage/test aggregate failures were downstream of this same fixture failure. Pushed a new head for full CI; no blind rerun or local suite execution.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correctness review (read at head 9498753; go test is blocked on this pod, so CI is the test verdict)

The copy-target fix itself checks out: stageTrackerCopyLink (tracker-actions.js:2312-2317) gates on kind + number, stageTrackerMenuTargets (tracker-actions.js:780-783) resolves the new data-ham-target-key, and the kebab stays issue-targeted because stageTrackerRowToolsHtml renders outside .ham-head-pr (tracker-actions.js:82-85, tracker-row-layout.js:543-546).

One low-severity side effect of the repo change in stageTrackerLinkedPRItem (tracker-row-layout.js:62-63), advisory only:

  • Nested sub-rows now stamp data-ham-sub-key and stageTrackerMoveAttrs(stageTrackerItemKey(pr), ctx) with the URL-derived repo (tracker-row-layout.js:232, 238, 245), but stageTrackerColMap (tracker-motion.js:415) and stageTrackerStateMap (tracker-motion.js:78) still key linked PRs as { repo: it.repo, kind: 'pr', number }. Before this PR both sides used the issue's repo, so they always agreed; now, for a linked PR whose URL lives in another repo (the cross-repo case this PR deliberately supports β€” IssueLinkedPR.Repo, pkg/github/client.go:751), ctx.moves[key] and the event-line state lookup miss the sub-row, so stage-move animation / change events for that sub-row silently stop. Cosmetic, cross-repo-only, no data impact.

    Suggested fix so the motion maps use the same identity as the DOM:

    --- a/src/pkg/dashboard/static-src/js/tracker-motion.js
    +++ b/src/pkg/dashboard/static-src/js/tracker-motion.js
    @@ -78 +78 @@
    -        for (const lp of (Array.isArray(it.linked_prs) ? it.linked_prs : [])) if (Number(lp.number) > 0) put(stageTrackerItemKey({ repo: it.repo, kind: 'pr', number: lp.number }), lp);
    +        for (const lp of (Array.isArray(it.linked_prs) ? it.linked_prs : [])) if (Number(lp.number) > 0) put(stageTrackerItemKey(stageTrackerLinkedPRItem(it, lp)), lp);
    @@ -415 +415 @@
    -        for (const lp of linked) out[stageTrackerItemKey({ repo: it.repo, kind: 'pr', number: lp.number })] = stageTrackerColIndex({ kind: 'pr', stage: lp.stage || 0 }, stages);
    +        for (const lp of linked) out[stageTrackerItemKey(stageTrackerLinkedPRItem(it, lp))] = stageTrackerColIndex({ kind: 'pr', stage: lp.stage || 0 }, stages);

    (tracker-merged.js:776,787 have the same lp.repo || item.repo shape but already fall back to data-ham-prs, so they are unaffected.)

β€” hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit a36b8d2 into v5 Oct 31, 2026
78 of 79 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/tracker-copy-link branch October 31, 2026 11:47
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicts-with-open-pr Open PR has a merge conflict with another open PR dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant