Skip to content

Commit 6885ab5

Browse files
authored
Merge branch 'main' into merge-back/2.211.0
2 parents ebc4aa6 + 28ad706 commit 6885ab5

File tree

16 files changed

+308
-35
lines changed

16 files changed

+308
-35
lines changed

.github/workflows/codebuild-pr-build.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ on:
88
- main
99
- v2-release
1010
pull_request: {}
11+
pull_request_target:
12+
branches:
13+
- v2-release
14+
types:
15+
- opened
16+
- synchronize
17+
- reopened
1118

1219
# For every PR, cancel any previous builds in progress
1320
# ... but for all other builds we keep them running

.github/workflows/codecov-upload.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Checkout
2424
uses: actions/checkout@v4
2525
- name: Download Artifacts
26-
uses: actions/download-artifact@v4
26+
uses: actions/download-artifact@v5
2727
with:
2828
name: coverage-artifacts
2929
path: ./packages/aws-cdk-lib/core/coverage

.github/workflows/spec-update.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ jobs:
8585
CI: "true"
8686
steps:
8787
- name: Download base database
88-
uses: actions/download-artifact@v4
88+
uses: actions/download-artifact@v5
8989
with:
9090
name: db.base.json.gz
9191
path: base
9292
- name: Download head database
93-
uses: actions/download-artifact@v4
93+
uses: actions/download-artifact@v5
9494
with:
9595
name: db.head.json.gz
9696
path: head
@@ -128,7 +128,7 @@ jobs:
128128
uses: actions/checkout@v4
129129

130130
- name: Download patch
131-
uses: actions/download-artifact@v4
131+
uses: actions/download-artifact@v5
132132
with:
133133
name: update-spec.patch
134134
path: ${{ runner.temp }}
@@ -137,7 +137,7 @@ jobs:
137137
run: '[ -s ${{ runner.temp }}/update-spec.patch ] && git apply ${{ runner.temp }}/update-spec.patch || echo "Empty patch. Skipping."'
138138

139139
- name: Download PR body file
140-
uses: actions/download-artifact@v4
140+
uses: actions/download-artifact@v5
141141
with:
142142
name: PR.md
143143
path: ${{ runner.temp }}

.github/workflows/update-metadata-regions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
uses: actions/checkout@v4
5151

5252
- name: Download patch
53-
uses: actions/download-artifact@v4
53+
uses: actions/download-artifact@v5
5454
with:
5555
name: update-spec.patch
5656
path: ${{ runner.temp }}

.github/workflows/yarn-upgrade-need-manual-work.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
uses: actions/checkout@v4
8484

8585
- name: Download patch
86-
uses: actions/download-artifact@v4
86+
uses: actions/download-artifact@v5
8787
with:
8888
name: upgrade.patch
8989
path: ${{ runner.temp }}

.github/workflows/yarn-upgrade.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
uses: actions/checkout@v4
9898

9999
- name: Download patch
100-
uses: actions/download-artifact@v4
100+
uses: actions/download-artifact@v5
101101
with:
102102
name: upgrade.patch
103103
path: ${{ runner.temp }}

.mergify.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ queue_rules:
2222
commit_message_template: |-
2323
{{ title }} (#{{ number }})
2424
{{ body }}
25-
branch_protection_injection_mode: none
2625
2726
- name: priority-squash
2827
update_method: merge
@@ -43,7 +42,6 @@ queue_rules:
4342
commit_message_template: |-
4443
{{ title }} (#{{ number }})
4544
{{ body }}
46-
branch_protection_injection_mode: none
4745
4846
- name: default-squash
4947
update_method: merge
@@ -63,7 +61,6 @@ queue_rules:
6361
commit_message_template: |-
6462
{{ title }} (#{{ number }})
6563
{{ body }}
66-
branch_protection_injection_mode: none
6764
6865
pull_request_rules:
6966
- name: label core

packages/aws-cdk-lib/aws-bedrock/lib/foundation-model.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,9 @@ export class FoundationModelIdentifier {
254254
/** Base model "anthropic.claude-opus-4-20250514-v1:0" */
255255
public static readonly ANTHROPIC_CLAUDE_OPUS_4_20250514_V1_0 = new FoundationModelIdentifier('anthropic.claude-opus-4-20250514-v1:0');
256256

257+
/** Base model "anthropic.claude-opus-4-1-20250805-v1:0". */
258+
public static readonly ANTHROPIC_CLAUDE_OPUS_4_1_20250805_V1_0 = new FoundationModelIdentifier('anthropic.claude-opus-4-1-20250805-v1:0');
259+
257260
/**
258261
* Base model "anthropic.claude-instant-v1".
259262
* @deprecated use latest version of the model
@@ -302,6 +305,12 @@ export class FoundationModelIdentifier {
302305
/** Base model "deepseek.r1-v1:0". */
303306
public static readonly DEEP_SEEK_R1_V1_0 = new FoundationModelIdentifier('deepseek.r1-v1:0');
304307

308+
/** Base model "openai.gpt-oss-120b-1:0". */
309+
public static readonly OPENAI_GPT_OSS_120B_1 = new FoundationModelIdentifier('openai.gpt-oss-120b-1:0');
310+
311+
/** Base model "openai.gpt-oss-20b-1:0". */
312+
public static readonly OPENAI_GPT_OSS_20B_1 = new FoundationModelIdentifier('openai.gpt-oss-20b-1:0');
313+
305314
/** Base model "luma.ray-v2:0". */
306315
public static readonly LUMA_RAY_V2_0 = new FoundationModelIdentifier('luma.ray-v2:0');
307316

packages/aws-cdk-lib/aws-stepfunctions/lib/private/json-path.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ export class JsonPathToken implements IResolvable {
1717
Object.defineProperty(this, JSON_PATH_TOKEN_SYMBOL, { value: true });
1818
}
1919

20-
public resolve(_ctx: IResolveContext): any {
20+
public resolve(_ctx: IResolveContext): string {
2121
return this.path;
2222
}
2323

24-
public toString() {
24+
public toString(): string {
2525
return Token.asString(this, { displayHint: this.displayHint });
2626
}
2727

28-
public toJSON() {
28+
public toJSON(): string {
2929
return `<path:${this.path}>`;
3030
}
3131
}
@@ -290,7 +290,7 @@ export function jsonPathString(x: string): string | undefined {
290290
return undefined;
291291
}
292292

293-
export function jsonPathFromAny(x: any) {
293+
export function jsonPathFromAny(x: any): string | undefined {
294294
if (!x) { return undefined; }
295295
if (typeof x === 'string') { return jsonPathString(x); }
296296
return pathFromToken(Tokenization.reverse(x));
@@ -314,7 +314,7 @@ function jsonPathNumber(x: number): string | undefined {
314314
return pathFromToken(Tokenization.reverseNumber(x));
315315
}
316316

317-
function pathFromToken(token: IResolvable | undefined) {
317+
function pathFromToken(token: IResolvable | undefined): string | undefined {
318318
return token && (JsonPathToken.isJsonPathToken(token) ? token.path : undefined);
319319
}
320320

@@ -329,15 +329,15 @@ function pathFromToken(token: IResolvable | undefined) {
329329
* Call this function whenever you're building compound JSONPath expressions, in
330330
* order to avoid having tokens-in-tokens-in-tokens which become very hard to parse.
331331
*/
332-
export function renderInExpression(x: any) {
332+
export function renderInExpression(x: any): string {
333333
const path = jsonPathFromAny(x);
334334
if (path) return path;
335335
if (typeof x === 'number') return x.toString(10);
336336
if (typeof x === 'string') return singleQuotestring(x);
337337
throw new UnscopedValidationError('Unxexpected value.');
338338
}
339339

340-
function singleQuotestring(x: string) {
340+
function singleQuotestring(x: string): string {
341341
const ret = new Array<string>();
342342
ret.push("'");
343343
for (let i = 0; i < x.length; i++) {

packages/aws-cdk-lib/aws-stepfunctions/test/private/json-path.test.ts

Lines changed: 90 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,94 @@
1+
import { Token, Tokenization, UnscopedValidationError } from '../../../core';
12
import { JsonPath } from '../../lib';
2-
import { renderInExpression } from '../../lib/private/json-path';
3+
import { jsonPathFromAny, jsonPathString, JsonPathToken, renderInExpression } from '../../lib/private/json-path';
4+
5+
describe('JsonPathToken', () => {
6+
describe('constructor', () => {
7+
test('should create instance with path', () => {
8+
const token = new JsonPathToken('$.foo.bar');
9+
expect(token.path).toBe('$.foo.bar');
10+
});
11+
test('should set displayHint correctly', () => {
12+
const token = new JsonPathToken('$.foo.bar');
13+
expect(token.displayHint).toBe('foo.bar');
14+
});
15+
test('should remove leading non-alphabetic characters', () => {
16+
const token = new JsonPathToken('$.123foo.bar');
17+
expect(token.displayHint).toBe('foo.bar');
18+
});
19+
test('should handle path with only special characters', () => {
20+
const token = new JsonPathToken('$.');
21+
expect(token.displayHint).toBe('');
22+
});
23+
});
24+
25+
describe('isJsonPathToken', () => {
26+
test('should return true for JsonPathToken instances', () => {
27+
const token = new JsonPathToken('$.foo.bar');
28+
expect(JsonPathToken.isJsonPathToken(token)).toBe(true);
29+
});
30+
31+
test('should return false for non-JsonPathToken objects', () => {
32+
const notToken = {} as IResolvable;
33+
expect(JsonPathToken.isJsonPathToken(notToken)).toBe(false);
34+
});
35+
});
36+
37+
describe('resolve', () => {
38+
test('should return the path', () => {
39+
const token = new JsonPathToken('$.foo.bar');
40+
const mockContext = {} as IResolveContext;
41+
expect(token.resolve(mockContext)).toBe('$.foo.bar');
42+
});
43+
});
44+
45+
describe('toString', () => {
46+
test('should return the path', () => {
47+
const token = new JsonPathToken('$.foo.bar');
48+
expect(token.toString()).toMatch(/^\${Token\[foo\.bar\.\d+\]}$/);
49+
});
50+
});
51+
52+
describe('toJSON', () => {
53+
test('should return formatted string', () => {
54+
const token = new JsonPathToken('$.foo.bar');
55+
expect(token.toJSON()).toBe('<path:$.foo.bar>');
56+
});
57+
});
58+
});
59+
60+
describe('jsonPathString', () => {
61+
test('should return path for jsonPathToken instances', () => {
62+
const token = new JsonPathToken('$.foo.bar');
63+
expect(jsonPathString(token.toString())).toBe('$.foo.bar');
64+
});
65+
test('sholud return undefined for non-jsonPathToken objects', () => {
66+
const notToken = '$.foo.bar';
67+
expect(jsonPathString(notToken)).toBeUndefined();
68+
});
69+
test('should return path for for concatenated jsonPathToken tokens', () => {
70+
const token = `${Token.asString(new JsonPathToken('$.foo'))}-${new JsonPathToken('$.bar')}`;
71+
expect(() => jsonPathString(token)).toThrow(UnscopedValidationError);
72+
});
73+
});
74+
75+
describe('jsonPathFromAny', () => {
76+
test('should return path for jsonPathToken', () => {
77+
const token = new JsonPathToken('$.foo.bar');
78+
expect(jsonPathFromAny(token)).toBe('$.foo.bar');
79+
});
80+
test('should return undefined for non-jsonPathToken objects', () => {
81+
const notToken = {};
82+
expect(jsonPathFromAny(notToken)).toBeUndefined();
83+
});
84+
test('should return path for falsy objects', () => {
85+
expect(jsonPathFromAny('')).toBeUndefined();
86+
});
87+
test('should return path for jsonPathToken instances', () => {
88+
const token = new JsonPathToken('$.foo.bar');
89+
expect(jsonPathFromAny(token.toString())).toBe('$.foo.bar');
90+
});
91+
});
392

493
describe('RenderInExpression', () => {
594
test('simple number', () => {

0 commit comments

Comments
 (0)