Skip to content

[build-tools] Add eas/posthog_annotation workflow function#3948

Open
gwdp wants to merge 1 commit into
gwdp/eng-21551-posthog-upload-sourcemapsfrom
gwdp/eng-21551-posthog-annotation
Open

[build-tools] Add eas/posthog_annotation workflow function#3948
gwdp wants to merge 1 commit into
gwdp/eng-21551-posthog-upload-sourcemapsfrom
gwdp/eng-21551-posthog-annotation

Conversation

@gwdp

@gwdp gwdp commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Why

Drop a labeled marker on PostHog charts from a workflow, so a deploy or release shows up as a line across every graph. Reasoning: Makes it easy to see whether errors spiked right after a ship.

How

Adds eas/posthog_annotation. POSTs to the PostHog annotations API with content and an optional date_marker (defaults to now). Same personal key as the flag and metric steps; the key needs the annotation:write scope.

ignore_error (default false) fails the step on error; set it true to warn and continue.

Test Plan

CI passes. Not live-run yet, since the connect key needs the annotation:write scope. Will run it before undrafting. Test workflow below.

Test workflow
name: PostHog annotation test

jobs:
  annotate_now:
    environment: production
    steps:
      - uses: eas/posthog_annotation
        with:
          content: Test annotation from an EAS workflow

  annotate_dated:
    environment: production
    steps:
      - uses: eas/posthog_annotation
        with:
          content: Release marker, back-dated
          date_marker: 2026-07-03T00:00:00Z
Screenshot 2026-07-03 at 2 24 25 PM Screenshot 2026-07-03 at 2 24 53 PM

@linear-code

linear-code Bot commented Jul 3, 2026

Copy link
Copy Markdown

ENG-21551

gwdp commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

@gwdp gwdp force-pushed the gwdp/eng-21551-posthog-annotation branch from d0f40ee to 9ce8b59 Compare July 3, 2026 20:47
@gwdp gwdp force-pushed the gwdp/eng-21551-posthog-upload-sourcemaps branch from 229312f to 98e807a Compare July 3, 2026 20:47
@gwdp gwdp force-pushed the gwdp/eng-21551-posthog-annotation branch from 9ce8b59 to aa30fd2 Compare July 3, 2026 20:58
@gwdp gwdp force-pushed the gwdp/eng-21551-posthog-upload-sourcemaps branch from 98e807a to f34df26 Compare July 3, 2026 20:58
@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.73%. Comparing base (d089cc8) to head (d70a085).

Additional details and impacted files
@@                             Coverage Diff                              @@
##           gwdp/eng-21551-posthog-upload-sourcemaps    #3948      +/-   ##
============================================================================
+ Coverage                                     59.71%   59.73%   +0.03%     
============================================================================
  Files                                           943      944       +1     
  Lines                                         41579    41601      +22     
  Branches                                       8758     8760       +2     
============================================================================
+ Hits                                          24826    24848      +22     
  Misses                                        16659    16659              
  Partials                                         94       94              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gwdp gwdp force-pushed the gwdp/eng-21551-posthog-annotation branch from aa30fd2 to 9c65fdb Compare July 3, 2026 21:09
@gwdp gwdp force-pushed the gwdp/eng-21551-posthog-upload-sourcemaps branch 2 times, most recently from b6df873 to eb91e64 Compare July 3, 2026 21:40
@gwdp gwdp force-pushed the gwdp/eng-21551-posthog-annotation branch from 9c65fdb to bccd6db Compare July 3, 2026 21:40
@gwdp gwdp requested a review from sjchmiela July 3, 2026 21:47
@gwdp gwdp marked this pull request as ready for review July 3, 2026 21:48
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

Subscribed to pull request

File Patterns Mentions
**/* @douglowder

Generated by CodeMention

Warning: The preamble and epilogue options in commentConfiguration are deprecated. Use template instead.

@sjchmiela sjchmiela left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: let's use UserError and add tracking codes?

@gwdp gwdp force-pushed the gwdp/eng-21551-posthog-upload-sourcemaps branch from eb91e64 to 7d0223e Compare July 6, 2026 19:51
@gwdp gwdp force-pushed the gwdp/eng-21551-posthog-annotation branch from bccd6db to a662e94 Compare July 6, 2026 19:51
@gwdp gwdp force-pushed the gwdp/eng-21551-posthog-upload-sourcemaps branch from 7d0223e to 6952ef5 Compare July 6, 2026 20:40
@gwdp gwdp force-pushed the gwdp/eng-21551-posthog-annotation branch from a662e94 to 52dc644 Compare July 6, 2026 20:40
@gwdp gwdp force-pushed the gwdp/eng-21551-posthog-upload-sourcemaps branch from 6952ef5 to fc5c5d9 Compare July 6, 2026 21:59
@gwdp gwdp force-pushed the gwdp/eng-21551-posthog-annotation branch 2 times, most recently from 8407075 to d3e76bf Compare July 6, 2026 22:21
@gwdp gwdp force-pushed the gwdp/eng-21551-posthog-upload-sourcemaps branch 2 times, most recently from abdc0c9 to fc81011 Compare July 6, 2026 22:54
@gwdp gwdp force-pushed the gwdp/eng-21551-posthog-annotation branch from d3e76bf to b52c51f Compare July 6, 2026 22:54
@gwdp gwdp force-pushed the gwdp/eng-21551-posthog-upload-sourcemaps branch from fc81011 to cdfc8f9 Compare July 6, 2026 23:35
@gwdp gwdp force-pushed the gwdp/eng-21551-posthog-annotation branch 2 times, most recently from 27b3af6 to a437436 Compare July 6, 2026 23:50
@gwdp gwdp force-pushed the gwdp/eng-21551-posthog-upload-sourcemaps branch from cdfc8f9 to 82b0571 Compare July 6, 2026 23:50

gwdp commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

handled in the client refactor, everything throws UserError with codes now (EAS_POSTHOG_MISSING_CREDENTIALS here, EAS_POSTHOG_FORBIDDEN / EAS_POSTHOG_REQUEST_FAILED from the shared requestAsync). thanks for the approve 🙏

@gwdp gwdp force-pushed the gwdp/eng-21551-posthog-annotation branch from a437436 to d70a085 Compare July 7, 2026 23:43
@gwdp gwdp force-pushed the gwdp/eng-21551-posthog-upload-sourcemaps branch from 82b0571 to d089cc8 Compare July 7, 2026 23:43
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

✅ Thank you for adding the changelog entry!

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