Skip to content
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

fix: show only generation name in spaces:info output #3128

Merged
merged 2 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/cli/src/lib/spaces/spaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function renderInfo(space: SpaceWithOutboundIps, json: boolean) {
State: space.state,
Shield: displayShieldState(space),
'Outbound IPs': displayNat(space.outbound_ips),
Generation: space.generation,
Generation: space.generation.name,
'Created at': space.created_at,
},
['ID', 'Team', 'Region', 'CIDR', 'Data CIDR', 'State', 'Shield', 'Outbound IPs', 'Generation', 'Created at'],
Expand Down
5 changes: 4 additions & 1 deletion packages/cli/src/lib/types/fir.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2407,7 +2407,10 @@ export interface Space {
*
* @example "fir"
*/
generation: string;
generation: {
id: string,
name: string,
}
}
/**
*
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/test/fixtures/spaces/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const spaces: Record<string, SpaceWithOutboundIps> = {
organization: {
name: 'my-org',
},
generation: 'cedar',
generation: {id: '123', name: 'cedar'},
created_at: '2016-01-06T03:23:13Z',
updated_at: '2016-01-06T03:23:13Z',
},
Expand All @@ -43,7 +43,7 @@ export const spaces: Record<string, SpaceWithOutboundIps> = {
organization: {
name: 'my-org',
},
generation: 'cedar',
generation: {id: '123', name: 'cedar'},
created_at: '2016-01-06T03:23:13Z',
updated_at: '2016-01-06T03:23:13Z',
},
Expand All @@ -66,7 +66,7 @@ export const spaces: Record<string, SpaceWithOutboundIps> = {
organization: {
name: 'my-org',
},
generation: 'cedar',
generation: {id: '123', name: 'cedar'},
created_at: '2016-01-06T03:23:13Z',
updated_at: '2016-01-06T03:23:13Z',
},
Expand Down
12 changes: 6 additions & 6 deletions packages/cli/test/unit/commands/spaces/info.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('spaces:info', function () {
Data CIDR: ${space.data_cidr}
State: ${space.state}
Shield: off
Generation: ${space.generation}
Generation: ${space.generation.name}
Created at: ${space.created_at}
`))
})
Expand Down Expand Up @@ -74,7 +74,7 @@ describe('spaces:info', function () {
State: ${space.state}
Shield: off
Outbound IPs: 123.456.789.123
Generation: ${space.generation}
Generation: ${space.generation.name}
Created at: ${space.created_at}
`))
})
Expand All @@ -101,7 +101,7 @@ describe('spaces:info', function () {
State: ${space.state}
Shield: off
Outbound IPs: disabled
Generation: ${space.generation}
Generation: ${space.generation.name}
Created at: ${space.created_at}
`))
})
Expand All @@ -124,7 +124,7 @@ describe('spaces:info', function () {
Data CIDR: ${space.data_cidr}
State: ${space.state}
Shield: off
Generation: ${space.generation}
Generation: ${space.generation.name}
Created at: ${space.created_at}
`))
})
Expand All @@ -147,7 +147,7 @@ describe('spaces:info', function () {
Data CIDR: ${shieldSpace.data_cidr}
State: ${shieldSpace.state}
Shield: on
Generation: ${space.generation}
Generation: ${space.generation.name}
Created at: ${shieldSpace.created_at}
`))
})
Expand All @@ -169,7 +169,7 @@ describe('spaces:info', function () {
Data CIDR: ${space.data_cidr}
State: ${space.state}
Shield: off
Generation: ${space.generation}
Generation: ${space.generation.name}
Created at: ${space.created_at}
`))
})
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/test/unit/commands/spaces/wait.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('spaces:wait', function () {
State: ${allocatedSpace.state}
Shield: off
Outbound IPs: 123.456.789.123
Generation: ${allocatedSpace.generation}
Generation: ${allocatedSpace.generation.name}
Created at: ${allocatedSpace.created_at}
`))
expect(notifySpy.called).to.be.true
Expand Down Expand Up @@ -115,7 +115,7 @@ describe('spaces:wait', function () {
Data CIDR: ${allocatedSpace.data_cidr}
State: ${allocatedSpace.state}
Shield: off
Generation: ${allocatedSpace.generation}
Generation: ${allocatedSpace.generation.name}
Created at: ${allocatedSpace.created_at}
`))
expect(notifySpy.called).to.be.true
Expand Down
Loading