-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ENG-10464][eas-cli] throw error if custom build config is gitignored #2123
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,14 +5,21 @@ import chalk from 'chalk'; | |
import fs from 'fs-extra'; | ||
import path from 'path'; | ||
|
||
import { Client } from '../vcs/vcs'; | ||
|
||
export interface CustomBuildConfigMetadata { | ||
workflowName?: string; | ||
} | ||
|
||
export async function validateCustomBuildConfigAsync( | ||
projectDir: string, | ||
profile: BuildProfile<Platform> | ||
): Promise<CustomBuildConfigMetadata | undefined> { | ||
export async function validateCustomBuildConfigAsync({ | ||
profile, | ||
projectDir, | ||
vcsClient, | ||
}: { | ||
projectDir: string; | ||
profile: BuildProfile<Platform>; | ||
vcsClient: Client; | ||
}): Promise<CustomBuildConfigMetadata | undefined> { | ||
if (!profile.config) { | ||
return undefined; | ||
} | ||
|
@@ -24,6 +31,13 @@ export async function validateCustomBuildConfigAsync( | |
`Custom build configuration file ${chalk.bold(relativeConfigPath)} does not exist.` | ||
); | ||
} | ||
if (await vcsClient.isFileIgnoredAsync(relativeConfigPath)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. May a config file reference other files? Maybe not now, but in the future? Or TypeScript functions? Should we make sure whole There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
https://docs.expo.dev/custom-builds/schema/#import
https://docs.expo.dev/custom-builds/schema/#functionsfunction_namepath
Good question 🤔 I believe that we should fail if the currently used config file is git ignored, but maybe display a warning if other files in |
||
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.` | ||
); | ||
} | ||
|
||
try { | ||
const config = await readAndValidateBuildConfigAsync(configPath, { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️