Skip to content

ci: post Unit Tests push runs to Discussions (#2030) - #2036

Merged
JarryShaw merged 1 commit into
mainfrom
ci/2030-unit-tests-push-reports
Oct 22, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
ci/2030-unit-tests-push-reports

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • ci — workflows or build tooling

Description of your pull request and other information

#2030 PR 2. Stacked on #2033, so review only the top commit. Draft: the question on #2030 about what counts as "warned" is still open.

  • coverage-comment.yml gains a discussion job ("Post the push run report"). It runs when a relayed Unit Tests run's event is push, and holds only checks: read, contents: read and discussions: write. The comment job's if: is untouched, and its scopes move onto the job.
  • The thread title is unit-tests: <branch> push runs. The status comes from the run's conclusion; a green run whose jobs failed under continue-on-error, or carry warning annotations, counts as warning. The report lists the run, the sha, the jobs that did not pass and their annotation titles, each as a code span.
  • The checkout is sparse, of util/discussion_report.py only, from the default branch. The relayed head is never checked out.
  • A push relay gets its own concurrency group, so a newer main run cannot cancel a pending report.

The pins fail on #2033's workflow (74 failed) and pass here (18 passed). One end-to-end test runs both steps and the real script against a stand-in GitHub: silent, warning, failure, back to green, silent. The 49 files that read the workflows give 1175 passed.

@JarryShaw JarryShaw added enhancement Issues requesting a new capability (set by the feature request template) ci Pull requests that change CI or workflow configuration (ci: subject prefix) review: pending No verdict for the current head - never reviewed, or the head moved since the last one labels Oct 22, 2026
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Oct 22, 2026
@JarryShaw JarryShaw added review: running A cross-review is in flight against the current head - no verdict yet and removed review: pending No verdict for the current head - never reviewed, or the head moved since the last one labels Oct 22, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

GOOD TO GO at 38ecd1c0d (Sonnet cross-review), with the #2030 "warned" rule left to the owner. The rule lives in one filter in Write the run report.

  • Nothing from the relayed head is checked out or run.
  • Branch, job and annotation text reach the shell through env: and is sanitised before rendering.
  • PR relays keep the exact old concurrency group.
  • The GraphQL query returns all 46 check runs on run 39718608950.

Unverified until a live run: whether GITHUB_TOKEN with checks: read can read annotations. Annotations are read 20 per job.

@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate and removed review: running A cross-review is in flight against the current head - no verdict yet labels Oct 22, 2026
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Coverage: 91.54% (unit tier, Python 3.15, 8eaa82f3a, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 4 20 2 95.16%
pcapkit/const 19597 881 2618 867 92.11%
pcapkit/corekit 2567 71 816 37 96.57%
pcapkit/dumpkit 282 3 102 3 98.44%
pcapkit/foundation 2930 23 1022 25 98.79%
pcapkit/interface 138 4 52 3 96.32%
pcapkit/protocols 17436 219 4582 185 98.15%
pcapkit/toolkit 872 36 298 10 95.21%
pcapkit/utilities 529 7 160 5 98.26%
pcapkit/vendor 4431 1995 1018 167 51.73%

Per-file detail: the coverage-html artifact of this run.

@JarryShaw
JarryShaw force-pushed the ci/2030-unit-tests-push-reports branch from 38ecd1c to cf9bf9b Compare October 22, 2026 14:55
@JarryShaw

Copy link
Copy Markdown
Owner Author

Rebased onto #2033's new head as cf9bf9b89. patch-id matches 38ecd1c0d, so the verdict holds. Still stacked on #2033 and still a draft pending #2030.

@JarryShaw
JarryShaw force-pushed the ci/2030-unit-tests-push-reports branch from cf9bf9b to 8eaa82f Compare October 22, 2026 15:15
@JarryShaw

Copy link
Copy Markdown
Owner Author

Amended to 8eaa82f3a per the #2030 ruling (option 1). A fixed EXPECTED list (job + level + title prefix) covers the by-design install failures on Python 3.7 (KTLO), Integration Python 3.7 (KTLO) and Python pypy3.10 (KTLO); any other annotation still counts as warned. Run 39718608950's real annotations map to success. The pins fail on cf9bf9b89 (10 failed) and pass here (22 passed). A delta review is running.

@JarryShaw JarryShaw added review: running A cross-review is in flight against the current head - no verdict yet and removed review: good-to-go Cross-review at the current head says ready; CI state is separate labels Oct 22, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

GOOD TO GO at 8eaa82f3a (Sonnet delta re-review). EXPECTED matches on job, level and title prefix. Wrong-job, wrong-level and empty-title-WARNING cases still warn, and a KTLO tests failed on … warning still warns. Run 39718608950 gives success. One optional hardening: the listed titles are complete strings, so == would close a theoretical over-match by a longer title. Out of draft now that #2030 is decided; still stacked on #2033.

@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate and removed review: running A cross-review is in flight against the current head - no verdict yet labels Oct 22, 2026
@JarryShaw
JarryShaw marked this pull request as ready for review October 22, 2026 15:18
@JarryShaw

Copy link
Copy Markdown
Owner Author

Ordering check on 8eaa82f3a: the project leg (util/run_unittest_leg.py project) ran 1778 tests, OK (71 skipped). CI: 63 checks green, 0 failing. KTLO 3.8, 3.9 and 3.10 legs: 0 failing tests. Ready to merge after #2033.

@JarryShaw

Copy link
Copy Markdown
Owner Author

resolve conflicts

@JarryShaw
JarryShaw force-pushed the ci/2030-unit-tests-push-reports branch from 8eaa82f to 1de9817 Compare October 22, 2026 17:21
@JarryShaw

Copy link
Copy Markdown
Owner Author

Rebase only, no new changes: 8eaa82f3a → 1de98171a. This rebase has stacked on #2033, moved onto its new head. No conflicts, and the patch-id is identical.

CI on the previous head 8eaa82f3a: 63 checks green, 0 failing; the KTLO legs fail 0 tests. The GOOD TO GO verdict carries over. You can bypass checks and merge.

- coverage-comment.yml: a `discussion` job takes Unit Tests runs whose
  event is `push` and posts them as `--mode push` to
  `unit-tests: <branch> push runs`. Its report comes from the run's check
  suite in one GraphQL call: run link, commit, conclusion, the jobs that
  did not pass and the annotations of those that did. A green run with a
  failed non-blocking job or a warning annotation reports `warning`.
- `EXPECTED` lists the annotations main's KTLO legs write by design (the
  3.7 and pypy3.10 install failures), by job, level and title prefix;
  they neither count nor appear. Any other annotation still counts.
- It alone holds `discussions: write`, beside `checks: read` and
  `contents: read` for a sparse checkout of the default branch's script.
  Top-level permissions are now `{}`; `comment` keeps its own scopes.
- A push relay's concurrency group is its own run's, so a newer relay
  cannot cancel a pending one; a pull request's group is unchanged.
- tests/project/test_unit_tests_push_reports_2030.py: the job layout,
  scopes, events and checkout, the conclusion-to-status mapping, the
  by-design list and run 39718608950's annotations, the report against a
  stand-in gh, and both steps end to end.
- workflows.rst: CI Reports covers the relay.
@JarryShaw
JarryShaw force-pushed the ci/2030-unit-tests-push-reports branch from 1de9817 to 3bbddff Compare October 22, 2026 18:11
@JarryShaw

Copy link
Copy Markdown
Owner Author

Rebase only, no new changes: 1de98171a → 3bbddff72, moved onto main after #2033 merged. No conflicts, and the patch-id is identical.

CI on the previous head 1de98171a: 42 checks green, 0 failing, and 14 still running when it was superseded. The head before that, 8eaa82f3a, carried the same patch and was fully green, with 0 failing KTLO tests and an ordering leg of 1778 OK. The GOOD TO GO verdict carries over. You can bypass checks and merge.

@JarryShaw
JarryShaw merged commit 25032c8 into main Oct 22, 2026
57 checks passed
@JarryShaw
JarryShaw deleted the ci/2030-unit-tests-push-reports branch October 22, 2026 18:53
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 22, 2026
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 22, 2026
@JarryShaw JarryShaw added this to the PyPCAPKit v1.5 milestone Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Pull requests that change CI or workflow configuration (ci: subject prefix) enhancement Issues requesting a new capability (set by the feature request template)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant