From 7950800ec18b67c0715d0e1bde1cdb5c55694918 Mon Sep 17 00:00:00 2001 From: Byeolchan Kim Date: Sun, 25 May 2025 22:54:36 +0900 Subject: [PATCH 1/4] fix: allow string track names --- packages/eas-json/schema/eas.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eas-json/schema/eas.schema.json b/packages/eas-json/schema/eas.schema.json index a8724609fe..5cf92b9d4b 100644 --- a/packages/eas-json/schema/eas.schema.json +++ b/packages/eas-json/schema/eas.schema.json @@ -512,7 +512,7 @@ "markdownDescription": "Path to the JSON file with service account key used to authenticate with Google Play. [Learn more](https://expo.fyi/creating-google-service-account)" }, "track": { - "enum": ["beta", "alpha", "internal", "production"], + "type": "string", "description": "The track of the application to use. Learn more: https://support.google.com/googleplay/android-developer/answer/9859348?hl=en", "markdownDescription": "The [track of the application](https://support.google.com/googleplay/android-developer/answer/9859348?hl=en) to use.", "markdownEnumDescriptions": [ From 62b58a7f2919b544a405e61d27b9ac87aa98302c Mon Sep 17 00:00:00 2001 From: Byeolchan Kim Date: Mon, 26 May 2025 03:15:24 +0900 Subject: [PATCH 2/4] fix(eas-json): allow any string of 1-50 chars for Android submit track in Joi schema --- packages/eas-json/src/submit/schema.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/eas-json/src/submit/schema.ts b/packages/eas-json/src/submit/schema.ts index a27af46a05..891f729dcb 100644 --- a/packages/eas-json/src/submit/schema.ts +++ b/packages/eas-json/src/submit/schema.ts @@ -4,9 +4,7 @@ import { AndroidReleaseStatus, AndroidReleaseTrack } from './types'; export const AndroidSubmitProfileSchema = Joi.object({ serviceAccountKeyPath: Joi.string(), - track: Joi.string() - .valid(...Object.values(AndroidReleaseTrack)) - .default(AndroidReleaseTrack.internal), + track: Joi.string().min(1).max(50).default(AndroidReleaseTrack.internal), releaseStatus: Joi.string() .valid(...Object.values(AndroidReleaseStatus)) .default(AndroidReleaseStatus.completed), From d1691dfd59772d9be5ff558b42b4a897ddab2ffa Mon Sep 17 00:00:00 2001 From: Byeolchan Kim Date: Mon, 26 May 2025 03:15:33 +0900 Subject: [PATCH 3/4] chore(schema): add minLength and maxLength to Android submit track in eas.schema.json --- packages/eas-json/schema/eas.schema.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/eas-json/schema/eas.schema.json b/packages/eas-json/schema/eas.schema.json index 5cf92b9d4b..2339d2a338 100644 --- a/packages/eas-json/schema/eas.schema.json +++ b/packages/eas-json/schema/eas.schema.json @@ -513,6 +513,8 @@ }, "track": { "type": "string", + "minLength": 1, + "maxLength": 50, "description": "The track of the application to use. Learn more: https://support.google.com/googleplay/android-developer/answer/9859348?hl=en", "markdownDescription": "The [track of the application](https://support.google.com/googleplay/android-developer/answer/9859348?hl=en) to use.", "markdownEnumDescriptions": [ From 728cad03bc912357e432b99b38625ebe1a41ac3c Mon Sep 17 00:00:00 2001 From: Byeolchan Kim Date: Mon, 26 May 2025 03:15:47 +0900 Subject: [PATCH 4/4] test(eas-json): add tests for Android submit track name length validation and defaults --- .../src/__tests__/submitProfiles-test.ts | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/packages/eas-json/src/__tests__/submitProfiles-test.ts b/packages/eas-json/src/__tests__/submitProfiles-test.ts index 8a030c4ae0..b1d7da88a8 100644 --- a/packages/eas-json/src/__tests__/submitProfiles-test.ts +++ b/packages/eas-json/src/__tests__/submitProfiles-test.ts @@ -100,6 +100,99 @@ test('android config with serviceAccountKeyPath set to env var', async () => { } }); +test('android config without track name', async () => { + await fs.writeJson('/project/eas.json', { + submit: { + production: { + android: { + serviceAccountKeyPath: './path.json', + releaseStatus: 'completed', + }, + }, + }, + }); + + const accessor = EasJsonAccessor.fromProjectPath('/project'); + const androidProfile = await EasJsonUtils.getSubmitProfileAsync( + accessor, + Platform.ANDROID, + 'production' + ); + + expect(androidProfile).toEqual({ + serviceAccountKeyPath: './path.json', + track: 'internal', + releaseStatus: 'completed', + changesNotSentForReview: false, + }); +}); + +test('android config with non-empty string track name within 50 characters', async () => { + await fs.writeJson('/project/eas.json', { + submit: { + production: { + android: { + serviceAccountKeyPath: './path.json', + track: 'my-custom-track', + releaseStatus: 'completed', + }, + }, + }, + }); + + const accessor = EasJsonAccessor.fromProjectPath('/project'); + const androidProfile = await EasJsonUtils.getSubmitProfileAsync( + accessor, + Platform.ANDROID, + 'production' + ); + + expect(androidProfile).toEqual({ + serviceAccountKeyPath: './path.json', + track: 'my-custom-track', + changesNotSentForReview: false, + releaseStatus: 'completed', + }); +}); + +test('android config with non-empty string track name over 50 characters', async () => { + await fs.writeJson('/project/eas.json', { + submit: { + production: { + android: { + serviceAccountKeyPath: './path.json', + track: + 'lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua', + releaseStatus: 'completed', + }, + }, + }, + }); + + const accessor = EasJsonAccessor.fromProjectPath('/project'); + const promise = EasJsonUtils.getSubmitProfileAsync(accessor, Platform.ANDROID, 'production'); + + await expect(promise).rejects.toThrow(InvalidEasJsonError); +}); + +test('android config with empty string track value', async () => { + await fs.writeJson('/project/eas.json', { + submit: { + production: { + android: { + serviceAccountKeyPath: './path.json', + track: '', + releaseStatus: 'completed', + }, + }, + }, + }); + + const accessor = EasJsonAccessor.fromProjectPath('/project'); + const promise = EasJsonUtils.getSubmitProfileAsync(accessor, Platform.ANDROID, 'production'); + await expect(promise).rejects.toThrow(InvalidEasJsonError); +}); + test('ios config with all required values', async () => { await fs.writeJson('/project/eas.json', { submit: {