Loading
Add relate and mr-dependency draft kinds
Adds two draft kinds to publish: relate (link two issues) and mr-dependency (block one merge request on another). Both go through the same draft, approval and post path as the other kinds.
What it does
relate --project P --iid N --to-project P --to-iid N --link-type relates_to|blocks|is_blocked_byposts RESTPOST projects/:id/issues/:iid/links. It returns{id, iid, web_url, link_type}, withiidandweb_urlof the issue the draft names first.mr-dependency --project P --iid N --blocked-by-project P --blocked-by-iid Nresolves the blocking merge request's global id with a GET, then posts RESTPOST projects/:id/merge_requests/:iid/blocks. It returns{id, iid, web_url}of the blocked merge request.- Both take full project paths and plain iids. A bare number,
#Nor!N, the same object twice and an unknown link type are refused at draft time, and again at publish. - The draft body is one sentence built from the header (
scripts/link-text.sh, sourced by both scripts).publishrefuses a body that differs, so the text shown is the link made. - A
blocksoris_blocked_bylink and every merge request dependency need Premium or Ultimate. A host that answers 403 or names the license fails with that said.relates_toworks on any tier.
Why REST
Both endpoints return the objects' own web_url, work on the same glab api path as the rest of publish, and need no global-id lookup for issues. The work item GraphQL linking mutation would also cover epics; that stays out of this change.
Checked
- Selftests in
tests/run.shassert, against the glab stub, that each kind renders both ends, refuses each bare form, posts the expected request, refuses an edited body before any request, and names the tier on a 403. The script-set list gainslink-text.sh. - One live post of each kind in a scratch project on gitlab.com (Ultimate), read back through the issue links and MR blocks endpoints. The scratch project is deleted.
- Word budget stays under its ceiling.
Closes #25 (closed)