Development#164
Conversation
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
There was a problem hiding this comment.
Pull request overview
This PR adds a new launch:rollback command to roll back an environment to a previous eligible deployment, and introduces a new --response-mode flag (buffered/streaming) to control whether project creation uses streaming responses. It also updates GraphQL queries/mutations and related types/tests to support these features.
Changes:
- Added
launch:rollbackcommand with environment/deployment selection, review/confirm flow, and rollback mutation call. - Added
--response-modeflag plus adapter wiring to setisStreamingEnabled(prompted when omitted). - Extended GraphQL queries/mutations to fetch rollback metadata and perform rollback; bumped package version and updated dependencies.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| test/unit/commands/rollback.test.ts | Mocha unit tests added for rollback command invocation/prompting paths. |
| src/types/launch.ts | Updates CLI flag typing and adds isStreamingEnabled to config type. |
| src/graphql/queries.ts | Adds rollback-related fields and a query variable to skip rollback-only fields when not needed. |
| src/graphql/mutation.ts | Adds rollbackDeployment mutation document export. |
| src/config/index.ts | Adds responseModeOptions configuration. |
| src/commands/launch/rollback.ts | New rollback command implementation. |
| src/commands/launch/rollback.test.ts | Jest unit tests for rollback command logic/mutation behavior. |
| src/commands/launch/index.ts | Adds --response-mode flag and an example usage. |
| src/adapters/github.ts | Wires response-mode into prompting and mutation payload via isStreamingEnabled. |
| src/adapters/github.test.ts | Adds tests for streaming response prompt/flag behavior. |
| src/adapters/file-upload.ts | Wires response-mode into prompting and mutation payload via isStreamingEnabled. |
| src/adapters/file-upload.test.ts | Adds tests for streaming response prompt/flag behavior. |
| package.json | Bumps package version and updates qs. |
| package-lock.json | Lockfile updates reflecting dependency/version changes. |
| .talismanrc | Adds checksum entries for new test files and updated lockfile. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| description: '[optional] Provide mode for response. <options: buffered|streaming' | ||
| }) |
| }) as any); | ||
| }); | ||
|
|
||
| afterEach(() => { |
| it('Should ask for org when org flag is not passed', async function () { | ||
| const args = ['-e', environmentName, '--project', projectUid]; | ||
| const mock = sinon.mock(Rollback); | ||
| const expectation = mock.expects('run'); | ||
| expectation.exactly(1); | ||
| const orgStub = stub(cliux, 'inquire').resolves(orgUid); | ||
|
|
||
| await Rollback.run(args); | ||
|
|
||
| sinon.assert.notCalled(orgStub); | ||
| orgStub.restore(); |
| it('Should ask for organization with a warning when passed incorrect org uid', async function () { | ||
| const args = ['--org', testFlags.invalidOrg.uid, '--project', projectUid, '-e', environmentName]; | ||
| const mock = sinon.mock(Rollback); | ||
| const expectation = mock.expects('run'); | ||
| expectation.exactly(1); | ||
| const orgStub = stub(cliux, 'inquire').resolves(orgUid); | ||
|
|
||
| await Rollback.run(args); | ||
|
|
||
| sinon.assert.notCalled(orgStub); | ||
| orgStub.restore(); |
| if (isEmpty(eligibleSorted)) { | ||
| this.log('No rollback-eligible deployments are available for this environment.', 'error'); | ||
| process.exit(1); | ||
| } |
| }); | ||
| } catch (error: unknown) { | ||
| const err = error as { graphQLErrors?: { extensions?: { exception?: { name?: string } } }[]; message?: string }; | ||
| const code = err?.graphQLErrors?.[0]?.extensions?.exception?.name || err?.message; |
No description provided.