mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-17 05:29:44 +02:00
ci: Force fresh sync patch validation (no-changelog) (#38929)
This commit is contained in:
parent
43fa826342
commit
ecc822d588
9
.github/scripts/sync-master-to-3x.mjs
vendored
9
.github/scripts/sync-master-to-3x.mjs
vendored
|
|
@ -151,9 +151,9 @@ export function resolveMechanicalPath({ git, pnpm, path, masterSha, log = consol
|
|||
log(`Regenerating ${path} with pnpm...`);
|
||||
pnpm(['install', '--lockfile-only', '--no-frozen-lockfile']);
|
||||
try {
|
||||
// A lockfile-only install does not apply patches. Validate the regenerated lockfile
|
||||
// with a full install so pnpm applies patches before accepting the resolution.
|
||||
pnpm(['install', '--frozen-lockfile']);
|
||||
// A lockfile-only install does not apply patches. Force a full install so pnpm
|
||||
// does not accept cached dependencies without applying the regenerated patches.
|
||||
pnpm(['install', '--frozen-lockfile', '--force']);
|
||||
} catch (error) {
|
||||
git(['checkout', '--conflict=merge', '--', path]);
|
||||
throw error;
|
||||
|
|
@ -313,7 +313,8 @@ export function reconcileWithMergeTreeAtTip({
|
|||
*/
|
||||
export function reconcileLockfileAtTip({ git, pnpm, masterSha, log = console.log }) {
|
||||
pnpm(['install', '--lockfile-only', '--no-frozen-lockfile']);
|
||||
pnpm(['install', '--frozen-lockfile']);
|
||||
// Force pnpm to reimport cached dependencies and apply the regenerated patches.
|
||||
pnpm(['install', '--frozen-lockfile', '--force']);
|
||||
if (attempt(git, ['diff', '--quiet', '--', LOCKFILE]).ok) return;
|
||||
if (git(['rev-parse', 'HEAD']) === masterSha) {
|
||||
throw new Error('Lockfile reconciliation would amend a master commit; refusing.');
|
||||
|
|
|
|||
16
.github/scripts/sync-master-to-3x.test.mjs
vendored
16
.github/scripts/sync-master-to-3x.test.mjs
vendored
|
|
@ -185,10 +185,10 @@ test('resolveMechanicalPath regenerates and applies patches before staging the l
|
|||
const git = makeStub();
|
||||
const pnpm = makeStub();
|
||||
resolveMechanicalPath({ git, pnpm, path: LOCKFILE, masterSha: MASTER, log: () => {} });
|
||||
// `--no-frozen-lockfile` is load-bearing: pnpm defaults to frozen when CI=true.
|
||||
// Regeneration must override CI's frozen default. Validation must bypass cached imports.
|
||||
assert.deepEqual(pnpm.calls, [
|
||||
['install', '--lockfile-only', '--no-frozen-lockfile'],
|
||||
['install', '--frozen-lockfile'],
|
||||
['install', '--frozen-lockfile', '--force'],
|
||||
]);
|
||||
assert.ok(git.calls.some((a) => a[0] === 'add' && a.includes(LOCKFILE)));
|
||||
});
|
||||
|
|
@ -421,7 +421,7 @@ test('reconcileLockfileAtTip folds an inconsistent lockfile into the tip commit,
|
|||
reconcileLockfileAtTip({ git: inconsistent, pnpm, masterSha: MASTER, log: () => {} });
|
||||
assert.deepEqual(pnpm.calls, [
|
||||
['install', '--lockfile-only', '--no-frozen-lockfile'],
|
||||
['install', '--frozen-lockfile'],
|
||||
['install', '--frozen-lockfile', '--force'],
|
||||
]);
|
||||
assert.ok(inconsistent.calls.some((a) => a[0] === 'commit' && a.includes('--amend')));
|
||||
|
||||
|
|
@ -684,11 +684,11 @@ test('sync auto-resolves a lockfile-only conflict during the replay — no PR, n
|
|||
|
||||
await sync({ git, gh, pnpm, env, log: () => {} });
|
||||
|
||||
// The stall regen and the tip reconciliation each run regeneration and validation.
|
||||
// The stall regen and tip reconciliation each run regeneration and forced validation.
|
||||
assert.deepEqual(pnpm.calls[0], ['install', '--lockfile-only', '--no-frozen-lockfile']);
|
||||
assert.deepEqual(pnpm.calls[1], ['install', '--frozen-lockfile']);
|
||||
assert.deepEqual(pnpm.calls[1], ['install', '--frozen-lockfile', '--force']);
|
||||
assert.deepEqual(pnpm.calls[2], ['install', '--lockfile-only', '--no-frozen-lockfile']);
|
||||
assert.deepEqual(pnpm.calls[3], ['install', '--frozen-lockfile']);
|
||||
assert.deepEqual(pnpm.calls[3], ['install', '--frozen-lockfile', '--force']);
|
||||
assert.equal(pnpm.calls.length, 4);
|
||||
assert.ok(git.calls.some((a) => a[0] === 'add' && a.includes(LOCKFILE)));
|
||||
assert.ok(git.calls.some((a) => a[0] === 'rebase' && a[1] === '--continue'));
|
||||
|
|
@ -838,7 +838,7 @@ test('buildConflictBranch pre-resolves mechanical files so only code conflicts r
|
|||
assert.equal(lockfileDeferred, false);
|
||||
assert.deepEqual(pnpm.calls, [
|
||||
['install', '--lockfile-only', '--no-frozen-lockfile'],
|
||||
['install', '--frozen-lockfile'],
|
||||
['install', '--frozen-lockfile', '--force'],
|
||||
]);
|
||||
assert.ok(
|
||||
git.calls.some((a) => a[0] === 'checkout' && a[1] === MASTER && a.includes(POPULARITY)),
|
||||
|
|
@ -886,7 +886,7 @@ test('buildConflictBranch restores and defers a lockfile when the patched instal
|
|||
assert.equal(lockfileDeferred, true);
|
||||
assert.deepEqual(pnpm.calls, [
|
||||
['install', '--lockfile-only', '--no-frozen-lockfile'],
|
||||
['install', '--frozen-lockfile'],
|
||||
['install', '--frozen-lockfile', '--force'],
|
||||
]);
|
||||
assert.ok(
|
||||
git.calls.some(
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user