Skip to content

Commit fc3ea3f

Browse files
committed
refactor(cloud): rename --ios-config/--android-config to --ios-device-matrix/--android-device-matrix (#77)
Renames the device-matrix flags to match the API's `deviceMatrix` field and to say what they actually are (#1105). Clean break — no alias, no migration guard. The old names only ever existed in 5.2.0-beta.1, an unconsumed beta, so there is nobody to migrate. Deliberately NOT marked breaking. A `!` bumps the MAJOR on this 5.x repo (`bump-minor-pre-major` only applies below 1.0.0), which would ship a bogus 6.0.0 for renaming flags that nobody uses.
1 parent 4ef0292 commit fc3ea3f

5 files changed

Lines changed: 25 additions & 25 deletions

File tree

src/commands/cloud.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,9 @@ export const cloudCommand = defineCommand({
215215
);
216216
const androidNoSnapshot = Boolean(args['android-no-snapshot']);
217217
// Repeatable device-matrix flags: one validated cell each, no cross-product.
218-
const iosConfigFlags = collectRepeatedFlag(rawArgs, ['--ios-config']);
219-
const androidConfigFlags = collectRepeatedFlag(rawArgs, ['--android-config']);
220-
const deviceMatrix = parseDeviceMatrix(iosConfigFlags, androidConfigFlags);
218+
const iosMatrixFlags = collectRepeatedFlag(rawArgs, ['--ios-device-matrix']);
219+
const androidMatrixFlags = collectRepeatedFlag(rawArgs, ['--android-device-matrix']);
220+
const deviceMatrix = parseDeviceMatrix(iosMatrixFlags, androidMatrixFlags);
221221
const json = Boolean(args.json);
222222
const jsonFileFlag = Boolean(args['json-file']);
223223
const jsonFileName = args['json-file-name'] as string | undefined;
@@ -668,8 +668,8 @@ export const cloudCommand = defineCommand({
668668
'include-tags': includeTags,
669669
'exclude-tags': excludeTags,
670670
'exclude-flows': excludeFlows,
671-
'ios-config': iosConfigFlags,
672-
'android-config': androidConfigFlags,
671+
'ios-device-matrix': iosMatrixFlags,
672+
'android-device-matrix': androidMatrixFlags,
673673
};
674674
for (const [k, v] of Object.entries(args)) {
675675
if (!canonicalFlagKeys.has(k)) continue;

src/config/flags/device.flags.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ export const deviceFlags = {
4242
type: 'string',
4343
description: `[iOS only] iOS version to run your flow against (options: ${iosVersions})`,
4444
},
45-
'ios-config': {
45+
'ios-device-matrix': {
4646
type: 'string',
47-
description: `[iOS only] Device-matrix cell as <device>:<version>, e.g. iphone-16:18. Repeatable — every flow runs once per cell (no cross-product). Cannot be combined with --android-config.`,
47+
description: `[iOS only] Device-matrix cell as <device>:<version>, e.g. iphone-16:18. Repeatable — every flow runs once per cell (no cross-product). Cannot be combined with --android-device-matrix.`,
4848
},
49-
'android-config': {
49+
'android-device-matrix': {
5050
type: 'string',
51-
description: `[Android only] Device-matrix cell as <device>:<apiLevel> (append :play for Google Play), e.g. pixel-7:34 or pixel-7:34:play. Repeatable — every flow runs once per cell (no cross-product). Cannot be combined with --ios-config.`,
51+
description: `[Android only] Device-matrix cell as <device>:<apiLevel> (append :play for Google Play), e.g. pixel-7:34 or pixel-7:34:play. Repeatable — every flow runs once per cell (no cross-product). Cannot be combined with --ios-device-matrix.`,
5252
},
5353
orientation: {
5454
type: 'string',

src/utils/device-matrix.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import {
55
import { CliError } from './cli.js';
66

77
/**
8-
* Parse repeated `--ios-config <device>:<version>` and
9-
* `--android-config <device>:<apiLevel>[:play]` flags into an explicit device
8+
* Parse repeated `--ios-device-matrix <device>:<version>` and
9+
* `--android-device-matrix <device>:<apiLevel>[:play]` flags into an explicit device
1010
* matrix. Each entry is one validated cell — there is NO cross-product, because
1111
* the compatibility matrix is ragged and a cross-product would invent cells the
1212
* user never asked for.
@@ -22,7 +22,7 @@ export function parseDeviceMatrix(
2222
): DeviceMatrixConfig[] {
2323
if (iosConfigs.length > 0 && androidConfigs.length > 0) {
2424
throw new CliError(
25-
'A device matrix cannot mix platforms: use either --ios-config or --android-config, not both. One upload runs one binary.',
25+
'A device matrix cannot mix platforms: use either --ios-device-matrix or --android-device-matrix, not both. One upload runs one binary.',
2626
);
2727
}
2828

@@ -32,7 +32,7 @@ export function parseDeviceMatrix(
3232
const parts = raw.split(':');
3333
if (parts.length !== 2 || !parts[0] || !parts[1]) {
3434
throw new CliError(
35-
`Invalid --ios-config "${raw}". Expected <device>:<version>, e.g. iphone-16:18.`,
35+
`Invalid --ios-device-matrix "${raw}". Expected <device>:<version>, e.g. iphone-16:18.`,
3636
);
3737
}
3838
configs.push({ iOSDevice: parts[0], iOSVersion: parts[1] });
@@ -49,7 +49,7 @@ export function parseDeviceMatrix(
4949
(parts.length === 3 && parts[2] !== 'play')
5050
) {
5151
throw new CliError(
52-
`Invalid --android-config "${raw}". Expected <device>:<apiLevel> or <device>:<apiLevel>:play, e.g. pixel-7:34 or pixel-7:34:play.`,
52+
`Invalid --android-device-matrix "${raw}". Expected <device>:<apiLevel> or <device>:<apiLevel>:play, e.g. pixel-7:34 or pixel-7:34:play.`,
5353
);
5454
}
5555
configs.push({

test/integration/cloud.integration.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,26 +163,26 @@ appId: com.example.app
163163
});
164164
});
165165

166-
// #1105 device matrix: repeated --ios-config / --android-config cells.
166+
// #1105 device matrix: repeated --ios-device-matrix / --android-device-matrix cells.
167167
describe('device matrix', () => {
168-
it('accepts a repeated --ios-config matrix and still yields one upload', async () => {
169-
const command = `${CLI} cloud ${iosAppFile} ${testFlowFile} --api-key ${mockApiKey} --api-url ${mockApiUrl} --ios-config iphone-16:18 --ios-config iphone-16-pro:26 --async --json`;
168+
it('accepts a repeated --ios-device-matrix matrix and still yields one upload', async () => {
169+
const command = `${CLI} cloud ${iosAppFile} ${testFlowFile} --api-key ${mockApiKey} --api-url ${mockApiUrl} --ios-device-matrix iphone-16:18 --ios-device-matrix iphone-16-pro:26 --async --json`;
170170

171171
const { stdout } = await exec(command, { timeout: 30_000 });
172172
// Still one upload with one uploadId — the matrix is a property of the
173173
// upload, not N uploads.
174174
expectAsyncRunJson(stdout);
175175
});
176176

177-
it('rejects mixing --ios-config and --android-config before any upload', async () => {
178-
const command = `${CLI} cloud ${iosAppFile} ${testFlowFile} --api-key ${mockApiKey} --api-url ${mockApiUrl} --ios-config iphone-16:18 --android-config pixel-7:34`;
177+
it('rejects mixing --ios-device-matrix and --android-device-matrix before any upload', async () => {
178+
const command = `${CLI} cloud ${iosAppFile} ${testFlowFile} --api-key ${mockApiKey} --api-url ${mockApiUrl} --ios-device-matrix iphone-16:18 --android-device-matrix pixel-7:34`;
179179

180180
const { output } = await runExpectingFailure(command);
181181
expect(output.toLowerCase()).to.include('cannot mix platforms');
182182
});
183183

184-
it('rejects a malformed --ios-config, naming the value', async () => {
185-
const command = `${CLI} cloud ${iosAppFile} ${testFlowFile} --api-key ${mockApiKey} --api-url ${mockApiUrl} --ios-config iphone-16`;
184+
it('rejects a malformed --ios-device-matrix, naming the value', async () => {
185+
const command = `${CLI} cloud ${iosAppFile} ${testFlowFile} --api-key ${mockApiKey} --api-url ${mockApiUrl} --ios-device-matrix iphone-16`;
186186

187187
const { output } = await runExpectingFailure(command);
188188
expect(output).to.include('iphone-16');

test/unit/device-matrix.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import {
77
} from '../../src/utils/device-matrix.js';
88

99
/**
10-
* The device matrix is the load-bearing part of #1105: each --ios-config /
11-
* --android-config names exactly one cell, there is no cross-product, and a
10+
* The device matrix is the load-bearing part of #1105: each --ios-device-matrix /
11+
* --android-device-matrix names exactly one cell, there is no cross-product, and a
1212
* matrix is single-platform. These are pure and worth pinning precisely.
1313
*/
1414
describe('parseDeviceMatrix', () => {
@@ -17,7 +17,7 @@ describe('parseDeviceMatrix', () => {
1717
expect(matrixIsIos([])).to.equal(false);
1818
});
1919

20-
it('parses each --ios-config as exactly one cell (no cross-product)', () => {
20+
it('parses each --ios-device-matrix as exactly one cell (no cross-product)', () => {
2121
const matrix = parseDeviceMatrix(
2222
['iphone-16:18', 'iphone-16-pro:26'],
2323
[],
@@ -29,7 +29,7 @@ describe('parseDeviceMatrix', () => {
2929
expect(matrixIsIos(matrix)).to.equal(true);
3030
});
3131

32-
it('parses --android-config, with :play marking a Google Play cell', () => {
32+
it('parses --android-device-matrix, with :play marking a Google Play cell', () => {
3333
expect(parseDeviceMatrix([], ['pixel-7:34', 'pixel-7:34:play'])).to.deep.equal([
3434
{ androidDevice: 'pixel-7', androidApiLevel: '34' },
3535
{ androidDevice: 'pixel-7', androidApiLevel: '34', googlePlay: true },

0 commit comments

Comments
 (0)