Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
acea6af
fix(cli-internal): replace lock rollback drift validation with stack …
iliapolo May 6, 2026
349c5fd
fix(cli-internal): revert retain policy to use RESOURCES_TO_RETAIN list
iliapolo May 6, 2026
c8626aa
chore: store locator needs to skip validations during refactor rollba…
iliapolo May 6, 2026
ccd2667
chore: dont run gen2 tests, remove cleanup dependency on migration e2es
iliapolo May 6, 2026
132101b
Merge branch 'dev' into epolon/e2e-rollback
iliapolo May 6, 2026
6e16383
fix(cli-internal): skip optional attributes in auth userAttributes ma…
iliapolo May 7, 2026
df9ea47
chore: reuse refresh logic, add lock rollback conditional resource check
iliapolo May 7, 2026
a2612b1
chore: touch function
iliapolo May 7, 2026
e950e6e
chore: remove init dep
iliapolo May 7, 2026
5881171
chore: mid work
iliapolo May 7, 2026
b90edd7
Merge branch 'dev' into epolon/e2e-rollback
iliapolo May 7, 2026
be69d6e
chore: revert a bunch
iliapolo May 7, 2026
fec938c
Merge branch 'dev' into epolon/e2e-rollback
iliapolo May 7, 2026
aa3cfea
chore: revert a bunch
iliapolo May 7, 2026
d78b9f8
Merge branch 'dev' into epolon/e2e-rollback
iliapolo May 7, 2026
44fbe6d
chore: add finance tracker e2e
iliapolo May 7, 2026
b54a497
chore: include windows tests
iliapolo May 7, 2026
b324620
chore: fixups
iliapolo May 8, 2026
f51b951
chore: fixups
iliapolo May 8, 2026
6aeec96
chore: pass directs creds to teardown is possible
iliapolo May 8, 2026
2660238
chore: log
iliapolo May 8, 2026
732f96a
chore: ignore cache in fromIni
iliapolo May 8, 2026
d2e1df5
chore(amplify-e2e-gen2-migration): consolidate e2e lifecycle into App…
iliapolo May 8, 2026
b66fd87
docs: update migration/config.json documentation
iliapolo May 8, 2026
7204710
chore: bring back windows exclusion
iliapolo May 8, 2026
82a3f74
chore: rename
iliapolo May 8, 2026
e49ca63
Merge branch 'dev' into epolon/e2e-rollback
iliapolo May 8, 2026
41cc57a
chore: override console logger
iliapolo May 8, 2026
6d72ad2
chore: checkout before retain
iliapolo May 8, 2026
2963f17
refactor(amplify-e2e-gen2-migration): extract printBanner helper
iliapolo May 8, 2026
409aaf5
refactor(amplify-e2e-gen2-migration): extract forward method and fix …
iliapolo May 8, 2026
b980944
refactor(amplify-e2e-gen2-migration): replace AWS CLI sts call with SDK
iliapolo May 9, 2026
16823ec
chore: touchups
iliapolo May 9, 2026
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
25 changes: 21 additions & 4 deletions amplify-migration-apps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,34 @@ caller's working directory.
### `migration/config.json`

Configuration file read by the [E2E system](../packages/amplify-e2e-gen2-migration/) at runtime.
Currently supports:
Each key corresponds to a migration step and accepts a `StepConfig` object:

```json
{
"lock": { "skipValidations": true }
"lockForward": { "skipValidations": true },
"lockRollback": { "skipValidations": false },
"refactorForward": { "skip": true },
"refactorRollback": { "skipValidations": true },
"generate": { "skipValidations": true }
}
```

- `lock.skipValidations` — pass `--skip-validations` to `gen2-migration lock`.
| Field | Type | Description |
| ------------------ | ------------ | ------------------------------------------------------------ |
| `lockForward` | `StepConfig` | Config for `gen2-migration lock`. |
| `lockRollback` | `StepConfig` | Config for `gen2-migration lock --rollback`. |
| `refactorForward` | `StepConfig` | Config for `gen2-migration refactor`. |
| `refactorRollback` | `StepConfig` | Config for `gen2-migration refactor --rollback`. |
| `generate` | `StepConfig` | Config for `gen2-migration generate`. |

If the file does not exist, defaults are used (no skip-validations).
`StepConfig` fields:

| Field | Type | Description |
| ------------------ | --------- | -------------------------------------------------- |
| `skipValidations` | `boolean` | Pass `--skip-validations` to the step. |
| `skip` | `boolean` | Skip the step entirely. |

If the file does not exist, defaults are used (no skips, no skip-validations).

### `tests/`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"refactor": { "skip": true },
"refactorForward": { "skip": true },
"generate": { "skipValidations": true }
}
136 changes: 69 additions & 67 deletions amplify-migration-apps/finance-tracker/tests/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,37 @@ afterAll(async () => {
await signOut();
});

describe('Transaction', () => {
let transactionId: string;
async function createTestTransaction(overrides: Record<string, any> = {}) {
const input = {
description: `Test transaction - ${Date.now()}`,
amount: 85.50,
type: TransactionType.EXPENSE,
category: 'Food',
date: new Date().toISOString(),
...overrides,
};
const result = await authClient().graphql({ query: createTransaction, variables: { input } });
return (result as any).data.createTransaction;
}

async function createTestSummary(overrides: Record<string, any> = {}) {
const input = {
totalIncome: 5000.00,
totalExpenses: 3200.00,
balance: 1800.00,
month: '2026-04',
...overrides,
};
const result = await authClient().graphql({ query: createFinancialSummary, variables: { input } });
return (result as any).data.createFinancialSummary;
}

describe('Transaction', () => {
it('creates a transaction with correct fields', async () => {
const input = {
description: `Grocery shopping - ${Date.now()}`,
amount: 85.50,
type: TransactionType.EXPENSE,
category: 'Food',
date: new Date().toISOString(),
};

const result = await authClient().graphql({ query: createTransaction, variables: { input } });
const txn = (result as any).data.createTransaction;
transactionId = txn.id;
const txn = await createTestTransaction({ description: `Grocery shopping - ${Date.now()}` });

expect(typeof txn.id).toBe('string');
expect(txn.id.length).toBeGreaterThan(0);
expect(txn.description).toBe(input.description);
expect(txn.amount).toBe(85.50);
expect(txn.type).toBe(TransactionType.EXPENSE);
expect(txn.category).toBe('Food');
Expand All @@ -55,29 +67,35 @@ describe('Transaction', () => {
});

it('reads a transaction by id', async () => {
const result = await publicClient().graphql({ query: getTransaction, variables: { id: transactionId } });
const txn = (result as any).data.getTransaction;
const txn = await createTestTransaction();

expect(txn).not.toBeNull();
expect(txn.id).toBe(transactionId);
expect(txn.category).toBe('Food');
const result = await publicClient().graphql({ query: getTransaction, variables: { id: txn.id } });
const fetched = (result as any).data.getTransaction;

expect(fetched).not.toBeNull();
expect(fetched.id).toBe(txn.id);
expect(fetched.category).toBe('Food');
});

it('updates a transaction and persists changes', async () => {
const txn = await createTestTransaction();
const updatedDesc = `Updated grocery - ${Date.now()}`;

await authClient().graphql({
query: updateTransaction,
variables: { input: { id: transactionId, description: updatedDesc, amount: 92.00 } },
variables: { input: { id: txn.id, description: updatedDesc, amount: 92.00 } },
});

const result = await publicClient().graphql({ query: getTransaction, variables: { id: transactionId } });
const txn = (result as any).data.getTransaction;
const result = await publicClient().graphql({ query: getTransaction, variables: { id: txn.id } });
const fetched = (result as any).data.getTransaction;

expect(txn.description).toBe(updatedDesc);
expect(txn.amount).toBe(92.00);
expect(fetched.description).toBe(updatedDesc);
expect(fetched.amount).toBe(92.00);
});

it('lists transactions', async () => {
await createTestTransaction();

const result = await publicClient().graphql({ query: listTransactions });
const items = (result as any).data.listTransactions.items;

Expand All @@ -86,27 +104,18 @@ describe('Transaction', () => {
});

it('deletes a transaction', async () => {
await authClient().graphql({ query: deleteTransaction, variables: { input: { id: transactionId } } });
const txn = await createTestTransaction();

const result = await publicClient().graphql({ query: getTransaction, variables: { id: transactionId } });
await authClient().graphql({ query: deleteTransaction, variables: { input: { id: txn.id } } });

const result = await publicClient().graphql({ query: getTransaction, variables: { id: txn.id } });
expect((result as any).data.getTransaction).toBeNull();
});
});

describe('FinancialSummary', () => {
let summaryId: string;

it('creates a financial summary', async () => {
const input = {
totalIncome: 5000.00,
totalExpenses: 3200.00,
balance: 1800.00,
month: '2026-04',
};

const result = await authClient().graphql({ query: createFinancialSummary, variables: { input } });
const summary = (result as any).data.createFinancialSummary;
summaryId = summary.id;
const summary = await createTestSummary();

expect(typeof summary.id).toBe('string');
expect(summary.totalIncome).toBe(5000.00);
Expand All @@ -117,15 +126,19 @@ describe('FinancialSummary', () => {
});

it('reads a financial summary by id', async () => {
const result = await publicClient().graphql({ query: getFinancialSummary, variables: { id: summaryId } });
const summary = (result as any).data.getFinancialSummary;
const summary = await createTestSummary();

expect(summary).not.toBeNull();
expect(summary.id).toBe(summaryId);
expect(summary.month).toBe('2026-04');
const result = await publicClient().graphql({ query: getFinancialSummary, variables: { id: summary.id } });
const fetched = (result as any).data.getFinancialSummary;

expect(fetched).not.toBeNull();
expect(fetched.id).toBe(summary.id);
expect(fetched.month).toBe('2026-04');
});

it('lists financial summaries', async () => {
await createTestSummary();

const result = await publicClient().graphql({ query: listFinancialSummaries });
const items = (result as any).data.listFinancialSummaries.items;

Expand All @@ -134,26 +147,22 @@ describe('FinancialSummary', () => {
});

it('deletes a financial summary', async () => {
await authClient().graphql({ query: deleteFinancialSummary, variables: { input: { id: summaryId } } });
const summary = await createTestSummary();

await authClient().graphql({ query: deleteFinancialSummary, variables: { input: { id: summary.id } } });

const result = await publicClient().graphql({ query: getFinancialSummary, variables: { id: summaryId } });
const result = await publicClient().graphql({ query: getFinancialSummary, variables: { id: summary.id } });
expect((result as any).data.getFinancialSummary).toBeNull();
});
});

describe('Lambda-backed operations', () => {
it('calculateFinancialSummary returns numeric fields', async () => {
await authClient().graphql({
query: createTransaction,
variables: {
input: {
description: `Summary test income - ${Date.now()}`,
amount: 1000.00,
type: TransactionType.INCOME,
category: 'Salary',
date: new Date().toISOString(),
},
},
await createTestTransaction({
description: `Summary test income - ${Date.now()}`,
amount: 1000.00,
type: TransactionType.INCOME,
category: 'Salary',
});

const result = await publicClient().graphql({ query: calculateFinancialSummary });
Expand Down Expand Up @@ -198,17 +207,10 @@ describe('Custom VTL resolver', () => {
it('getTransactionsByCategory returns filtered transactions', async () => {
const category = `TestCategory-${Date.now()}`;

await authClient().graphql({
query: createTransaction,
variables: {
input: {
description: `Category filter test - ${Date.now()}`,
amount: 42.00,
type: TransactionType.EXPENSE,
category,
date: new Date().toISOString(),
},
},
await createTestTransaction({
description: `Category filter test - ${Date.now()}`,
amount: 42.00,
category,
});

const result = await publicClient().graphql({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"lock": {
"lockForward": {
"skipValidations": true
}
}
1 change: 0 additions & 1 deletion amplify-migration-apps/media-vault/migration/config.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

## Add a pin emoji prefix to each board name so it's visible on the frontend
#foreach( $item in $ctx.result.items )
#if( !$item.name.startsWith("📌 ") )
$util.qr($item.put("name", "📌 $item.name"))
#if( !$item.name.startsWith("(new!)") )
$util.qr($item.put("name", "(new!) $item.name"))
#end
#end

Expand Down
4 changes: 2 additions & 2 deletions amplify-migration-apps/mood-board/tests/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('guest', () => {

expect(typeof board.id).toBe('string');
expect(board.id.length).toBeGreaterThan(0);
expect(board.name).toMatch(new RegExp(`^[🌅☀️🌙] ${name} \\(new!\\)$`));
Comment thread
iliapolo marked this conversation as resolved.
expect(board.name).toEqual(`${name} (new!)`);
expect(board.createdAt).toBeDefined();
expect(board.updatedAt).toBeDefined();
});
Expand Down Expand Up @@ -106,7 +106,7 @@ describe('guest', () => {
expect(items.length).toBeGreaterThanOrEqual(1);
const found = items.find((b: any) => b.id === created.id);
expect(found).toBeDefined();
expect(found.name).toBe(`📌 ${name}`);
expect(found.name).toBe(`(new!) ${name}`);
Comment thread
iliapolo marked this conversation as resolved.
});
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"refactor": { "skipValidations": true }
"refactorForward": { "skipValidations": true },
"refactorRollback": { "skipValidations": true }
}
Loading
Loading