Skip to content

feat(platform): Add automated EA features sync to update EA features doc#17011

Open
sfanahata wants to merge 12 commits intomasterfrom
shannon/ea-features-automation
Open

feat(platform): Add automated EA features sync to update EA features doc#17011
sfanahata wants to merge 12 commits intomasterfrom
shannon/ea-features-automation

Conversation

@sfanahata
Copy link
Contributor

@sfanahata sfanahata commented Mar 17, 2026

Summary

Adds full automation to keep the Early Adopter features documentation in sync with Flagpole configuration. The weekly workflow detects changes, updates the mapping file, regenerates the docs page, and creates a PR for review.

What's Added

  1. Feature Mapping File (src/data/ea-features.json)
    Maps feature flags to:
  • Human-readable display names
  • Documentation links (features with docsUrl: null won't appear on the docs page)
  • Categories for organization
  1. Sync Script (scripts/sync-ea-features.ts)
    Command What it does
    pnpm ts-node scripts/sync-ea-features.ts Check only - shows report, no changes
    pnpm ts-node scripts/sync-ea-features.ts --update Updates mapping file and regenerates MDX
    The script:
  • Parses Flagpole YAML from sentry-options-automator
  • Extracts EA features (enabled, rollout > 0, user-visible)
  • Filters out internal flags (-ingest, -post-process-group, cache-, etc.)
  • Compares against our mapping file
  • Auto-adds new features with generated display names
  • Auto-removes features no longer in EA
  • Regenerates the MDX page (only documented features appear)
  • Warns if any categories aren't in CATEGORY_ORDER
  1. GitHub Action (.github/workflows/sync-ea-features.yml)
    Schedule: Weekly on Mondays at 9am UTC (or manual trigger)
    Workflow:
  2. Clones sentry-options-automator and parses Flagpole
  3. Runs sync with --update to apply changes
  4. If files changed, creates a PR with:
    • Summary table (new/removed/documented/undocumented counts)
    • Prominent list of undocumented features
    • Review checklist
    • Full sync output (collapsed)
      How It Works
      Weekly Schedule (Monday 9am UTC)

      Clone sentry-options-automator

      Parse flagpole.yaml for EA features

      Update ea-features.json (add new, remove old)

      Regenerate index.mdx (only features with docsUrl)

      If changes → Create PR for review
      What Requires Manual Review
      When a PR is created, reviewers should:
  • Display names - auto-generated from flag names, may need polish
  • Categories - new features default to "Uncategorized"
  • Documentation links - new features have docsUrl: null; add the path if docs exist

Notes

  • Features with docsUrl: null are tracked in the JSON but do not appear on the docs page
  • The PR body prominently lists undocumented features so reviewers know what needs docs
  • Branch names include timestamp to avoid collision on same-day runs
  • This branch does not also update the EA page. This one: feat(EA): Update Early Adopter features list doc with current EA features #17009 will update to the latest until this PR is merged.

Add automation to detect when EA features change in Flagpole:

- src/data/ea-features.json: Mapping file that maps feature flags to
  display names, documentation links, and categories
- scripts/sync-ea-features.ts: Script that parses Flagpole YAML and
  compares against our mapping file
- .github/workflows/sync-ea-features.yml: Weekly GitHub Action that
  runs the sync and creates issues when new EA features are detected

The workflow:
1. Runs weekly on Mondays at 9am UTC (or manually)
2. Clones sentry-options-automator and parses flagpole.yaml
3. Extracts EA features (enabled, rollout > 0, user-visible)
4. Compares against our mapping file
5. Creates/updates a GitHub issue if new features are found

Usage:
  pnpm ts-node scripts/sync-ea-features.ts [--check-only]

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Mar 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sentry-docs Ready Ready Preview, Comment Mar 18, 2026 11:57pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
develop-docs Ignored Ignored Preview Mar 18, 2026 11:57pm

Request Review

@sfanahata sfanahata changed the title Add automated Early Adopter features sync feat(platform): Add automated Early Adopter features sync to automatically update EA features Mar 17, 2026
@sfanahata sfanahata changed the title feat(platform): Add automated Early Adopter features sync to automatically update EA features feat(platform): Add automated EA features sync to update EA features doc Mar 17, 2026
Shannon Anahata and others added 2 commits March 18, 2026 13:40
Changes:
- Script now supports --update flag to auto-add new features and
  remove old ones from the mapping file
- Script regenerates the MDX documentation page from the mapping
- MDX generation deduplicates features with same name/URL
- GitHub Action now creates a PR (instead of issue) when changes detected
- PR includes review checklist and sync output for easy review

Usage:
  pnpm ts-node scripts/sync-ea-features.ts           # Check only
  pnpm ts-node scripts/sync-ea-features.ts --update  # Update files

The weekly workflow will:
1. Run the sync with --update
2. If files changed, create a PR for review
3. PR includes counts of new/removed/documented/undocumented features
1. Branch name collision: Add timestamp (HHMMSS) to branch name to avoid
   collision if workflow runs multiple times on the same day

2. Silent category omission: Add warning when features have categories
   not in CATEGORY_ORDER, so they won't be silently omitted from MDX
- Extract undocumented features list to separate file
- Display list prominently in PR with explanation that these won't
  appear on docs page until docsUrl is added
- Move full sync output to collapsible details section
1. Add 'set -o pipefail' to workflow so script failures aren't masked
   by piping to tee

2. Only regenerate MDX when mapping file actually changes, preventing
   spurious PRs every week when nothing changed
Updated the EA feature detection logic to exclude features that have
both EA and GA segments. A feature is now only considered EA-exclusive
if it does NOT have any segment that grants access to non-EA orgs.

GA segments are identified as:
- Segments with empty conditions (applies to everyone)
- Segments with only exclusion-based conditions (not_in, not_equals)

This fixes false positives like:
- Query Injection Detection (has GA segment with empty conditions)
- Replay AI Summaries (GA for self-serve, only excluded for enterprise)

The updated logic ensures the EA features page only lists features that
are truly exclusive to Early Adopter organizations.
Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

There are 4 total unresolved issues (including 2 from previous reviews).

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

The traces-page-cross-event-querying flag still exists in Flagpole with
an EA segment, but Trace Explorer itself is GA. Marking docsUrl as null
so it won't appear on the EA features page.
1. Grep pattern now uses emoji prefixes to avoid matching UNDOCUMENTED
   when extracting DOCUMENTED count (e.g., ✅ DOCUMENTED vs 📝 UNDOCUMENTED)

2. Sed command now uses -E flag for extended regex so {60} is interpreted
   as a quantifier, not literal characters

3. MDX is now always regenerated when --update is passed, ensuring metadata
   changes (docsUrl, displayName, category) are reflected even when no
   features are added/removed. Git detects actual changes.
Resolved merge conflict by using the more specific anchor link
from master for the Seer Slack Workflows documentation.
Now checks that EA segments have:
- property: organization_is-early-adopter
- operator: equals
- value: true

This prevents false positives if a segment ever uses value: false
to target non-EA orgs.
Comment on lines +345 to +353
"If you're interested in being an Early Adopter, you can turn your organization's Early Adopter status on/off in **Settings > General Settings**. This will affect all users in your organization and can be turned back off just as easily.",
'',
'![The Early Adopter toggle enabled in settings.](./img/early-adopter-toggle.png)',
'',
'This page lists the features that you\'ll have access to when you opt-in as "Early Adopter". Note that features are sometimes released to early adopters in waves, so you may not see a feature immediately upon enabling the "Early Adopter" setting.',
'',
'Limitations:',
'',
'- This list does not include new features that aren\'t controlled by the "Early Adopter" setting, such as alphas, closed betas, or limited availability features that require manual opt-in.',
Copy link

Choose a reason for hiding this comment

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

Bug: The sync-ea-features.ts script uses a stale, hard-coded template that will overwrite manual edits to the index.mdx file, such as a hyperlink and improved wording.
Severity: MEDIUM

Suggested Fix

Update the hard-coded template within the generateMDX function in scripts/sync-ea-features.ts to match the current, correct content of index.mdx. This includes adding the hyperlink to the settings page and updating the wording. Alternatively, refactor the script to only update the auto-generated list of features, leaving the introductory text untouched.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: scripts/sync-ea-features.ts#L345-L353

Potential issue: The `sync-ea-features.ts` script, when run weekly with the `--update`
flag, regenerates the `index.mdx` documentation file. The `generateMDX` function uses a
hard-coded template for the file's header which is out of date. It lacks a hyperlink to
the settings page and uses older wording compared to the current, manually-improved
`index.mdx` file. Consequently, each time the script runs, it will overwrite these
manual improvements, remove the link, and create a spurious pull request to revert the
documentation to the stale version, causing developer noise and degrading the quality of
the documentation.

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.

1 participant