Skip to content

Commit

Permalink
Merge branch 'main' into @evanbacon/submit/fix-testflight-group
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanBacon committed Feb 12, 2025
2 parents fd15853 + 918a7f9 commit d02aa94
Show file tree
Hide file tree
Showing 16 changed files with 213 additions and 107 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:

notify-slack:
runs-on: ubuntu-latest
needs: test
needs: [test]
name: Notify Slack
if: ${{ github.ref == 'refs/heads/main' && always() }}
steps:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ This is the log of notable changes to EAS CLI and related packages.

### 🧹 Chores

- Narrow amount of data queried for basic update channel operations. ([#2901](https://github.com/expo/eas-cli/pull/2901) by [@wschurman](https://github.com/wschurman))

## [15.0.10](https://github.com/expo/eas-cli/releases/tag/v15.0.10) - 2025-02-11

### 🐛 Bug fixes

- Fix files deleted in working directory not being removed from the project archive when `requireCommit` is false. ([#2900](https://github.com/expo/eas-cli/pull/2900) by [@sjchmiela](https://github.com/sjchmiela))

## [15.0.9](https://github.com/expo/eas-cli/releases/tag/v15.0.9) - 2025-02-09

### 🐛 Bug fixes
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"npmClient": "yarn",
"version": "15.0.9",
"version": "15.0.10",
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}
148 changes: 74 additions & 74 deletions packages/eas-cli/README.md

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions packages/eas-cli/graphql.schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/eas-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "eas-cli",
"description": "EAS command line tool",
"version": "15.0.9",
"version": "15.0.10",
"author": "Expo <[email protected]>",
"bin": {
"eas": "./bin/run"
Expand Down
2 changes: 1 addition & 1 deletion packages/eas-cli/src/channel/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ export async function doesChannelExistAsync(
{ appId, channelName }: { appId: string; channelName: string }
): Promise<boolean> {
try {
await ChannelQuery.viewUpdateChannelAsync(graphqlClient, {
await ChannelQuery.viewUpdateChannelBasicInfoAsync(graphqlClient, {
appId,
channelName,
});
Expand Down
2 changes: 1 addition & 1 deletion packages/eas-cli/src/commands/channel/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default class ChannelDelete extends EasCommand {

let channelId, channelName;
if (nameArg) {
const { id, name } = await ChannelQuery.viewUpdateChannelAsync(graphqlClient, {
const { id, name } = await ChannelQuery.viewUpdateChannelBasicInfoAsync(graphqlClient, {
appId: projectId,
channelName: nameArg,
});
Expand Down
2 changes: 1 addition & 1 deletion packages/eas-cli/src/commands/channel/edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default class ChannelEdit extends EasCommand {
}

const existingChannel = args.name
? await ChannelQuery.viewUpdateChannelAsync(graphqlClient, {
? await ChannelQuery.viewUpdateChannelBasicInfoAsync(graphqlClient, {
appId: projectId,
channelName: args.name,
})
Expand Down
2 changes: 1 addition & 1 deletion packages/eas-cli/src/commands/channel/pause.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default class ChannelPause extends EasCommand {
}

const existingChannel = args.name
? await ChannelQuery.viewUpdateChannelAsync(graphqlClient, {
? await ChannelQuery.viewUpdateChannelBasicInfoAsync(graphqlClient, {
appId: projectId,
channelName: args.name,
})
Expand Down
2 changes: 1 addition & 1 deletion packages/eas-cli/src/commands/channel/resume.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default class ChannelResume extends EasCommand {
}

const existingChannel = args.name
? await ChannelQuery.viewUpdateChannelAsync(graphqlClient, {
? await ChannelQuery.viewUpdateChannelBasicInfoAsync(graphqlClient, {
appId: projectId,
channelName: args.name,
})
Expand Down
9 changes: 8 additions & 1 deletion packages/eas-cli/src/graphql/generated.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions packages/eas-cli/src/graphql/queries/ChannelQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { withErrorHandlingAsync } from '../client';
import {
UpdateBranchBasicInfoFragment,
UpdateFragment,
ViewUpdateChannelBasicInfoOnAppQuery,
ViewUpdateChannelBasicInfoOnAppQueryVariables,
ViewUpdateChannelOnAppQuery,
ViewUpdateChannelOnAppQueryVariables,
ViewUpdateChannelsOnAppQuery,
Expand Down Expand Up @@ -41,6 +43,42 @@ export function composeUpdateBranchObject(
}

export const ChannelQuery = {
async viewUpdateChannelBasicInfoAsync(
graphqlClient: ExpoGraphqlClient,
{ appId, channelName }: ViewUpdateChannelBasicInfoOnAppQueryVariables
): Promise<
NonNullable<ViewUpdateChannelBasicInfoOnAppQuery['app']['byId']['updateChannelByName']>
> {
const response = await withErrorHandlingAsync(
graphqlClient
.query<ViewUpdateChannelBasicInfoOnAppQuery, ViewUpdateChannelBasicInfoOnAppQueryVariables>(
gql`
query ViewUpdateChannelBasicInfoOnApp($appId: String!, $channelName: String!) {
app {
byId(appId: $appId) {
id
updateChannelByName(name: $channelName) {
id
...UpdateChannelBasicInfoFragment
}
}
}
}
${print(UpdateChannelBasicInfoFragmentNode)}
`,
{ appId, channelName },
{ additionalTypenames: ['UpdateChannel', 'UpdateBranch', 'Update'] }
)
.toPromise()
);

const { updateChannelByName } = response.app.byId;
if (!updateChannelByName) {
throw new ChannelNotFoundError(`Could not find channel with the name ${channelName}`);
}

return updateChannelByName;
},
async viewUpdateChannelAsync(
graphqlClient: ExpoGraphqlClient,
{ appId, channelName, filter }: ViewUpdateChannelOnAppQueryVariables
Expand Down
2 changes: 1 addition & 1 deletion packages/eas-cli/src/project/customBuildConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export async function validateCustomBuildConfigAsync({
throw new Error(
`Custom build configuration file ${chalk.bold(
relativeConfigPath
)} is ignored by your version control system. Remove it from the ignore list to successfully create custom build.`
)} is ignored by your version control system or .easignore. Remove it from the ignore list to successfully create custom build.`
);
}

Expand Down
79 changes: 63 additions & 16 deletions packages/eas-cli/src/vcs/clients/__tests__/git.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,31 +131,78 @@ describe('git', () => {
);
});
});

it('is able to delete a submodule ignored by .easignore', async () => {
const repoRoot = await fs.mkdtemp(path.join(os.tmpdir(), 'eas-cli-git-test-'));
await spawnAsync('git', ['init'], { cwd: repoRoot });
const vcs = new GitClient({
requireCommit: false,
maybeCwdOverride: repoRoot,
});

await spawnAsync(
'git',
['submodule', 'add', 'https://github.com/expo/results.git', 'results'],
{ cwd: repoRoot }
);
await spawnAsync('git', ['add', 'results'], { cwd: repoRoot });
await spawnAsync('git', ['commit', '-m', 'add submodule'], { cwd: repoRoot });

const repoCloneNonIgnored = await fs.mkdtemp(path.join(os.tmpdir(), 'eas-cli-git-test-'));
await expect(vcs.makeShallowCopyAsync(repoCloneNonIgnored)).resolves.not.toThrow();
await expect(fs.stat(path.join(repoCloneNonIgnored, 'results'))).resolves.not.toThrow();

await fs.writeFile(`${repoRoot}/.easignore`, 'results');
const repoCloneIgnored = await fs.mkdtemp(path.join(os.tmpdir(), 'eas-cli-git-test-'));
await expect(vcs.makeShallowCopyAsync(repoCloneIgnored)).resolves.not.toThrow();
await expect(fs.stat(path.join(repoCloneIgnored, 'results'))).rejects.toThrow('ENOENT');
});
});

it('is able to delete a submodule ignored by .easignore', async () => {
it('does not include files that have been removed in the working directory', async () => {
const repoRoot = await fs.mkdtemp(path.join(os.tmpdir(), 'eas-cli-git-test-'));
await spawnAsync('git', ['init'], { cwd: repoRoot });
const vcs = new GitClient({
requireCommit: false,
maybeCwdOverride: repoRoot,
});

await spawnAsync(
'git',
['submodule', 'add', 'https://github.com/expo/results.git', 'results'],
{ cwd: repoRoot }
await fs.writeFile(`${repoRoot}/committed-file.txt`, 'file');
await fs.writeFile(`${repoRoot}/file-to-remove.txt`, 'file');
await spawnAsync('git', ['add', 'committed-file.txt', 'file-to-remove.txt'], {
cwd: repoRoot,
});
await spawnAsync('git', ['commit', '-m', 'add files'], { cwd: repoRoot });

await fs.rm(`${repoRoot}/file-to-remove.txt`);
await spawnAsync('git', ['add', 'file-to-remove.txt'], { cwd: repoRoot });
await spawnAsync('git', ['commit', '-m', 'remove file'], { cwd: repoRoot });

await fs.writeFile(`${repoRoot}/new-file.txt`, 'file');
await fs.writeFile(`${repoRoot}/new-tracked-file.txt`, 'file');

const repoClone = await fs.mkdtemp(path.join(os.tmpdir(), 'eas-cli-git-test-'));
await expect(vcs.makeShallowCopyAsync(repoClone)).resolves.not.toThrow();
await expect(fs.stat(path.join(repoClone, 'file-to-remove.txt'))).rejects.toThrow('ENOENT');
await expect(fs.stat(path.join(repoClone, 'committed-file.txt'))).resolves.not.toThrow();
await expect(fs.stat(path.join(repoClone, 'new-file.txt'))).resolves.not.toThrow();
await expect(fs.stat(path.join(repoClone, 'new-tracked-file.txt'))).resolves.not.toThrow();

vcs.requireCommit = true;
await spawnAsync('git', ['add', '.'], { cwd: repoRoot });
await spawnAsync('git', ['commit', '-m', 'tmp commit'], { cwd: repoRoot });

const requireCommitClone = await fs.mkdtemp(path.join(os.tmpdir(), 'eas-cli-git-test-'));
await expect(vcs.makeShallowCopyAsync(requireCommitClone)).resolves.not.toThrow();
await expect(fs.stat(path.join(requireCommitClone, 'file-to-remove.txt'))).rejects.toThrow(
'ENOENT'
);
await spawnAsync('git', ['add', 'results'], { cwd: repoRoot });
await spawnAsync('git', ['commit', '-m', 'add submodule'], { cwd: repoRoot });

const repoCloneNonIgnored = await fs.mkdtemp(path.join(os.tmpdir(), 'eas-cli-git-test-'));
await expect(vcs.makeShallowCopyAsync(repoCloneNonIgnored)).resolves.not.toThrow();
await expect(fs.stat(path.join(repoCloneNonIgnored, 'results'))).resolves.not.toThrow();

await fs.writeFile(`${repoRoot}/.easignore`, 'results');
const repoCloneIgnored = await fs.mkdtemp(path.join(os.tmpdir(), 'eas-cli-git-test-'));
await expect(vcs.makeShallowCopyAsync(repoCloneIgnored)).resolves.not.toThrow();
await expect(fs.stat(path.join(repoCloneIgnored, 'results'))).rejects.toThrow('ENOENT');
await expect(
fs.stat(path.join(requireCommitClone, 'committed-file.txt'))
).resolves.not.toThrow();
await expect(fs.stat(path.join(requireCommitClone, 'new-file.txt'))).resolves.not.toThrow();
await expect(
fs.stat(path.join(requireCommitClone, 'new-tracked-file.txt'))
).resolves.not.toThrow();
});
});
14 changes: 13 additions & 1 deletion packages/eas-cli/src/vcs/clients/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,19 @@ export default class GitClient extends Client {
await setGitCaseSensitivityAsync(true, rootPath);
await spawnAsync(
'git',
['clone', '--no-hardlinks', '--depth', '1', gitRepoUri, destinationPath],
[
'clone',
// If we do not require a commit, we are going to later
// copy the working directory into the destination path,
// so we can skip the checkout step (which also adds files
// that have been removed in the working directory).
this.requireCommit ? null : '--no-checkout',
'--no-hardlinks',
'--depth',
'1',
gitRepoUri,
destinationPath,
].flatMap(e => e ?? []),
{ cwd: rootPath }
);

Expand Down

0 comments on commit d02aa94

Please sign in to comment.