force rebuild on isOnboarding and uncommitted changes
MODIFY
bin-src/tasks/auth.ts
bin-src/tasks/auth.ts
@@ -8,9 +8,22 @@ const CreateAppTokenMutation = `
createAppToken(code: $projectToken)
}
`;
+
+const AppByCodeQuery = `
+ query AppyByCodeQuery($code: String!) {
+ appByCode(code: $code) {
+ isOnboarding
+ }
+ }
+`;
interface CreateAppTokenMutationResult {
createAppToken: string;
}
+interface AppyByCodeQueryResult {
+ appByCode: {
+ isOnboarding: boolean;
+ };
+}
export const setAuthorizationToken = async (ctx: Context) => {
const { client, options } = ctx;
@@ -22,6 +35,10 @@ export const setAuthorizationToken = async (ctx: Context) => {
variables
);
client.setAuthorization(appToken);
+ const { appByCode: app } = await ctx.client.runQuery<AppyByCodeQueryResult>(AppByCodeQuery, {
+ code: ctx.options.projectToken,
+ });
+ ctx.isOnboarding = app.isOnboarding;
} catch (errors) {
if (errors[0] && errors[0].message && errors[0].message.match('No app with code')) {
throw new Error(invalidProjectToken(variables));

MODIFY
bin-src/tasks/gitInfo.ts
bin-src/tasks/gitInfo.ts
@@ -164,6 +164,10 @@ export const setGitInfo = async (ctx: Context, task: Task) => {
ctx.log.debug(e);
}
+ if (ctx.isOnboarding && ctx.git.changedFiles && ctx.git.changedFiles.length) {
+ ctx.options.forceRebuild = true;
+ }
+
if (ctx.options.externals && ctx.git.changedFiles && ctx.git.changedFiles.length) {
// eslint-disable-next-line no-restricted-syntax
for (const glob of ctx.options.externals) {

MODIFY
bin-src/tasks/verify.ts
bin-src/tasks/verify.ts
@@ -176,7 +176,6 @@ export const createBuild = async (ctx: Context, task: Task) => {
ctx.build = build;
ctx.isPublishOnly = !build.features.uiReview && !build.features.uiTests;
- ctx.isOnboarding = build.number === 1 || (build.autoAcceptChanges && !autoAcceptChanges);
if (list) {
ctx.log.info(listingStories(build.tests));

force rebuild on isOnboarding and uncommitted changes