Skip to content

ci: caller for PostHog/.github changeset-hygiene workflow#509

Merged
turnipdabeets merged 5 commits into
mainfrom
ci/changeset-coverage
May 4, 2026
Merged

ci: caller for PostHog/.github changeset-hygiene workflow#509
turnipdabeets merged 5 commits into
mainfrom
ci/changeset-coverage

Conversation

@turnipdabeets
Copy link
Copy Markdown
Contributor

@turnipdabeets turnipdabeets commented May 4, 2026

Updated to use merged workflow in PostHog/.github#39

💡 Motivation and Context

Adds a tiny caller workflow for the shared changeset-hygiene reusable workflow at PostHog/.github. Catches the class of mistake that caused #491#507: a changeset frontmatter pointing at the wrong workspace package, plus a few related failure modes:

This PR carries no logic of its own — the workflow + script live in PostHog/.github so all SDKs share them. This file just delegates.

What it does

  • Triggers on pull_request against main.
  • Delegates to the reusable workflow via uses: PostHog/.github/.github/workflows/changeset-hygiene.yml@main.
  • Posts a single sticky comment under <!-- changeset-hygiene --> when there's a coverage issue. Auto-deletes when fixed. Never blocks merging.

Caller is 18 lines

The whole change is one file: .github/workflows/changeset-hygiene.yml. The actual workflow + script are at PostHog/.github/.github/workflows/changeset-hygiene.yml and PostHog/.github/.github/scripts/check-changeset-coverage.mjs.

Test plan

Verified end-to-end on the parallel test PR #510, which uses the same caller plus deliberate simulation files (source change in posthog-android-gradle-plugin/ paired with a changeset declaring posthog-android). The workflow correctly posted the expected mismatch comment.

This PR's own CI run (no workspace package changes, no changeset) correctly stays silent — the workflow only comments when there's an issue.

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

If releasing new changes

  • Ran pnpm changeset to generate a changeset file
  • Added the "release" label to the PR to indicate we're publishing new versions for the affected packages

(CI-only change — no workspace package code is touched, so no changeset is needed.)

@turnipdabeets turnipdabeets marked this pull request as ready for review May 4, 2026 15:13
@turnipdabeets turnipdabeets requested a review from a team as a code owner May 4, 2026 15:13
@marandaneto
Copy link
Copy Markdown
Member

marandaneto commented May 4, 2026

does it also cover the use case where maybe we have modinified packages but no changeset at all? i think this would be great as well

also take a look at posthog-js/.github/workflows/check-posthog-major-version.yml (Comment about missing changeset) since theres something in there as well
we probably want to cover any other use case where we failed before and then port across all sdks
if possible, this would live in https://github.com/PostHog/.github/tree/main/.github/workflows and then we just reuse across repos

Comment thread .github/workflows/changeset-coverage.yml Outdated
@marandaneto marandaneto requested a review from a team May 4, 2026 15:37
Comment thread .github/workflows/changeset-coverage.yml Outdated
- Replaces marocchino/sticky-pull-request-comment with inline github-script,
  matching the convention in posthog-js's check-posthog-major-version.yml.
- Adds 'no changeset at all' warning when source files in workspace
  packages are modified but the PR has no changeset entries.
- Adds 'unknown package name' warning when a changeset declares a name
  not present in the workspace (likely typo).
- Pins pull_request trigger types to [opened, synchronize, reopened].
@turnipdabeets
Copy link
Copy Markdown
Contributor Author

turnipdabeets commented May 4, 2026

does it also cover the use case where maybe we have modinified packages but no changeset at all? i think this would be great as well

also take a look at posthog-js/.github/workflows/check-posthog-major-version.yml (Comment about missing changeset) since theres something in there as well we probably want to cover any other use case where we failed before and then port across all sdks if possible, this would live in PostHog/.github@main/.github/workflows and then we just reuse across repos

@marandaneto I moved this to PostHog/.github#39. Considered joining with check-posthog-major-version.yml but they seem to be a bit different and js want to block on major versions. I don't think we want that in other repos so that can stay in js repo and we can share this across other repos.

…kflow

Removes the local 169-line script and 85-line workflow in favor of a tiny
22-line caller delegating to PostHog/.github's reusable changeset-hygiene
workflow (PostHog/.github#39). Same behavior, single source of truth across
SDKs.

Pinned to feat/changeset-hygiene while PostHog/.github#39 is open; will
update to @main once that merges.
@turnipdabeets turnipdabeets changed the title ci: warn when changesets don't cover modified packages ci: caller for PostHog/.github changeset-hygiene workflow May 4, 2026
@turnipdabeets turnipdabeets requested a review from dustinbyrne May 4, 2026 17:57
@turnipdabeets turnipdabeets enabled auto-merge (squash) May 4, 2026 17:59
@turnipdabeets turnipdabeets merged commit 097c3fd into main May 4, 2026
13 checks passed
@turnipdabeets turnipdabeets deleted the ci/changeset-coverage branch May 4, 2026 18:01
@marandaneto
Copy link
Copy Markdown
Member

Nice!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants