Skip to content

build-jupyter-cache: the failure alert can land on an open pull request instead of an issue #238

Closed

Description

@mmcky

From the 2026-10-06 codebase review (finding L1; record: .qe/dev/log/2026-10-06-codebase-review.md, #220).

build-jupyter-cache looks for an open failure issue with listForRepo({state: 'open', labels: labels[0], per_page: 1}) and takes the first result (build-jupyter-cache/action.yml:567-571). The Issues API returns pull requests too. So suppose an open pull request carries build-failure (a fix PR, say) and is newer than any open failure issue. Then:

  • the failure report is posted as a comment on that pull request;
  • no issue is filed;
  • failure-issue-url points at the pull request.

"Verify the failure alert was filed" (:601-609) checks only that a URL was produced, so it passes. Yet the issue-labels description promises that the first label "finds an open failure issue".

The alert is misrouted to a visible thread, not lost. scripts/create-ci-failure-issue.sh uses gh issue list, which returns issues only, so it is not affected.

Done when

  • The lookup lists more than one item (per_page: 100) and takes the first with no pull_request key. A labelled pull request then never receives the report, and a new issue is filed when none is open. Filtering the list is better here than the search API, which is eventually consistent and could let a second failure file a duplicate.
  • The verification step fails if the URL points at a pull request.
  • A test covers the case where the only open item with the label is a pull request.

Activity

  1. added
    bug
    low-priority
    on Nov 4, 2026
  2. added theissue type on Nov 4, 2026
  3. mmcky commented on Nov 6, 2026

    @mmcky
    ContributorAuthor

    Checked against main at 9644f17 (2026-11-06): this holds as written. The lookup is unchanged since #122 and is now at build-jupyter-cache/action.yml:613-617, and the verification step is at :647-660. The PRs since this was filed (#251, #256, #265, #269) only moved the lines. A live read of the Issues API confirms that it returns pull requests, each with a pull_request key and an html_url of …/pull/<N>.

    How likely it is: both callers, lecture-dp and the canary, use the default labels, and no pull request in the QuantEcon org has ever carried build-failure, so this has never happened. It would happen often to a caller who put a label like automated first, since 2,221 QuantEcon pull requests carry that one.

    The plan: the per_page: 100 filter on pull_request, the verification step failing on a /pull/ URL, and a test. The harness must not file real issues, so the test runs the alert step's own script against a stand-in for the GitHub API, as the preview-comment job already does for the preview actions. It covers a labelled pull request alone, a newer labelled pull request beside an older issue, and nothing labelled, and it runs the verification step on a pull request's URL. This ships in one PR with #229, which changes the same step and adds the same test job.

    Claude Code (on behalf of mmcky)

  4. added a commit that references this issue on Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buglow-priority

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions