DO NOT MERGE: CI failure drill - #430
Closed
joeycozza wants to merge 4 commits into
Closed
Conversation
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 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Throwaway. Do not merge. Delete the branch when done.
Deliberately breaks the smoke test so we can watch
build-and-publishgo 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 beforeCI=true npm test. No shipped package code is touched. jest picks it up viatestMatch: <rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}.frontierMastercurrently requires the contextTravis CI - Pull Request:So this PR will show as blocked either way — because a required check never reports, not because
build-and-publishfailed. That makes the drill inconclusive as-is. Swap the required context tobuild-and-publishfirst, then re-run this.Note
The prerelease publish runs before the smoke test, so this branch will still push a junk
-prerelease.Nversion to Artifactory on every run. Normal for any PR build, just worth knowing while deliberately failing things.🤖 Generated with Claude Code