From 7005300cffa32b3536a140231145cc1159f6b70c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Chmiela?= Date: Tue, 31 Mar 2026 11:44:44 +0200 Subject: [PATCH 1/4] [eas-cli] Fix workflow detection for tracked gitignored files --- .../project/__tests__/workflow-git.test.ts | 59 +++++++++++++++++++ .../src/vcs/clients/__tests__/git.test.ts | 4 +- packages/eas-cli/src/vcs/clients/git.ts | 12 +++- 3 files changed, 70 insertions(+), 5 deletions(-) create mode 100644 packages/eas-cli/src/project/__tests__/workflow-git.test.ts diff --git a/packages/eas-cli/src/project/__tests__/workflow-git.test.ts b/packages/eas-cli/src/project/__tests__/workflow-git.test.ts new file mode 100644 index 0000000000..fe1527be06 --- /dev/null +++ b/packages/eas-cli/src/project/__tests__/workflow-git.test.ts @@ -0,0 +1,59 @@ +import spawnAsync from '@expo/spawn-async'; +import { Platform, Workflow } from '@expo/eas-build-job'; +import fs from 'fs/promises'; +import os from 'os'; +import path from 'path'; + +import GitClient from '../../vcs/clients/git'; +import { resolveWorkflowAsync } from '../workflow'; + +describe('resolveWorkflowAsync with GitClient', () => { + let repoRoot: string; + + beforeEach(async () => { + repoRoot = await fs.mkdtemp(path.join(os.tmpdir(), 'eas-cli-workflow-test-')); + await spawnAsync('git', ['init'], { cwd: repoRoot }); + await spawnAsync('git', ['config', 'user.email', 'test@example.com'], { cwd: repoRoot }); + await spawnAsync('git', ['config', 'user.name', 'Test User'], { cwd: repoRoot }); + }); + + afterEach(async () => { + await fs.rm(repoRoot, { recursive: true, force: true }); + }); + + it('treats tracked gitignored native projects as managed when requireCommit is false', async () => { + const vcsClient = new GitClient({ + requireCommit: false, + maybeCwdOverride: repoRoot, + }); + + await fs.mkdir(path.join(repoRoot, 'ios', 'app.xcodeproj'), { recursive: true }); + await fs.writeFile(path.join(repoRoot, 'ios', 'app.xcodeproj', 'project.pbxproj'), 'fake'); + await fs.writeFile(path.join(repoRoot, '.gitignore'), 'ios/\n'); + + await spawnAsync('git', ['add', '.'], { cwd: repoRoot }); + await spawnAsync('git', ['commit', '-m', 'test setup'], { cwd: repoRoot }); + + await expect(resolveWorkflowAsync(repoRoot, Platform.IOS, vcsClient)).resolves.toBe( + Workflow.MANAGED + ); + }); + + it('treats tracked gitignored native projects as generic when requireCommit is true', async () => { + const vcsClient = new GitClient({ + requireCommit: true, + maybeCwdOverride: repoRoot, + }); + + await fs.mkdir(path.join(repoRoot, 'ios', 'app.xcodeproj'), { recursive: true }); + await fs.writeFile(path.join(repoRoot, 'ios', 'app.xcodeproj', 'project.pbxproj'), 'fake'); + await fs.writeFile(path.join(repoRoot, '.gitignore'), 'ios/\n'); + + await spawnAsync('git', ['add', '.'], { cwd: repoRoot }); + await spawnAsync('git', ['commit', '-m', 'test setup'], { cwd: repoRoot }); + + await expect(resolveWorkflowAsync(repoRoot, Platform.IOS, vcsClient)).resolves.toBe( + Workflow.GENERIC + ); + }); +}); diff --git a/packages/eas-cli/src/vcs/clients/__tests__/git.test.ts b/packages/eas-cli/src/vcs/clients/__tests__/git.test.ts index 4e7fec8cdf..03322346a2 100644 --- a/packages/eas-cli/src/vcs/clients/__tests__/git.test.ts +++ b/packages/eas-cli/src/vcs/clients/__tests__/git.test.ts @@ -91,14 +91,14 @@ describe('git', () => { await fs.rm(`${repoRoot}/.gitignore`); }); - it.each(testFiles.filter(file => file.gitignore && !file.commit))( + it.each(testFiles.filter(file => file.gitignore))( '$filename should be ignored', async file => { expect(await vcs.isFileIgnoredAsync(file.filename)).toBe(true); } ); - it.each(testFiles.filter(file => !file.gitignore || file.commit))( + it.each(testFiles.filter(file => !file.gitignore))( '$filename should not be ignored', async file => { expect(await vcs.isFileIgnoredAsync(file.filename)).toBe(false); diff --git a/packages/eas-cli/src/vcs/clients/git.ts b/packages/eas-cli/src/vcs/clients/git.ts index ffb8140660..4ece6f6a1e 100644 --- a/packages/eas-cli/src/vcs/clients/git.ts +++ b/packages/eas-cli/src/vcs/clients/git.ts @@ -376,12 +376,18 @@ export default class GitClient extends Client { return wouldNotBeCopiedToClone && (!isTracked || wouldBeDeletedFromClone); } - if (isTracked) { - return false; // Tracked files aren't ignored even if they match ignore patterns + if (isTracked && this.requireCommit) { + // With requireCommit=true we rely on a Git checkout, so tracked files are included + // even if they match ignore patterns. + return false; } try { - await spawnAsync('git', ['check-ignore', '-q', filePath], { cwd: rootPath }); + await spawnAsync( + 'git', + ['check-ignore', '-q', ...(this.requireCommit ? [] : ['--no-index']), filePath], + { cwd: rootPath } + ); return true; } catch { return false; From 5ce625e9f2a78541baba9a3773e1d9ef84e3619a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Chmiela?= Date: Tue, 31 Mar 2026 11:54:51 +0200 Subject: [PATCH 2/4] [eas-cli] Add changelog entry for workflow detection fix --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74de427db6..bc4ff9a98e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ This is the log of notable changes to EAS CLI and related packages. - [eas-cli] Fix workflow:logs for builds using built-in EAS build steps. ([#3523](https://github.com/expo/eas-cli/pull/3523) by [@douglowder](https://github.com/douglowder)) - [build-tools][worker] Read Expo app config with `expo config` CLI invocation before falling back to `@expo/config` ([#3536](https://github.com/expo/eas-cli/pull/3536) by [@kitten](https://github.com/kitten)) +- Fix workflow detection for tracked `.gitignore`d native projects when `requireCommit` is disabled. ([#3561](https://github.com/expo/eas-cli/pull/3561) by [@sjchmiela](https://github.com/sjchmiela)) ### ๐Ÿงน Chores @@ -62,7 +63,16 @@ This is the log of notable changes to EAS CLI and related packages. ### ๐Ÿ› Bug fixes - Remove --environment flag requirement for update:configure. ([#3440](https://github.com/expo/eas-cli/pull/3440) by [@douglowder](https://github.com/douglowder)) +<<<<<<< HEAD - Fix login spinner interfering with prompts in `eas go` command when not logged in. ([#3451](https://github.com/expo/eas-cli/pull/3451) by [@byronkarlen](https://github.com/byronkarlen)) +||||||| parent of 59b7829a ([eas-cli] Add changelog entry for workflow detection fix) + +### ๐Ÿงน Chores +======= +- Fix workflow detection for tracked `.gitignore`d native projects when `requireCommit` is disabled. ([#3561](https://github.com/expo/eas-cli/pull/3561) by [@sjchmiela](https://github.com/sjchmiela)) + +### ๐Ÿงน Chores +>>>>>>> 59b7829a ([eas-cli] Add changelog entry for workflow detection fix) ## [18.0.6](https://github.com/expo/eas-cli/releases/tag/v18.0.6) - 2026-02-27 From f366dbec696bd6ad3885666b996a66caed0b8c9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Chmiela?= Date: Tue, 31 Mar 2026 12:09:05 +0200 Subject: [PATCH 3/4] [eas-cli] Fix workflow Git regression test setup --- .../eas-cli/src/project/__tests__/workflow-git.test.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/eas-cli/src/project/__tests__/workflow-git.test.ts b/packages/eas-cli/src/project/__tests__/workflow-git.test.ts index fe1527be06..9c6d49cd14 100644 --- a/packages/eas-cli/src/project/__tests__/workflow-git.test.ts +++ b/packages/eas-cli/src/project/__tests__/workflow-git.test.ts @@ -11,7 +11,9 @@ describe('resolveWorkflowAsync with GitClient', () => { let repoRoot: string; beforeEach(async () => { - repoRoot = await fs.mkdtemp(path.join(os.tmpdir(), 'eas-cli-workflow-test-')); + repoRoot = await fs.realpath( + await fs.mkdtemp(path.join(os.tmpdir(), 'eas-cli-workflow-test-')) + ); await spawnAsync('git', ['init'], { cwd: repoRoot }); await spawnAsync('git', ['config', 'user.email', 'test@example.com'], { cwd: repoRoot }); await spawnAsync('git', ['config', 'user.name', 'Test User'], { cwd: repoRoot }); @@ -31,7 +33,8 @@ describe('resolveWorkflowAsync with GitClient', () => { await fs.writeFile(path.join(repoRoot, 'ios', 'app.xcodeproj', 'project.pbxproj'), 'fake'); await fs.writeFile(path.join(repoRoot, '.gitignore'), 'ios/\n'); - await spawnAsync('git', ['add', '.'], { cwd: repoRoot }); + await spawnAsync('git', ['add', '.gitignore'], { cwd: repoRoot }); + await spawnAsync('git', ['add', '-f', 'ios/app.xcodeproj/project.pbxproj'], { cwd: repoRoot }); await spawnAsync('git', ['commit', '-m', 'test setup'], { cwd: repoRoot }); await expect(resolveWorkflowAsync(repoRoot, Platform.IOS, vcsClient)).resolves.toBe( @@ -49,7 +52,8 @@ describe('resolveWorkflowAsync with GitClient', () => { await fs.writeFile(path.join(repoRoot, 'ios', 'app.xcodeproj', 'project.pbxproj'), 'fake'); await fs.writeFile(path.join(repoRoot, '.gitignore'), 'ios/\n'); - await spawnAsync('git', ['add', '.'], { cwd: repoRoot }); + await spawnAsync('git', ['add', '.gitignore'], { cwd: repoRoot }); + await spawnAsync('git', ['add', '-f', 'ios/app.xcodeproj/project.pbxproj'], { cwd: repoRoot }); await spawnAsync('git', ['commit', '-m', 'test setup'], { cwd: repoRoot }); await expect(resolveWorkflowAsync(repoRoot, Platform.IOS, vcsClient)).resolves.toBe( From 7e912ca078daac9a7c6c0dd45caf3dd8640136da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Chmiela?= Date: Tue, 31 Mar 2026 15:15:44 +0200 Subject: [PATCH 4/4] [eas-cli] Remove changelog conflict markers after rebase --- CHANGELOG.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc4ff9a98e..beeed7cff9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,16 +63,9 @@ This is the log of notable changes to EAS CLI and related packages. ### ๐Ÿ› Bug fixes - Remove --environment flag requirement for update:configure. ([#3440](https://github.com/expo/eas-cli/pull/3440) by [@douglowder](https://github.com/douglowder)) -<<<<<<< HEAD - Fix login spinner interfering with prompts in `eas go` command when not logged in. ([#3451](https://github.com/expo/eas-cli/pull/3451) by [@byronkarlen](https://github.com/byronkarlen)) -||||||| parent of 59b7829a ([eas-cli] Add changelog entry for workflow detection fix) ### ๐Ÿงน Chores -======= -- Fix workflow detection for tracked `.gitignore`d native projects when `requireCommit` is disabled. ([#3561](https://github.com/expo/eas-cli/pull/3561) by [@sjchmiela](https://github.com/sjchmiela)) - -### ๐Ÿงน Chores ->>>>>>> 59b7829a ([eas-cli] Add changelog entry for workflow detection fix) ## [18.0.6](https://github.com/expo/eas-cli/releases/tag/v18.0.6) - 2026-02-27