fj pr ready reports success without clearing the draft state #268
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
fj pr readyreports success and leaves the pull request a draft.api::pull_core::readyPATCHes/repos/{owner}/{repo}/pulls/{number}with{"draft": false}. Forgejo decodes the body, ignores the property, and answers201 Created, so the command exits 0 having changed nothing.The comment on it ("PATCH with
{ "draft": false }works on 7.x") does not hold. Forgejo has no draft column and no draft endpoint:PullRequest.draftis computed on every read byHasWorkInProgressPrefix, a case-insensitive prefix match of the title againstrepository.pull-request.WORK_IN_PROGRESS_PREFIXES.EditPullRequestOptioncarries noDraftfield inmodules/structs/pull.goat eitherv15.0.2orv16.0.3, andEditPullRequestinrouters/api/v1/repo/pull.goreads none.Verified against a live 16.0.3 instance:
draftafter{"draft": false}true{"title": "<prefix stripped>"}falseFix
PATCH the title with the work-in-progress prefix removed, matched the way the server matches it: anchored at the start, case-insensitive, no leading-whitespace tolerance.
Two cases must fail loudly rather than silently, because the prefix list is instance-configurable and no API exposes it:
fjrecognises (a customWORK_IN_PROGRESS_PREFIXES), so there is nothing to stripfj stack sync --readygoes through the sameready()and inherits the bug.Fjord had the identical defect and the identical belief, from the same source: the vendored contract's
EditPullRequestOption.draftwas hand-added to the spec on that assumption (forgejo-api-contract#3) and is dropped by the 16.0.3 re-vendor (forgejo-api-contract#5). The iOS fix is rasterstate/fjord-ios#1276, including the prefix-matching rule and its tests, if it is useful to mirror.