Skip to content

POC: DRY up Flaky Tests framework pages with shared includes#547

Draft
samgutentag wants to merge 8 commits intomainfrom
samgutentag/ft-dry-up-framework-pages
Draft

POC: DRY up Flaky Tests framework pages with shared includes#547
samgutentag wants to merge 8 commits intomainfrom
samgutentag/ft-dry-up-framework-pages

Conversation

@samgutentag
Copy link
Copy Markdown
Member

Summary

  • Creates try-it-locally.md include (validate command tabs + test upload section) shared across all JUnit XML framework pages
  • Converts jest.md as proof of concept: 137 lines → 51 lines (63% reduction)
  • Adds in-app onboarding callout to Getting Started page
  • Removes duplicate inline CI provider card grid from jest.md

Scope

This is a proof of concept — only jest.md is converted. If the GitBook preview looks correct, the same pattern will be applied to the other ~22 JUnit XML framework pages.

Pages that need custom handling (not this pattern): bazel.md, xctest.md, rspec/

Test plan

  • Preview jest.md in GitBook — verify checklist, retries warning, validate tabs, upload section, and CI provider cards all render correctly
  • Verify image paths resolve (dark/light upload screenshot)
  • Verify links in includes resolve (CI provider cards, quarantining link in retries)

🤖 Generated with Claude Code

samgutentag and others added 4 commits April 14, 2026 01:15
Reference copy of the prompt used in the RemoteTrigger configuration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Design spec, implementation plan, transition plan, and self-contained
prompts for two RemoteTrigger agents:
- Daily scanner: scans trunk2 merged PRs at 4 AM PT, creates docs PRs,
  changelog tickets, and roadmap updates
- Deploy watcher: polls for new deploy tags every 2 hours, runs full
  release-comms pipeline

Both triggers are live on Anthropic cloud infrastructure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pivoted from RemoteTrigger (CCR MCP unavailable) to local crontab.
Both prompts now live in gutils/TRUNK/skills-devrel-pipeline/ and are
symlinked into docs/superpowers/specs/. Transition plan updated with
full state log of the pivot.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Create try-it-locally.md include (validate command tabs + test upload
section) and convert jest.md to use it alongside existing checklist.md,
retries.md, and ci-providers.md includes.

Reduces jest.md from 137 lines to 51 (63% reduction). Also removes the
duplicate inline CI provider card grid that appeared below the include.

Adds in-app onboarding callout to the getting started page for users
who already have a Trunk account.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@trunk-staging-io
Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Apr 14, 2026

Claude finished @samgutentag's task in 2m 23s —— View job


PR Review

  • Read CLAUDE.md for repo-specific guidelines
  • Read changed files
  • Analyze for typos, grammar, formatting, and documentation best practices
  • Post review feedback

Summary

The core changes are well-executed. The try-it-locally.md include is clean, the jest.md refactor is a clear improvement (51 lines vs 137), and the in-app onboarding callout on the Getting Started page is a nice addition. One blocking issue found in the ancillary files.

Blocking

Broken symlinks in docs/superpowers/specs/:

  • daily-scanner-prompt.md/Users/samgutentag/Developer/gutils/TRUNK/skills-devrel-pipeline/daily-scanner.md
  • deploy-watcher-prompt.md/Users/samgutentag/Developer/gutils/TRUNK/skills-devrel-pipeline/deploy-watcher.md

Both symlinks point to absolute paths on the author's local machine and are broken for everyone else. The full prompt content is already documented in the plan file, so these can either be replaced with actual file content or removed entirely.

Non-blocking

  • Image paths in try-it-locally.md (../assets/data-uploads-*.png) need GitBook preview confirmation — the PR test plan already calls this out, just flagging it's a real risk before merge.
  • Code fence inconsistency: validate blocks use ```bash, upload block uses ```sh — minor, suggested standardizing to bash.
  • Onboarding link in README.md goes to https://app.trunk.io root. If a more specific onboarding deep link exists, it'd be a better UX, but this is fine if intentional.

What looks good

  • jest.md{% include %} refactor is clean and the 63% line reduction is real
  • "CI framework" → "CI provider" fix is correct
  • The retries.md include + jest-specific retries note flow reads naturally
  • Removing the inline card grid in favor of the shared ci-providers.md include removes duplication correctly

Comment thread docs/superpowers/specs/daily-scanner-prompt.md Outdated
Comment thread docs/superpowers/specs/deploy-watcher-prompt.md Outdated

You can find your Trunk organization slug and token in the settings or by following these [instructions](https://docs.trunk.io/flaky-tests/get-started/ci-providers/otherci#id-1.-store-a-trunk_token-secret-in-your-ci-system). After your upload, you can verify that Trunk has received and processed it successfully in the **Uploads** tab. Warnings will be displayed if the report has issues.

<figure><picture><source srcset="../assets/data-uploads-dark.png" media="(prefers-color-scheme: dark)"><img src="../assets/data-uploads-light.png" alt=""></picture><figcaption></figcaption></figure>
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.

Image path may not resolve correctly — needs GitBook preview verification.

The paths ../assets/data-uploads-dark.png and ../assets/data-uploads-light.png are relative to this include file's location (.gitbook/includes/), resolving to .gitbook/assets/. This is consistent with the original jest.md paths (../../../.gitbook/assets/...) and should be correct if GitBook resolves relative paths from the include file's location.

However, if GitBook resolves relative paths from the consuming file's location instead, these will break. The PR test plan already calls this out — just confirming the risk is real and requires preview validation before merging.


Before modifying your CI jobs to automatically upload test results to Trunk, try uploading a single test run manually.

```sh
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.

Minor inconsistency: the validate command blocks use ```bash but the upload block uses ```sh. Consider standardizing to bash throughout for consistency.

Suggested change
```sh
```bash

Trunk Flaky Tests detects flaky tests by analyzing test results from your CI runs. Setup requires configuring test result output and CI upload integration.

{% hint style="info" %}
**Interactive setup available** — If you have a Trunk account, the [in-app onboarding guide](https://app.trunk.io) walks you through configuration with instructions tailored to your test framework and CI provider.
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.

The link here goes to https://app.trunk.io (the app root) rather than a specific onboarding URL. If there's a dedicated onboarding page or deep link, using it would give users a more direct path. If the root URL is intentional (because onboarding starts from login), this is fine as-is.

samgutentag and others added 3 commits April 14, 2026 01:26
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- retries.md: fix "retried" → "retries" typo
- checklist.md: fix broken-reference link, change H2 to H3, tighten copy
- ci-providers.md: remove TeamCity card (no page exists, link was broken)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace inline boilerplate (checklist, retries warning, validate/upload
tabs, CI provider card grid) with shared GitBook includes across all
JUnit XML framework pages. Preserves all framework-specific content
(install commands, config snippets, retries notes, troubleshooting).

Reduces total line count by ~2,030 lines across 24 files. Skipped
bazel.md, xctest.md, and rspec/ which need custom handling due to
different report formats.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Apr 14, 2026

Claude finished @samgutentag's task in 2m 11s —— View job


Claude finished @samgutentag's task ——


PR Review

  • Read CLAUDE.md for repo-specific guidelines
  • Check current branch state (symlinks resolved?)
  • Read changed files
  • Analyze for typos, grammar, formatting, and documentation best practices
  • Post review feedback

Summary

The previous blocking issue (broken symlinks in docs/superpowers/specs/) has been fully resolved — both symlinks were removed and the entire docs/superpowers/ directory was untracked in commit 53b56eb. No remaining blocking issues.

The mass conversion of 24 framework pages looks clean. The shared includes are correctly wired, framework-specific content is preserved throughout, and the two bug fixes (retriedretries in retries.md, removal of the broken TeamCity link in ci-providers.md) are both correct.

Non-blocking

Code fence inconsistency in try-it-locally.md (line 65): The upload command block uses ```sh while all four validate blocks above use ```bash. Minor inconsistency — suggested standardizing to bash:

```bash

Image paths (../assets/data-uploads-dark.png / ../assets/data-uploads-light.png): Resolves to .gitbook/assets/ which is the correct location. Still requires GitBook preview confirmation before merging — the PR test plan already calls this out.

What looks good

  • Broken symlinks resolved — docs/superpowers/ fully untracked + gitignored
  • All 24 framework pages correctly use {% include %} for checklist, retries, try-it-locally, and ci-providers
  • Framework-specific content (install commands, config snippets, retries notes, troubleshooting) preserved intact across all files
  • retries.md typo fix ("disable retried" → "disable retries") is correct
  • ci-providers.md correctly removed the broken TeamCity broken-reference link
  • checklist.md wording improvement ("achieve the following before proceeding to the [next steps]" → "complete the following before proceeding to") is cleaner
  • In-app onboarding callout on Getting Started page is a nice addition
  • gotestsum.md keeps its "Why an Extra Step" context block before the checklist — appropriate exception to the pattern given how different Go's setup is

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Auto-approved: Claude code review passed.

Create 3 new includes (stable-branches-hint, stale-files-warning,
platform-hint) and convert all 12 CI provider pages to use them
alongside existing includes (ci-provider-checklist, slug/token,
not-using-github, have-questions).

Fix heading levels in trunk-organization-slug-and include (H2 to H3)
and replace "Ensure" with "Make sure".

Removes ~497 lines of duplicated boilerplate. Provider-specific content
(secrets setup, YAML examples, GitHub Actions quarantining) preserved.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Apr 14, 2026

Claude finished @samgutentag's task in 2m 27s —— View job


Claude finished @samgutentag's task ——


PR Review

  • Read CLAUDE.md for repo-specific guidelines
  • Review changed files for typos, grammar, and formatting
  • Check documentation best practices
  • Post inline review comments
  • Post final review summary

Summary

No blocking issues. The previous blocker (broken symlinks) was resolved in commit 53b56eb. The mass conversion of 24 framework pages and 12 CI provider pages is clean and consistent. Two non-blocking issues remain from the previous review round.

Non-blocking

Code fence inconsistency in try-it-locally.md (line 65): The upload command block uses ```sh while all four validate blocks above use ```bash. Suggestion posted inline — minor but easy to fix.

Image paths (../assets/data-uploads-dark.png / ../assets/data-uploads-light.png): These resolve to .gitbook/assets/ which is the correct location. Still requires GitBook preview confirmation before merging, as the PR test plan calls out.

What looks good

  • Previous blocking issues fully resolved — docs/superpowers/ untracked + gitignored
  • All 24 framework pages and 12 CI provider pages correctly use {% include %} pattern
  • New includes (platform-hint.md, stable-branches-hint.md, stale-files-warning.md) are correctly structured and used across CI provider pages
  • retries.md typo fix ("disable retried" → "disable retries") is correct
  • checklist.md heading level fix (## → ###) and wording improvement are correct
  • "CI framework" → "CI provider" fix is consistent throughout
  • trunk-organization-slug-and....md heading levels updated (## → ###, ### → ####), wording fix ("Ensure" → "Make sure") is correct
  • gotestsum.md appropriately preserves its "Why an Extra Step" context before the checklist
  • In-app onboarding callout on Getting Started page is a useful addition


Before modifying your CI jobs to automatically upload test results to Trunk, try uploading a single test run manually.

```sh
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.

Minor inconsistency (previously flagged, still outstanding): the upload block uses ```sh while all four validate blocks above use ```bash. Suggested fix:

Suggested change
```sh
```bash

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Auto-approved: Claude code review passed.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant