Skip to content

Commit 8c34b2d

Browse files
sfanahataShannon Anahataclaudegetsantry[bot]
authored
feat(platform): Add automated EA features sync to update EA features doc (#17011)
### 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 2. 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 3. GitHub Action (.github/workflows/sync-ea-features.yml) Schedule: Weekly on Mondays at 9am UTC (or manual trigger) Workflow: 1. Clones sentry-options-automator and parses Flagpole 2. Runs sync with --update to apply changes 3. 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: #17009 will update to the latest until this PR is merged. --------- Co-authored-by: Shannon Anahata <shannonanahata@gmail.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
1 parent a666f9d commit 8c34b2d

4 files changed

Lines changed: 795 additions & 4 deletions

File tree

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
name: Sync Early Adopter Features
2+
3+
on:
4+
# Run weekly on Mondays at 9am UTC
5+
schedule:
6+
- cron: '0 9 * * 1'
7+
# Allow manual trigger
8+
workflow_dispatch:
9+
10+
jobs:
11+
sync-ea-features:
12+
runs-on: ubuntu-latest
13+
name: 'Sync EA Features from Flagpole'
14+
steps:
15+
- uses: actions/checkout@v4.1.1
16+
17+
- name: Get auth token
18+
id: token
19+
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
20+
with:
21+
app-id: ${{ vars.SENTRY_INTERNAL_APP_ID }}
22+
private-key: ${{ secrets.SENTRY_INTERNAL_APP_PRIVATE_KEY }}
23+
24+
- name: Setup pnpm
25+
uses: pnpm/action-setup@v4
26+
with:
27+
version: 9
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: '22'
33+
cache: 'pnpm'
34+
35+
- name: Install dependencies
36+
run: pnpm install --frozen-lockfile
37+
38+
- name: Clone sentry-options-automator
39+
env:
40+
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
41+
run: |
42+
git clone --depth 1 https://x-access-token:${GITHUB_TOKEN}@github.com/getsentry/sentry-options-automator.git /tmp/sentry-options-automator-sync
43+
44+
- name: Run EA features sync with update
45+
id: sync
46+
run: |
47+
set -o pipefail
48+
# Run sync and capture output (pipefail ensures we catch script failures)
49+
pnpm ts-node scripts/sync-ea-features.ts --update 2>&1 | tee sync-output.txt
50+
51+
# Check if any files changed
52+
if git diff --quiet; then
53+
echo "has_changes=false" >> $GITHUB_OUTPUT
54+
echo "No changes detected"
55+
else
56+
echo "has_changes=true" >> $GITHUB_OUTPUT
57+
echo "Changes detected"
58+
59+
# Extract counts for PR description (use emoji prefix to avoid UNDOCUMENTED matching DOCUMENTED)
60+
new_count=$(grep -oP '(?<=❌ NEW UNMAPPED FEATURES \()[0-9]+' sync-output.txt || echo "0")
61+
removed_count=$(grep -oP '(?<=⚠️ REMOVED FEATURES \()[0-9]+' sync-output.txt || echo "0")
62+
documented_count=$(grep -oP '(?<=✅ DOCUMENTED EA FEATURES \()[0-9]+' sync-output.txt || echo "0")
63+
undocumented_count=$(grep -oP '(?<=📝 UNDOCUMENTED EA FEATURES \()[0-9]+' sync-output.txt || echo "0")
64+
65+
echo "new_count=$new_count" >> $GITHUB_OUTPUT
66+
echo "removed_count=$removed_count" >> $GITHUB_OUTPUT
67+
echo "documented_count=$documented_count" >> $GITHUB_OUTPUT
68+
echo "undocumented_count=$undocumented_count" >> $GITHUB_OUTPUT
69+
70+
# Extract undocumented features list for PR body (use -E for extended regex)
71+
sed -E -n '/UNDOCUMENTED EA FEATURES/,/={60}/p' sync-output.txt | grep "^ - " | sed 's/^ //' > undocumented-features.txt || true
72+
fi
73+
74+
- name: Create Pull Request
75+
if: steps.sync.outputs.has_changes == 'true'
76+
env:
77+
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
78+
run: |
79+
git config user.email "bot@getsentry.com"
80+
git config user.name "getsentry-bot"
81+
82+
# Create branch with timestamp to avoid collisions on same-day runs
83+
branch="bot/sync-ea-features-$(date +%Y%m%d-%H%M%S)"
84+
git checkout -b "$branch"
85+
86+
# Stage changes
87+
git add src/data/ea-features.json docs/organization/early-adopter-features/index.mdx
88+
89+
# Commit
90+
git commit -m "Sync Early Adopter features from Flagpole
91+
92+
Automated sync detected changes in EA features:
93+
- New features added: ${{ steps.sync.outputs.new_count }}
94+
- Removed features: ${{ steps.sync.outputs.removed_count }}
95+
- Documented features: ${{ steps.sync.outputs.documented_count }}
96+
- Undocumented features: ${{ steps.sync.outputs.undocumented_count }}"
97+
98+
# Push
99+
git push --set-upstream origin "$branch"
100+
101+
# Create PR
102+
gh pr create \
103+
--title "Sync Early Adopter features from Flagpole" \
104+
--label "ea-features-sync" \
105+
--body "$(cat <<EOF
106+
## Summary
107+
108+
Automated weekly sync detected changes in Early Adopter features from Flagpole configuration.
109+
110+
### Changes
111+
112+
| Metric | Count |
113+
|--------|-------|
114+
| New features added | ${{ steps.sync.outputs.new_count }} |
115+
| Removed features | ${{ steps.sync.outputs.removed_count }} |
116+
| Documented features | ${{ steps.sync.outputs.documented_count }} |
117+
| Undocumented features | ${{ steps.sync.outputs.undocumented_count }} |
118+
119+
### Undocumented EA Features
120+
121+
The following EA features do not have documentation links and **will not appear on the docs page** until \`docsUrl\` is added:
122+
123+
$(if [ -s undocumented-features.txt ]; then cat undocumented-features.txt; else echo "(none)"; fi)
124+
125+
> **Note:** To add a feature to the docs page, edit \`src/data/ea-features.json\` and set the \`docsUrl\` field to the documentation path.
126+
127+
<details>
128+
<summary>Full Sync Output</summary>
129+
130+
\`\`\`
131+
$(cat sync-output.txt)
132+
\`\`\`
133+
134+
</details>
135+
136+
### Review Checklist
137+
138+
- [ ] Review new feature display names (auto-generated from flag names)
139+
- [ ] Assign appropriate categories to new features
140+
- [ ] Add documentation links for undocumented features (if docs exist)
141+
- [ ] Verify removed features should actually be removed
142+
143+
### How to update feature metadata
144+
145+
Edit \`src/data/ea-features.json\` to update:
146+
- \`displayName\`: Human-readable name
147+
- \`docsUrl\`: Link to documentation (or \`null\` if none exists)
148+
- \`category\`: Feature category for grouping
149+
150+
---
151+
*This PR was automatically created by the [EA Features Sync workflow](https://github.com/getsentry/sentry-docs/actions/workflows/sync-ea-features.yml).*
152+
EOF
153+
)"
154+
155+
- name: Summary
156+
run: |
157+
echo "## EA Features Sync Summary" >> $GITHUB_STEP_SUMMARY
158+
echo "" >> $GITHUB_STEP_SUMMARY
159+
if [ "${{ steps.sync.outputs.has_changes }}" == "true" ]; then
160+
echo "### Changes Detected" >> $GITHUB_STEP_SUMMARY
161+
echo "" >> $GITHUB_STEP_SUMMARY
162+
echo "| Metric | Count |" >> $GITHUB_STEP_SUMMARY
163+
echo "|--------|-------|" >> $GITHUB_STEP_SUMMARY
164+
echo "| New features added | ${{ steps.sync.outputs.new_count }} |" >> $GITHUB_STEP_SUMMARY
165+
echo "| Removed features | ${{ steps.sync.outputs.removed_count }} |" >> $GITHUB_STEP_SUMMARY
166+
echo "| Documented features | ${{ steps.sync.outputs.documented_count }} |" >> $GITHUB_STEP_SUMMARY
167+
echo "| Undocumented features | ${{ steps.sync.outputs.undocumented_count }} |" >> $GITHUB_STEP_SUMMARY
168+
echo "" >> $GITHUB_STEP_SUMMARY
169+
echo "A PR has been created with the changes." >> $GITHUB_STEP_SUMMARY
170+
else
171+
echo "✅ No changes detected. All EA features are in sync!" >> $GITHUB_STEP_SUMMARY
172+
fi

docs/organization/early-adopter-features/index.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@ description: Learn which features are currently in the early adopter phase.
55
og_image: /og-images/organization-early-adopter-features.png
66
---
77

8-
If youre interested in being an Early Adopter, you can turn your organizations 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.
8+
If you're interested in being an Early Adopter, you can turn your organization's Early Adopter status on/off in [**Settings > General Settings**](https://sentry.io/orgredirect/organizations/:orgslug/settings/organization/#isEarlyAdopter). This will affect all users in your organization and can be turned back off just as easily.
99

1010
![The Early Adopter toggle enabled in settings.](./img/early-adopter-toggle.png)
1111

1212
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.
1313

1414
Limitations:
1515

16-
- 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.
17-
- This list is not guaranteed to be 100% up-to-date, but it is monitored and updated frequently.
16+
- This list only includes new features controlled by the "Early Adopter" organiation setting. Alphas, closed betas, or limited availability features that require manual opt-in are not included.
17+
18+
{/* AUTO-GENERATED CONTENT BELOW - DO NOT EDIT MANUALLY */}
19+
{/* Run: pnpm ts-node scripts/sync-ea-features.ts --update */}
1820

1921
## Current Early Adopter Features
2022

@@ -24,4 +26,4 @@ Limitations:
2426

2527
### Dashboards
2628

27-
- [Prebuilt Sentry Dashboards](/product/dashboards/sentry-dashboards/)
29+
- [Prebuilt Sentry Dashboards](/product/dashboards/sentry-dashboards/)

0 commit comments

Comments
 (0)