You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Step 3: accept app <copilot-ref> issue links in merge check
The Copilot App rewrites a plain 'Closes#2' in the PR body as a
<copilot-ref ... target-id=".../issues/2"> chip, which GitHub does not
parse as a closing keyword. As a result closingIssuesReferences was empty
and the terminal Step 3 check false-failed even though the learner linked
and closed the correct issue.
Harden check-issue-closed to also scan the PR body for referenced issue
numbers (bare #N and .../issues/N URLs, covering the app's chip) and pass
when any non-walkthrough referenced issue is closed. Clarify in the step
troubleshooting that the linked-issue chip is expected.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a9ddd07b-77bf-43e0-a5d9-c6426a067e0e
Copy file name to clipboardExpand all lines: .github/steps/3-step.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -170,7 +170,7 @@ Review the diff agent merge staged, then merge it. Watch this issue for **two re
170
170
171
171
- If the merge check hasn't posted, make sure agent merge actually **merged** the PR (not just opened it).
172
172
- The exercise won't advance if the merged app fails to build. If the build row is red, fix the code on `main` (usually a `localStorage` call outside the `client:load` / `<script>` boundary) and push the fix.
173
-
- If the app issue stays open, confirm the PR body used `Closes https://github.com/{{full_repo_name}}/issues/2` (your **Build the bookmarks app** issue) — not the walkthrough issue — then close it manually if needed.
173
+
- If the app issue stays open, confirm the PR body used `Closes https://github.com/{{full_repo_name}}/issues/2` (your **Build the bookmarks app** issue) — not the walkthrough issue — then close it manually if needed. The app may render the closing reference as a linked **Issue #2** chip; that's expected — the check accepts it as long as issue **#2** ends up closed.
174
174
- Still stuck on the app itself? See [Getting started with the Copilot App](https://docs.github.com/en/copilot/how-tos/github-copilot-app/getting-started).
gh api "repos/$OWNER/$REPO_NAME/pulls/$PR_NUMBER" --jq '.body // ""' 2>/dev/null \
220
+
| grep -oiE '(#[0-9]+|/issues/[0-9]+)' \
221
+
| grep -oE '[0-9]+' || true
222
+
}
212
223
213
-
echo "Attempt $attempt: linked work item issues now closed by this PR: $CLOSED_LINKED"
224
+
# Merging closes the linked issue asynchronously, so poll a few times
225
+
# to avoid a false failure from reading the state too early.
226
+
CLOSED_LINKED=0
227
+
for attempt in 1 2 3 4 5; do
228
+
CLOSED_LINKED=0
229
+
for num in $(collect_candidates | sort -un); do
230
+
if [ "$num" = "$WALKTHROUGH_ISSUE_NUMBER" ]; then
231
+
continue
232
+
fi
233
+
STATE=$(gh api "repos/$OWNER/$REPO_NAME/issues/$num" --jq '.state' 2>/dev/null || echo "")
234
+
if [ "$STATE" = "closed" ]; then
235
+
echo "Referenced work item issue #$num is closed."
236
+
CLOSED_LINKED=1
237
+
fi
238
+
done
239
+
240
+
echo "Attempt $attempt: linked (non-walkthrough) work item issues closed by this PR: $CLOSED_LINKED"
214
241
if [ "$CLOSED_LINKED" -ge 1 ]; then
215
242
break
216
243
fi
217
244
sleep 3
218
245
done
219
246
220
247
if [ "$CLOSED_LINKED" -ge 1 ]; then
221
-
echo "The merged pull request closed its linked work item issue."
248
+
echo "The merged pull request resolved its linked work item issue."
222
249
exit 0
223
250
else
224
-
echo "No linked work item issue was closed. Ensure the PR body used a closing keyword (e.g. 'Closes #<app-issue-number>') pointing at your bookmarks issue, not the walkthrough issue."
251
+
echo "No linked work item issue was closed. In the pull request body, reference your bookmarks issue with a closing keyword (e.g. 'Closes #<app-issue-number>') pointing at that issue, not the walkthrough issue, and make sure the issue is closed."
0 commit comments