Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

Commit

Work docs say who a closing keyword closes for, and which pull requests #N names

A closing keyword closes a work item only for whoever could close it by hand, and a workspace's #N names another repository's pull request only when it was opened after work items came. An old issue number given as a pull request's address redirects for good, and sessions' state says that all is recent.

G1T-Session:
ses_01m560bz6eeqc8v1hrrha03pap
syntaqxcommitted Parent28f03aaBrowse files
5 files+21−70/5 viewed
+1−1
628628 None => SessionsShown::Recent,
629629 Some(state) => match SessionsShown::parse(&state) {
630630 Some(shown) => shown,
631− None => return invalid(format!("state is live, recent or ended, not {state}.")),
631+ None => return invalid(format!("state is live, recent (or all) or ended, not {state}.")),
632632 },
633633 };
634634 let kind = match text(input, "kind") {
+7−0
3232 repository's own workspace only. A work item of another workspace is never
3333 closed by your repositories: `Closes other-workspace#3` does nothing.
3434
35+A closing keyword closes a work item only for someone who could close it
36+by hand: for a merged pull request, both whoever merges it and its owner
37+need the **Triage** role on the work item; for a pushed commit, whoever
38+pushed it. A work item one of them may not triage is left alone, and one
39+they may not even see is named nothing at all. `Part of #12` needs only
40+that they can see it.
41+
3542 ## Landing, target by target
3643
3744 When a pull request merges into its repository's default branch, for each
+7−3
9595
9696 | You write | It names |
9797 | --- | --- |
98−| `#12`, in a repository | That repository's pull request #12, else the work item that was its issue #12, else the workspace's work item #12, else pull request #12 in another of the workspace's repositories |
99−| `#12`, outside a repository | The workspace's work item #12, else its pull request #12 |
98+| `#12`, in a repository | That repository's pull request #12, else the work item that was its issue #12, else the workspace's work item #12, else pull request #12 in another of the workspace's repositories, if it was opened after work items came |
99+| `#12`, outside a repository | The workspace's work item #12, else its pull request #12 opened after work items came |
100100 | `owner/name#12` | `#12` as it reads in repository `owner/name` |
101101 | `workspace#12` | Work item or pull request #12 of another workspace |
102102
103−What you may not see is passed over for the next in line. Text in code,
103+A pull request opened before work items is numbered in its repository
104+alone, so several may share a number: only a repository's own, or
105+`owner/name#12`, names one. What you may not see is passed over for the
106+next in line, and a repository you may not read reads as one that does
107+not exist. Text in code,
104108 `` `#12` `` or a code block, is never a reference.
105109
106110 So old references keep working: `#12` written about an issue before work
+4−2
55 * or `workspace#N` (in that workspace). Read in a repository, `#N` is its
66 * pull request N, else the work item that was its issue N, else the
77 * workspace's work item N, else a pull request N of another of its
8− * repositories: only the work service knows which, so a link goes through
8+ * repositories, numbered after work items came (an older pull request's
9+ * number is only its repository's): only the work service knows which, so a link goes through
910 * `/<owner>/<repo>/ref/<n>`, which asks it (`resolveRef`) and sends the
1011 * browser on. Read in a workspace alone, `#N` is its work item N, else its
11− * pull request N: the work item's page sends a pull request's number on.
12+ * pull request N numbered after work items came: the work item's page sends
13+ * a pull request's number on.
1214 * Pure, so it is tested under Node.
1315 */
1416
+2−1
206206 if (!found.ok) {
207207 // Work items and pull requests share numbers: `#number` here may be a work item.
208208 const to = await refPath(viewer, { repo: { namespace: params.owner.toLowerCase(), name: params.repo } }, number);
209− if (to && to !== `/${params.owner.toLowerCase()}/${params.repo}/pull/${number}`) throw redirect(to);
209+ // For good: a number names the same work item or pull request from here on.
210+ if (to && to !== `/${params.owner.toLowerCase()}/${params.repo}/pull/${number}`) throw redirect(to, 301);
210211 throw notFound("pull");
211212 }
212213 const { pull } = found.value;

Comments

Sign in to comment.