Skip to content

DO NOT MERGE: CI failure drill - #430

Closed
joeycozza wants to merge 4 commits into
frontierMasterfrom
ci-failure-drill
Closed

DO NOT MERGE: CI failure drill#430
joeycozza wants to merge 4 commits into
frontierMasterfrom
ci-failure-drill

Conversation

@joeycozza

Copy link
Copy Markdown

Throwaway. Do not merge. Delete the branch when done.

Deliberately breaks the smoke test so we can watch build-and-publish go red and confirm branch protection blocks the merge.

The break lives entirely in ci.yml — it writes a failing jest test into the scaffolded app right before CI=true npm test. No shipped package code is touched. jest picks it up via testMatch: <rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}.

⚠️ Branch protection isn't wired to the new check yet

frontierMaster currently requires the context Travis CI - Pull Request:

$ gh api repos/fs-webdev/create-react-app/branches/frontierMaster/protection \
    --jq '.required_status_checks.contexts'
["Travis CI - Pull Request"]

So this PR will show as blocked either way — because a required check never reports, not because build-and-publish failed. That makes the drill inconclusive as-is. Swap the required context to build-and-publish first, then re-run this.

Note

The prerelease publish runs before the smoke test, so this branch will still push a junk -prerelease.N version to Artifactory on every run. Normal for any PR build, just worth knowing while deliberately failing things.

🤖 Generated with Claude Code

joeycozza and others added 4 commits August 27, 2026 10:47
Replaces .travis.yml with .github/workflows/ci.yml, preserving all three
things the Travis pipeline did: publish a CI prerelease of
@fs/react-scripts on every run, smoke-test that prerelease by scaffolding
a real app against it, and publish the committed version on
frontierMaster / v7.x / next.

Artifactory auth now comes from actions/setup-node's registry-url instead
of three hand-written .npmrc files. `scope` is deliberately omitted so
setup-node writes a bare `registry=` line and all traffic keeps resolving
through the jfrog virtual registry, preserving curation enforcement.

CI prereleases are relabeled X.Y.Z-prerelease.<run-number>. GITHUB_RUN_NUMBER
restarts at 1, but semver compares alphanumeric prerelease identifiers in
ASCII order and 'T' (84) < 'p' (112), so 8.17.0-prerelease.1 still sorts
above 8.17.0-TravisPrerelease.2311 and the `next` dist-tag does not move
backwards.

Bumps @fs/react-scripts to 8.16.3 so the frontierInit.js change actually
ships; at 8.16.2 npmPublish would no-op.

Also drops upstream Facebook CI config dead since the fork: azure-pipelines*,
.github/workflows/integration.yml, and the Azure badge in README.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
create-react-app's init.js git-inits the app it scaffolds and then commits
it. On a GitHub Actions runner there is no git identity, so the commit
failed with status 128 and init.js deleted the .git directory it had just
created -- a stack trace in the log for no result.

The app scaffolded in CI is a throwaway smoke test that nothing commits or
pushes, so skip the git work entirely there. Gated on a new isFrontierCi()
helper in frontierInit.js, which also de-duplicates the
GITHUB_REPOSITORY check that setupFrontier already made.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Drill to confirm branch protection on frontierMaster actually blocks a
merge when the build-and-publish check goes red.

Writes a failing jest test into the scaffolded app just before the smoke
test runs. jest picks it up via testMatch
`<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}`, and CI=true means a
single non-watch run, so the failure becomes the step's exit code.

Contained entirely in ci.yml -- no shipped package code is touched, so
reverting is deleting one block.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Comment thread .github/workflows/ci.yml
Comment on lines +26 to +93
name: build-and-publish
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4

# Replaces the whole .travis.yml `before_install` block, which hand-wrote
# .npmrc in three places.
#
# No `scope:` on purpose. With a scope, setup-node writes `@fs:registry=`
# and only @fs packages resolve through Artifactory; without one it writes
# a bare `registry=` line, so ALL traffic goes through the jfrog virtual
# registry as it did on Travis. That keeps jfrog curation in play -- see
# the E403 diagnostic in publishPrReleaseAndCreateFreshCraTemplate.js.
#
# setup-node exports NPM_CONFIG_USERCONFIG and NODE_AUTH_TOKEN job-wide,
# so auth survives every later step and every `cd`.
- uses: actions/setup-node@v4
with:
node-version: '24'
registry-url: https://familysearch.jfrog.io/artifactory/api/npm/fs-npm-prod-virtual/
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

# Plain `npm install`, matching Travis. `npm ci` would fail in
# packages/react-scripts, which has no lockfile of its own. The `cd` is
# what Travis did -- `--prefix` has different semantics inside an npm
# workspaces root, so don't "simplify" it.
- name: Install
run: |
set -euo pipefail
npm install
cd packages/react-scripts
npm install

- name: Publish CI prerelease and scaffold a fresh app
run: node publishPrReleaseAndCreateFreshCraTemplate.js

# The scaffolded app lives at $HOME/tmp/fresh-cra-template, hardcoded in
# the script above. `working-directory:` cannot expand $HOME, so cd here.
- name: Smoke test the scaffolded app
run: |
set -euo pipefail
cd "$HOME/tmp/fresh-cra-template"

# ===================================================================
# TEMPORARY -- DO NOT MERGE. Delete this block before merging.
#
# Drill to confirm a red smoke test actually blocks a merge on
# frontierMaster. jest picks this up via testMatch
# `<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}`, and CI=true means
# a single non-watch run, so the failure propagates as the step's
# exit code.
cat > src/IntentionalCiFailure.test.js <<'TESTEOF'
test('intentional failure: branch protection drill', () => {
expect('this build').toBe('intentionally broken')
})
TESTEOF
# ===================================================================

CI=true npm test
npm run build

# Replaces the three identical `deploy: provider: script` entries.
- name: Publish release
if: github.event_name == 'push'
working-directory: packages/react-scripts
run: npm run fs-publish
@joeycozza joeycozza closed this Aug 27, 2026
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