Description
When creating a pull request in a repository that has selective-p set to t, the post-submit callback fails with:
error in process filter: Fetching an individual topic not implemented for forge-github-repository
Steps to reproduce
- Add a repository to forge with
selective-p set to t (e.g., via forge-add-repository with "individual topics" option, or programmatically)
- Create a pull request with
forge-create-pullreq
- Submit the PR
Root cause
In forge--post-submit-callback (forge-post.el:266-289), the topic variable is captured at closure creation time:
(topic (ignore-errors (forge-get-topic forge--buffer-post-object)))
For new PRs, forge--buffer-post-object is the repository, so topic becomes nil.
When the callback executes after successful PR creation:
(if (or (not full-pull)
(oref repo selective-p))
(forge--pull-topic repo topic) ; topic is nil here
(forge--pull repo))
If selective-p is t, it calls (forge--pull-topic repo nil). There's no method specialization for a nil topic on forge-github-repository, so it falls back to the generic method which signals an error.
Environment
Magit v4.5.0-32-g64fae64, Transient 0.12.0, Forge 0.6.3, Git 2.52.0, Emacs 30.2, darwin
Description
When creating a pull request in a repository that has
selective-pset tot, the post-submit callback fails with:Steps to reproduce
selective-pset tot(e.g., viaforge-add-repositorywith "individual topics" option, or programmatically)forge-create-pullreqRoot cause
In
forge--post-submit-callback(forge-post.el:266-289), thetopicvariable is captured at closure creation time:(topic (ignore-errors (forge-get-topic forge--buffer-post-object)))For new PRs,
forge--buffer-post-objectis the repository, sotopicbecomesnil.When the callback executes after successful PR creation:
If
selective-pist, it calls(forge--pull-topic repo nil). There's no method specialization for aniltopic onforge-github-repository, so it falls back to the generic method which signals an error.Environment
Magit v4.5.0-32-g64fae64, Transient 0.12.0, Forge 0.6.3, Git 2.52.0, Emacs 30.2, darwin