@smoothbricks/cli 0.10.10 → 0.10.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -67,17 +67,10 @@ describe('CI workflow definition', () => {
|
|
|
67
67
|
|
|
68
68
|
expect(rendered).toContain('CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}');
|
|
69
69
|
expect(rendered).toContain('CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}');
|
|
70
|
-
|
|
71
|
-
'
|
|
72
|
-
'
|
|
73
|
-
|
|
74
|
-
'OAUTH_STATE_SIGNING_KEY',
|
|
75
|
-
'MAIL_CAPTURE_CONTROL_TOKEN',
|
|
76
|
-
'TOKEN_ENCRYPTION_KEY',
|
|
77
|
-
'E2E_CONTROL_TOKEN',
|
|
78
|
-
]) {
|
|
79
|
-
expect(rendered).not.toContain(appSecret);
|
|
80
|
-
}
|
|
70
|
+
expect(rendered.match(/^\s+[A-Z][A-Z0-9_]+: \${{ secrets\.[A-Z][A-Z0-9_]+ }}$/gm)).toEqual([
|
|
71
|
+
' CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}',
|
|
72
|
+
' CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}',
|
|
73
|
+
]);
|
|
81
74
|
});
|
|
82
75
|
|
|
83
76
|
it('renders deployment E2E as a dependent job with an independent stage input', () => {
|
|
@@ -93,7 +86,6 @@ describe('CI workflow definition', () => {
|
|
|
93
86
|
'smoo github-ci nx-smart --target e2e-deployment --mode run-many --stage "${{ needs.main.outputs.deployment-stage }}" --name "Deployment E2E" --step 4',
|
|
94
87
|
);
|
|
95
88
|
expect(rendered.match(/name: Deployment E2E/g)).toHaveLength(2);
|
|
96
|
-
expect(rendered).not.toContain('E2E_CONTROL_TOKEN');
|
|
97
89
|
});
|
|
98
90
|
|
|
99
91
|
it('omits optional browser and deployment-E2E lanes when disabled', () => {
|
|
@@ -294,7 +294,6 @@ function renderYamlList(values: string[], spaces: number): string {
|
|
|
294
294
|
function renderE2eDeploymentJob(options: CiWorkflowDefinitionOptions): string {
|
|
295
295
|
if (!options.e2eDeployment) return '';
|
|
296
296
|
return `
|
|
297
|
-
|
|
298
297
|
e2e-deployment:
|
|
299
298
|
name: Deployment E2E
|
|
300
299
|
needs: main
|
|
@@ -89,11 +89,11 @@ describe('applyWranglerDefaults', () => {
|
|
|
89
89
|
it('preserves a human-authored .dev.vars.example and does not log a creation', async () => {
|
|
90
90
|
const root = await createWorkspace([{ dir: 'api', name: '@acme/api', toml: 'name = "svc"\n' }]);
|
|
91
91
|
const examplePath = join(root, 'packages/api/.dev.vars.example');
|
|
92
|
-
await writeFile(examplePath, '
|
|
92
|
+
await writeFile(examplePath, 'EXISTING_SECRET=\n');
|
|
93
93
|
const logs = captureConsoleLogs();
|
|
94
94
|
try {
|
|
95
95
|
applyWranglerDefaults(root);
|
|
96
|
-
expect(await readFile(examplePath, 'utf8')).toBe('
|
|
96
|
+
expect(await readFile(examplePath, 'utf8')).toBe('EXISTING_SECRET=\n');
|
|
97
97
|
expect(logs.some((line) => line.startsWith('created') && line.includes('.dev.vars.example'))).toBe(false);
|
|
98
98
|
} finally {
|
|
99
99
|
console.log = originalConsoleLog;
|
|
@@ -186,7 +186,7 @@ describe('deploy-stage remote version fallback', () => {
|
|
|
186
186
|
|
|
187
187
|
it('uploads a missing tag with a temporary config and secure secrets file, then removes both', async () => {
|
|
188
188
|
const root = await fixtureRoot();
|
|
189
|
-
await writeFile(join(root, '.dev.vars.example'), '
|
|
189
|
+
await writeFile(join(root, '.dev.vars.example'), 'FIXTURE_SECRET=""\nFIXTURE_TOKEN=""\n');
|
|
190
190
|
const runner = new FakeRunner([], { versions: [{ version_id: 'version-2', percentage: 100 }] });
|
|
191
191
|
|
|
192
192
|
const result = await deployStage(root, 'pr123', {
|
|
@@ -196,8 +196,8 @@ describe('deploy-stage remote version fallback', () => {
|
|
|
196
196
|
CLOUDFLARE_API_TOKEN: 'token',
|
|
197
197
|
NX_TASK_HASH: HASH,
|
|
198
198
|
NX_TASK_TARGET_PROJECT: 'fixture',
|
|
199
|
-
|
|
200
|
-
|
|
199
|
+
FIXTURE_SECRET: 'shared-secret',
|
|
200
|
+
FIXTURE_TOKEN: 'encryption-secret',
|
|
201
201
|
},
|
|
202
202
|
});
|
|
203
203
|
|
|
@@ -207,8 +207,8 @@ describe('deploy-stage remote version fallback', () => {
|
|
|
207
207
|
expect(runner.calls.at(-1)).toContain(`nx-${HASH}`);
|
|
208
208
|
expect(runner.secretsMode).toBe(0o600);
|
|
209
209
|
expect(JSON.parse(requiredTestValue(runner.secretsJson, 'secrets JSON'))).toEqual({
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
FIXTURE_SECRET: 'shared-secret',
|
|
211
|
+
FIXTURE_TOKEN: 'encryption-secret',
|
|
212
212
|
});
|
|
213
213
|
expect(existsSync(requiredTestValue(runner.configPathSeen, 'config path'))).toBe(false);
|
|
214
214
|
expect(existsSync(requiredTestValue(runner.secretsPathSeen, 'secrets path'))).toBe(false);
|
|
@@ -216,7 +216,7 @@ describe('deploy-stage remote version fallback', () => {
|
|
|
216
216
|
|
|
217
217
|
it('passes only present manifest values for fixed stages and preserves absent remote secrets', async () => {
|
|
218
218
|
const root = await fixtureRoot();
|
|
219
|
-
await writeFile(join(root, '.dev.vars.example'), '
|
|
219
|
+
await writeFile(join(root, '.dev.vars.example'), 'FIXTURE_SECRET=""\nFIXTURE_TOKEN=""\n');
|
|
220
220
|
const runner = new FakeRunner([], {});
|
|
221
221
|
const cloudflare = new FakeCloudflare();
|
|
222
222
|
|
|
@@ -226,20 +226,20 @@ describe('deploy-stage remote version fallback', () => {
|
|
|
226
226
|
processEnv: {
|
|
227
227
|
CLOUDFLARE_ACCOUNT_ID: 'account-1',
|
|
228
228
|
CLOUDFLARE_API_TOKEN: 'token',
|
|
229
|
-
|
|
229
|
+
FIXTURE_SECRET: 'shared-secret',
|
|
230
230
|
},
|
|
231
231
|
});
|
|
232
232
|
|
|
233
233
|
expect(result.action).toBe('deployed');
|
|
234
234
|
expect(JSON.parse(requiredTestValue(runner.secretsJson, 'secrets JSON'))).toEqual({
|
|
235
|
-
|
|
235
|
+
FIXTURE_SECRET: 'shared-secret',
|
|
236
236
|
});
|
|
237
237
|
expect(existsSync(requiredTestValue(runner.secretsPathSeen, 'secrets path'))).toBe(false);
|
|
238
238
|
});
|
|
239
239
|
|
|
240
240
|
it('rejects a first PR Worker with missing manifest secrets before mutating Cloudflare', async () => {
|
|
241
241
|
const root = await fixtureRoot();
|
|
242
|
-
await writeFile(join(root, '.dev.vars.example'), '
|
|
242
|
+
await writeFile(join(root, '.dev.vars.example'), 'FIXTURE_SECRET=""\n');
|
|
243
243
|
const cloudflare = new FakeCloudflare();
|
|
244
244
|
cloudflare.scripts = [];
|
|
245
245
|
|
|
@@ -253,7 +253,7 @@ describe('deploy-stage remote version fallback', () => {
|
|
|
253
253
|
NX_TASK_TARGET_PROJECT: 'fixture',
|
|
254
254
|
},
|
|
255
255
|
}),
|
|
256
|
-
).rejects.toThrow(/
|
|
256
|
+
).rejects.toThrow(/FIXTURE_SECRET/);
|
|
257
257
|
expect(cloudflare.mutations).toEqual([]);
|
|
258
258
|
});
|
|
259
259
|
|