diff --git a/core/cli/test/files/conflict-resolution/.toolkitrc.yml b/core/cli/test/files/conflict-resolution/.toolkitrc.yml index 6bf88a62a..af7e6425a 100644 --- a/core/cli/test/files/conflict-resolution/.toolkitrc.yml +++ b/core/cli/test/files/conflict-resolution/.toolkitrc.yml @@ -8,7 +8,6 @@ options: plugins: '@dotcom-tool-kit/heroku': pipeline: tool-kit-test - systemCode: tool-kit-test '@dotcom-tool-kit/doppler': project: tool-kit-test tasks: diff --git a/core/cli/test/files/duplicate/.toolkitrc.yml b/core/cli/test/files/duplicate/.toolkitrc.yml index aa7925b18..2a1aa7419 100644 --- a/core/cli/test/files/duplicate/.toolkitrc.yml +++ b/core/cli/test/files/duplicate/.toolkitrc.yml @@ -6,7 +6,6 @@ options: plugins: '@dotcom-tool-kit/heroku': pipeline: tool-kit-test - systemCode: tool-kit-test '@dotcom-tool-kit/doppler': project: tool-kit-test diff --git a/lib/schemas/src/plugins/heroku.ts b/lib/schemas/src/plugins/heroku.ts index fdcd995eb..a0a02ae80 100644 --- a/lib/schemas/src/plugins/heroku.ts +++ b/lib/schemas/src/plugins/heroku.ts @@ -6,11 +6,6 @@ export const HerokuSchema = z.object({ .string() .describe( "the ID of your app's Heroku pipeline. this can be found at https://dashboard.heroku.com/pipelines/[PIPELINE_ID]" - ), - systemCode: z - .string() - .describe( - "your app's Biz Ops system code. this can be found at https://biz-ops.in.ft.com/System/[SYSTEM_CODE]" ) }) @@ -18,6 +13,5 @@ export type HerokuOptions = z.infer export const Schema = HerokuSchema export const generators: PromptGenerators = { - pipeline: async (logger, prompt, onCancel, bizOpsSystem) => bizOpsSystem?.herokuApps[0]?.pipelineName, - systemCode: async (logger, prompt, onCancel, bizOpsSystem) => bizOpsSystem?.code + pipeline: async (logger, prompt, onCancel, bizOpsSystem) => bizOpsSystem?.herokuApps[0]?.pipelineName } diff --git a/plugins/heroku/readme.md b/plugins/heroku/readme.md index 9dbac5ec2..516e4c32a 100644 --- a/plugins/heroku/readme.md +++ b/plugins/heroku/readme.md @@ -70,10 +70,9 @@ Scale down the Heroku staging app once it's no longer needed. ### `@dotcom-tool-kit/heroku` -| Property | Description | Type | -| :-------------------- | :-------------------------------------------------------------------------------------------------------------- | :------- | -| **`pipeline`** (\*) | the ID of your app's Heroku pipeline. this can be found at https://dashboard.heroku.com/pipelines/[PIPELINE_ID] | `string` | -| **`systemCode`** (\*) | your app's Biz Ops system code. this can be found at https://biz-ops.in.ft.com/System/[SYSTEM_CODE] | `string` | +| Property | Description | Type | +| :------------------ | :-------------------------------------------------------------------------------------------------------------- | :------- | +| **`pipeline`** (\*) | the ID of your app's Heroku pipeline. this can be found at https://dashboard.heroku.com/pipelines/[PIPELINE_ID] | `string` | _(\*) Required._ diff --git a/plugins/heroku/test/tasks/production.test.ts b/plugins/heroku/test/tasks/production.test.ts index 70f799a77..fd953e2ea 100644 --- a/plugins/heroku/test/tasks/production.test.ts +++ b/plugins/heroku/test/tasks/production.test.ts @@ -16,8 +16,7 @@ const mockPromoteStagingToProduction = jest.spyOn(utils, 'promoteStagingToProduc jest.spyOn(Production.prototype, 'fetchIfAppHasDeployed').mockImplementation(() => Promise.resolve(true)) const pluginOptions = { - pipeline: 'next-health', - systemCode: 'next-health' + pipeline: 'next-health' } const productionOptions = { diff --git a/plugins/heroku/test/tasks/review.test.ts b/plugins/heroku/test/tasks/review.test.ts index 670b4e7da..665c4e775 100644 --- a/plugins/heroku/test/tasks/review.test.ts +++ b/plugins/heroku/test/tasks/review.test.ts @@ -53,7 +53,7 @@ jest.mock('../../src/gtg', () => { describe('review', () => { it('should call pass in the pipeline id to heroku api call', async () => { - const task = new Review(logger, 'HerokuReview', { pipeline, systemCode: '' }, { scaling: {} }) + const task = new Review(logger, 'HerokuReview', { pipeline }, { scaling: {} }) await task.run() @@ -62,7 +62,7 @@ describe('review', () => { }) it('should return review app id from get heroku review app', async () => { - const task = new Review(logger, 'HerokuReview', { pipeline, systemCode: '' }, { scaling: {} }) + const task = new Review(logger, 'HerokuReview', { pipeline }, { scaling: {} }) await task.run() @@ -71,7 +71,7 @@ describe('review', () => { }) it('should fail if either doppler option is missing', async () => { - let task = new Review(logger, 'HerokuReview', { pipeline, systemCode: '' }, { scaling: {} }) + let task = new Review(logger, 'HerokuReview', { pipeline }, { scaling: {} }) try { await task.run() @@ -79,7 +79,7 @@ describe('review', () => { expect(err).toBeTruthy() } - task = new Review(logger, 'HerokuReview', { pipeline, systemCode: '' }, { scaling: {} }) + task = new Review(logger, 'HerokuReview', { pipeline }, { scaling: {} }) try { await task.run() @@ -89,7 +89,7 @@ describe('review', () => { }) it('should write app id to state', async () => { - const task = new Review(logger, 'HerokuReview', { pipeline, systemCode: '' }, { scaling: {} }) + const task = new Review(logger, 'HerokuReview', { pipeline }, { scaling: {} }) await task.run() @@ -97,7 +97,7 @@ describe('review', () => { }) it('should call gtg with appName', async () => { - const task = new Review(logger, 'HerokuReview', { pipeline, systemCode: '' }, { scaling: {} }) + const task = new Review(logger, 'HerokuReview', { pipeline }, { scaling: {} }) await task.run() @@ -106,7 +106,7 @@ describe('review', () => { it('should throw an error if it fails', async () => { pipeline = 'wrong-pipeline-name' - const task = new Review(logger, 'HerokuReview', { pipeline, systemCode: '' }, { scaling: {} }) + const task = new Review(logger, 'HerokuReview', { pipeline }, { scaling: {} }) try { await task.run() diff --git a/plugins/heroku/test/tasks/staging.test.ts b/plugins/heroku/test/tasks/staging.test.ts index eab4c5646..188368a93 100644 --- a/plugins/heroku/test/tasks/staging.test.ts +++ b/plugins/heroku/test/tasks/staging.test.ts @@ -13,7 +13,6 @@ const logger = winston as unknown as Logger const pipeline = 'test-pipeline' const appName = 'test-appName' -const systemCode = 'test-systemCode' const buildInfo = { id: 'build-id', slug: null, @@ -69,7 +68,7 @@ describe('staging', () => { }) it('should call pipeline couplings with pipeline option', async () => { - const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode }, { scaling: {} }) + const task = new Staging(logger, 'HerokuStaging', { pipeline }, { scaling: {} }) await task.run() @@ -78,7 +77,7 @@ describe('staging', () => { }) it('should return appName from get heroku staging', async () => { - const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode }, { scaling: {} }) + const task = new Staging(logger, 'HerokuStaging', { pipeline }, { scaling: {} }) await task.run() @@ -87,7 +86,7 @@ describe('staging', () => { }) it('should call createBuild with app name', async () => { - const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode }, { scaling: {} }) + const task = new Staging(logger, 'HerokuStaging', { pipeline }, { scaling: {} }) await task.run() @@ -95,21 +94,21 @@ describe('staging', () => { }) it(`should call repeatedCheckForBuildSuccess if the slug id isn't present`, async () => { - const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode }, { scaling: {} }) + const task = new Staging(logger, 'HerokuStaging', { pipeline }, { scaling: {} }) await task.run() expect(repeatedCheckForBuildSuccess).toBeCalledWith(expect.anything(), appName, buildInfo.id) }) it('should call setStagingSlug with app name and slug id', async () => { - const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode }, { scaling: {} }) + const task = new Staging(logger, 'HerokuStaging', { pipeline }, { scaling: {} }) await task.run() expect(setStagingSlug).toBeCalledWith(expect.anything(), appName, slugId) }) it('should call scaleDyno', async () => { - const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode }, { scaling: {} }) + const task = new Staging(logger, 'HerokuStaging', { pipeline }, { scaling: {} }) await task.run() @@ -117,7 +116,7 @@ describe('staging', () => { }) it('should call gtg with appName', async () => { - const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode }, { scaling: {} }) + const task = new Staging(logger, 'HerokuStaging', { pipeline }, { scaling: {} }) await task.run() @@ -125,7 +124,7 @@ describe('staging', () => { }) it('should resolve successfully when complete', async () => { - const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode }, { scaling: {} }) + const task = new Staging(logger, 'HerokuStaging', { pipeline }, { scaling: {} }) await expect(task.run()).resolves.not.toThrow() })