Skip to content

Merge upstream/main, resolve Action-refactor conflicts - #8

Merged
StasDoskalenko merged 4 commits into
mainfrom
merge/upstream-main
Aug 31, 2026
Merged

StasDoskalenko merged 4 commits into
mainfrom
merge/upstream-main

Conversation

@StasDoskalenko

Copy link
Copy Markdown
Owner

Brings main up to date with callstackincubator/react-native-harness and resolves the conflicts the upstream Action refactor created for the Windows support work (upstream PR callstackincubator#187).

What upstream changed

How the conflicts were resolved

All conflicts were in the Action files.

  • packages/github-action/** and actions/**: took upstream's deletion.
  • action.yml: took upstream's new CLI-based steps. The ${{ github.action_path }} quoting fix from the original work is dropped, since there are no bundled scripts to invoke anymore. The three Windows-specific bits merged onto the new structure cleanly and are kept: windows exempt from the "app input required" check, the Windows section comment, and pwd -W for HARNESS_PROJECT_ROOT.

One new fix

packages/cli/src/ci/workspace-root.ts: the new harness ci load-config writes projectRoot= to GITHUB_OUTPUT straight from path.relative, so on a Windows runner it emitted apps\foo. The Action feeds that into actions/cache globs, hashFiles(), and a bash working-directory, which want /. Its own test (load-config.test.ts) fails on a Windows host. Normalized the separator. No behavior change on Linux/macOS.

Verification

  • nx run-many -t typecheck build lint green for all 22 projects.
  • nx run-many -t test green on both Linux and a Windows host.
  • Ran react-native-harness ci load-config on Windows against a real RNW project config (mrousavy/nitro's example); platformId: windows resolves and the projectRoot output is correct.

After this merges, upstream PR callstackincubator#187 stops conflicting.

V3RON and others added 4 commits August 31, 2026 10:18
…r#185)

## What is this?

The React Native Harness GitHub Action no longer ships bundled
JavaScript. Its four Node steps — config loading and the three Metro
cache planning steps — now run through the `react-native-harness` CLI
already installed in the project under test, via a new `harness ci
<subcommand>` command group.

Previously those steps ran prebuilt `actions/shared/*.cjs` files
committed to the repository. Because the bundler inlined
`@react-native-harness/config`, `@react-native-harness/cache`, and
`@react-native-harness/platform-android`, any change to those packages
rewrote roughly 628KB of committed output across four near-identical
bundles. Contributors had to remember to rebuild and commit them, and
regularly did not.

## How does it work?

`harness ci` exposes `load-config`, `plan-metro-restore`,
`snapshot-metro`, and `plan-metro-save`, each a direct move of the
corresponding action script with its environment-variable and
`GITHUB_OUTPUT` contract unchanged. The composite action calls them
through the detected package manager, the same way it already invokes
the CLI to run tests, so the scripts now come from the same package
version that will run the suite rather than from a snapshot pinned to
the action ref.

Two ordering changes support this. Package manager detection moves to
the first step, since it is needed to invoke the CLI at all. A version
guard follows it: on a CLI predating `harness ci`, the subcommand would
fall through to the Jest CLI and be read as a test path pattern, so the
action resolves the installed version up front and fails with an
explicit message when it is missing or older than the release that
introduces the command.

Because those steps now run with `working-directory` set to the project
root, path handling is anchored to `GITHUB_WORKSPACE` rather than the
current directory. `INPUT_PROJECTROOT` and the emitted `projectRoot`
stay relative to the checkout root, which is what `actions/cache`,
`actions/upload-artifact`, and `hashFiles(...)` resolve against
regardless of a step's working directory.

The `@react-native-harness/github-action` package and the `actions/`
directory are removed, and its README moves to `docs/github-action.md`.
`packages/cli` gains a test target it previously lacked, so the moved
cache tests and the package's two existing suites now run in CI.

## Why is this useful?

No generated code remains in the repository, so the rebuild-and-commit
step disappears along with the class of pull request that silently ships
a stale bundle. Changes to config parsing or cache key computation take
effect through the normal package graph, and reviewers see the actual
diff instead of hundreds of kilobytes of bundler output. Consumers of
the action get scripts that match their installed Harness version, with
a clear failure when the two drift apart.
## What is this?

Introduces a filesystem context for Harness and applies it to the GitHub
Action so its filesystem-dependent behavior can be tested without host
temporary directories.

## How does it work?

`@react-native-harness/tools` now provides an AsyncLocalStorage-backed
context, a real Node filesystem default, and a memfs-powered testing
helper. The GitHub Action establishes that context at its entrypoints,
uses `getFs()` in migrated code, and keeps runner logic separately
callable under an in-memory filesystem.

## Why is this useful?

Action tests become hermetic and faster to reason about, while the new
port creates a consistent path for incrementally migrating the remaining
Harness filesystem usage.

Closes callstackincubator#165
Resolves conflicts from the GitHub Action refactor (callstackincubator#185, deleted the
bundled actions/*.cjs and packages/github-action, moved the steps to a
'harness ci' CLI subcommand). The Windows-specific action.yml changes
(windows exempt from the app-input check, pwd -W for HARNESS_PROJECT_ROOT)
carry over; the github.action_path quoting fix is obsolete now that the
action no longer runs bundled scripts.
`harness ci load-config` writes `projectRoot=` to GITHUB_OUTPUT from a raw
`path.relative`, which is `apps\foo` on a Windows runner. The action feeds
that into `actions/cache` globs, `hashFiles()`, and a bash
`working-directory`, all of which want `/`. Normalize the separator.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@StasDoskalenko
StasDoskalenko merged commit 608b925 into main Aug 31, 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