Skip to content

PrPlanReport's sticky-comment step has the same bare-path gh api bug, so it cannot work off github.com #2305

Closed

Description

@lex00

What

Found while landing #2291. lexicons/github/src/composites/pr-plan-report.ts's sticky-comment script calls gh api with a bare relative path, exactly as postOrUpdateComment did before #2291 fixed it.

gh resolves a relative path against /api/v3 for any host but github.com. GitHub Enterprise serves that path; Forgejo does not, and answers 404 for GET and POST alike, which was observed on a real Forgejo 12.0.4 during INTENTIUS/choudoufu#1027.

So this composite works on github.com, works on GitHub Enterprise, and cannot work on Forgejo, while chant-lexicon-forgejo's serializer test passes it through on the grounds that Forgejo accepts the same calls. It does accept them, at a different prefix.

Do

The fix is the one #2291 landed for the Op path: build the call from GITHUB_API_URL, which every GitHub Actions and Forgejo Actions job already carries and which is already correct on each. githubApiBaseFrom in packages/core/src/op/activities/reconcile.ts exists now and can be reused rather than duplicated.

Worth checking whether any other composite shells to gh api with a relative path in the same way, rather than fixing this one in isolation.

Proof

A serializer test asserting the emitted script targets the resolved API base, shown red against the current bare path. Then, ideally, one run on a real Forgejo, since that is what turned the assumption over the first time.

Refs #2291, #2289, INTENTIUS/choudoufu#1027.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions