Skip to content

forge--pull-topic fails with nil topic after creating PR when selective-p is true #830

@jarreds

Description

@jarreds

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

  1. Add a repository to forge with selective-p set to t (e.g., via forge-add-repository with "individual topics" option, or programmatically)
  2. Create a pull request with forge-create-pullreq
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions