Skip to content

ci: post CI reports to a Discussions thread per job (#2030) - #2033

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

JarryShaw merged 1 commit into
mainfrom
ci/2030-discussion-reports

Conversation

@JarryShaw

@JarryShaw JarryShaw commented Oct 22, 2026 •

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 1.

  • util/discussion_report.py posts a report to its job's thread in the CI reports category. It creates the thread on first use, found by exact title, and ends each comment with the run, the commit and a hidden report-status marker.
    • --mode scheduled posts every run.
    • --mode push posts every non-success run, plus a success only when the thread's last marker was not a success.
    • API, permission or missing-category problems warn and exit 0.
  • ci-timing and cron-vendor each gain a discussion job. It is the only job holding discussions: write, and it is continue-on-error. cron-vendor picks push mode on workflow_run and scheduled otherwise. Its discussion job also runs when the head gate failed or was cancelled, and posts a generated report that says so. Its report marks failed targets or a failed test gate as warning.
  • workflows.rst gains a CI Reports section and a script row.

The pins fail on main's workflows (28 failed) and pass here (110 passed). The 63 test files that read these workflows or workflows.rst give 1268 passed. The gh stub fakes every API call.

Open: it is unverified whether GITHUB_TOKEN can open a thread in an Announcement-format category. If it cannot, the job warns, and I'll create the two threads by hand once this lands.

@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: running A cross-review is in flight against the current head - no verdict yet labels Oct 22, 2026
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Oct 22, 2026
@JarryShaw
JarryShaw force-pushed the ci/2030-discussion-reports branch from 2166b7c to 0eb3be1 Compare October 22, 2026 03:37
@JarryShaw

Copy link
Copy Markdown
Owner Author

GOOD TO GO at 0eb3be161 (Sonnet cross-review, plus a delta re-review of the gate-failure fix).

  • Scheduled runs post every run, now including a failed or cancelled cron-vendor gate. All-skipped runs still conclude skipped.
  • Push runs post on a non-success, and on the first success after one.
  • Only the discussion jobs hold discussions: write. Create Release's vendor-update filter and success requirement are unaffected.
  • Report text reaches GraphQL as JSON on stdin, with no interpolation into run:.
  • Still unverified: whether GITHUB_TOKEN may open a thread in an Announcement-format category. If it can't, the job warns, and I'll create the two threads by hand after merge.

@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 force-pushed the ci/2030-discussion-reports branch from 0eb3be1 to e3cb18c Compare October 22, 2026 03:59
@JarryShaw

Copy link
Copy Markdown
Owner Author

Rebased onto main da8596414 as e3cb18c62. The only conflict was the Workflow Scripts table in workflows.rst, where #2029 added a row beside this PR's; both rows are kept. The code is unchanged, and every test file that reads workflows.rst, ci-timing or cron-vendor passes (637 passed).

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Coverage: 91.54% (unit tier, Python 3.15, 045c3af11, 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

Copy link
Copy Markdown
Owner Author

Ordering check on e3cb18c62: python util/run_unittest_leg.py project on this tree gave Ran 1739 tests, OK (skipped=71). KTLO failing test ids: 0 across every KTLO leg.

@JarryShaw

Copy link
Copy Markdown
Owner Author

resolve conflicts

@JarryShaw
JarryShaw force-pushed the ci/2030-discussion-reports branch from e3cb18c to 045c3af Compare October 22, 2026 14:55
@JarryShaw

Copy link
Copy Markdown
Owner Author

Rebased onto main cd4075e10 as 045c3af11. The only conflict was the Workflow Scripts table in workflows.rst, where #2031 added its util/pip_install.py row beside this PR's row; both rows are kept. The code is unchanged (same diffstat), and the tests that read the docs or the two workflows pass (637 passed).

@JarryShaw

Copy link
Copy Markdown
Owner Author

Ordering check on 045c3af11: the project leg (util/run_unittest_leg.py project) ran 1756 tests, OK (71 skipped). CI is 58 green with 0 failing, and the KTLO legs fail 0 tests. Ready to merge.

@JarryShaw

Copy link
Copy Markdown
Owner Author

resolve conflicts

- util/discussion_report.py: finds the category and the job's thread by
  name through `gh api graphql` and opens the thread on first use.
  `--mode scheduled` posts every run; `--mode push` posts a run that
  warned or failed, and a green run only after a non-green one, read
  from a hidden report-status marker. Every failure is one warning and
  exit 0.
- ci-timing.yml, cron-vendor.yml: a `discussion` job, alone holding
  `discussions: write`, downloads the reporting job's artifact and posts
  it to the `CI reports` category (workflow-level REPORT_CATEGORY).
  ci-timing is `scheduled`; cron-vendor is `push` on `workflow_run`.
  vendor-update writes and uploads a run report and a `warning` status;
  a failed or cancelled gate posts a report of its own. Other jobs keep
  their permissions.
- tests/project/test_discussion_report_2030.py: the script against a
  stand-in gh, both modes, the workflow pins, and the vendor report and
  post steps; test_ci_timing.py's permission and job pins follow.
- workflows.rst: the script joins Workflow Scripts; CI Reports section.
@JarryShaw
JarryShaw force-pushed the ci/2030-discussion-reports branch from 045c3af to 5636a26 Compare October 22, 2026 17:21
@JarryShaw

Copy link
Copy Markdown
Owner Author

Rebase only, no new changes: 045c3af11 → 5636a260b. This rebase has the workflows.rst table conflict with #2032 resolved by keeping both rows. The code patch-id is identical (outside docs/), and the diffstat matches. The doc-reading tests on the rebased tree: 123 passed.

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

@JarryShaw
JarryShaw merged commit 9c8a110 into main Oct 22, 2026
57 checks passed
@JarryShaw
JarryShaw deleted the ci/2030-discussion-reports branch October 22, 2026 18:09
@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