Skip to content

Commit 7c24e36

Browse files
authored
2 parents 293ac17 + c72e2c3 commit 7c24e36

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2925
-1438
lines changed

.github/workflows/docker-images.yml

+49-21
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
name: jsii/superchain
1616
permissions:
1717
contents: read
18+
id-token: write # Necessary for OIDC federation
1819
runs-on: ubuntu-latest
1920
strategy:
2021
matrix:
@@ -45,13 +46,49 @@ jobs:
4546
echo '⏯ Dockerfile changed'
4647
echo "::set-output name=result::true"
4748
else
48-
echo '⏭ Dockerfile not changed'
49-
echo "::set-output name=result::false"
49+
if grep '.github/workflows/docker-images.yml' <<< "${changed}" ; then
50+
echo '⏯ docker-images workflow changed'
51+
echo "::set-output name=result::true"
52+
else
53+
echo '⏭ Dockerfile not changed'
54+
echo "::set-output name=result::false"
55+
fi
5056
fi
5157
fi
5258
59+
# Check if federation into AWS is configured. This is necessary because
60+
# GitHub does not interpret ${{ secret.FOO }} within `if:` conditions...
61+
# See: https://github.com/actions/runner/issues/520
62+
- name: Check AWS federation configuration
63+
id: federate_to_aws
64+
if: steps.should-run.outputs.result == 'true'
65+
run: |-
66+
if [[ "${{ secrets.AWS_ROLE_TO_ASSUME }}" != "" ]]; then
67+
echo "🔑 Federation into AWS is possible (AWS_ROLE_TO_ASSUME is available)"
68+
echo "::set-output name=enabled::true"
69+
else
70+
echo "❌ Federation into AWS is disabled (no AWS_ROLE_TO_ASSUME secret found)"
71+
echo "::set-output name=enabled::false"
72+
fi
73+
74+
# Federate into the PR Validation AWS Account
75+
- name: Federate into AWS
76+
if: steps.should-run.outputs.result == 'true' && steps.federate_to_aws.outputs.enabled == 'true'
77+
uses: aws-actions/configure-aws-credentials@v1
78+
with:
79+
aws-region: us-east-1
80+
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
81+
role-session-name: GHA_aws-jsii_docker-images
82+
83+
# Login to ECR Public registry, so we don't get throttled at 1 TPS
84+
- name: Login to ECR Public
85+
if: steps.should-run.outputs.result == 'true' && steps.federate_to_aws.outputs.enabled == 'true'
86+
run: |-
87+
aws ecr-public get-login-password --region=us-east-1 \
88+
| docker login --username AWS --password-stdin public.ecr.aws
89+
5390
# We only authenticate to Docker on the 'aws/jsii' repo, as forks will not have the secret
54-
- name: Login to Docker
91+
- name: Login to Docker Hub
5592
if: steps.should-run.outputs.result == 'true' && github.repository == 'aws/jsii'
5693
# The DOCKER_CREDENTIALS secret is expected to contain a username:token pair
5794
run: |-
@@ -70,6 +107,12 @@ jobs:
70107
id: buildx
71108
if: steps.should-run.outputs.result == 'true'
72109
uses: docker/setup-buildx-action@v2
110+
with:
111+
# Disable parallelism because IO contention makes it too slow on GitHub
112+
# workers...
113+
config-inline: |-
114+
[worker.oci]
115+
max-parallelism = 1
73116
74117
# We only restore GH cache if we are not going to publish the result (i.e: PR validation)
75118
- name: Set up layer cache
@@ -85,7 +128,7 @@ jobs:
85128
# 1 pull per second from ECR Public
86129
- name: Jitter the start time to avoid ECR Public throttling
87130
id: sleep-start
88-
if: steps.should-run.outputs.result == 'true'
131+
if: steps.should-run.outputs.result == 'true' && steps.federate_to_aws.outputs.enabled != true
89132
run: |-
90133
sleep $((RANDOM % 60))
91134
@@ -111,27 +154,12 @@ jobs:
111154
-f superchain/Dockerfile \
112155
.
113156
114-
# Testing sequentially, because in parallel it's too slow due to IO contention
115-
- name: Test Image (AMD64)
116-
if: steps.should-run.outputs.result == 'true'
117-
run: |-
118-
docker buildx build \
119-
--builder ${{ steps.buildx.outputs.name }} \
120-
--platform linux/amd64 \
121-
--target superchain \
122-
--cache-from type=local,src=/tmp/.buildx-cache \
123-
--cache-to type=local,dest=/tmp/.buildx-cache \
124-
--build-arg BUILD_TIMESTAMP="${{ steps.build-time.outputs.value }}" \
125-
--build-arg COMMIT_ID='${{ github.sha }}' \
126-
--build-arg NODE_MAJOR_VERSION=${{ matrix.node }} \
127-
-f superchain/Dockerfile \
128-
.
129-
- name: Test Image (ARM64)
157+
- name: Test Image
130158
if: steps.should-run.outputs.result == 'true'
131159
run: |-
132160
docker buildx build \
133161
--builder ${{ steps.buildx.outputs.name }} \
134-
--platform linux/arm64 \
162+
--platform linux/amd64,linux/arm64 \
135163
--target superchain \
136164
--cache-from type=local,src=/tmp/.buildx-cache \
137165
--cache-to type=local,dest=/tmp/.buildx-cache \

.github/workflows/main.yml

+4-10
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ jobs:
2828
- name: Check out
2929
uses: actions/checkout@v3
3030
# Set up all of our standard runtimes
31-
- name: Set up .NET 5
31+
- name: Set up .NET 6
3232
uses: actions/setup-dotnet@v2
3333
with:
34-
dotnet-version: '5.0.x'
34+
dotnet-version: '6.0.x'
3535
- name: Set up Go 1.16
3636
uses: actions/setup-go@v3
3737
with:
@@ -122,10 +122,10 @@ jobs:
122122
- name: Check out
123123
uses: actions/checkout@v3
124124
# Set up all of our standard runtimes
125-
- name: Set up .NET 5
125+
- name: Set up .NET 6
126126
uses: actions/setup-dotnet@v2
127127
with:
128-
dotnet-version: '5.0.x'
128+
dotnet-version: '6.0.x'
129129
- name: Set up Go 1.16
130130
uses: actions/setup-go@v3
131131
with:
@@ -240,12 +240,6 @@ jobs:
240240
node: '14'
241241
python: '3.7'
242242
# Test alternate .NETs
243-
- java: '8'
244-
dotnet: '5.0.x'
245-
go: '1.16'
246-
node: '14'
247-
os: ubuntu-latest
248-
python: '3.7'
249243
- java: '8'
250244
dotnet: '6.0.x'
251245
go: '1.16'

.mergify/config.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ queue_rules:
1414
- status-success~=^Test \(.* node 18 .*$
1515
# One test for each supported dotnet version
1616
- status-success~=^Test \(.* dotnet 3\.1\.x .*$
17-
- status-success~=^Test \(.* dotnet 5\.0\.x .*$
17+
- status-success~=^Test \(.* dotnet 6\.0\.x .*$
1818
# One test for Java 8 and 11
1919
- status-success~=^Test \(.* java 8 .*$
2020
- status-success~=^Test \(.* java 11 .*$
@@ -64,7 +64,7 @@ pull_request_rules:
6464
- status-success~=^Test \(.* node 18 .*$
6565
# One test for each supported dotnet version
6666
- status-success~=^Test \(.* dotnet 3\.1\.x .*$
67-
- status-success~=^Test \(.* dotnet 5\.0\.x .*$
67+
- status-success~=^Test \(.* dotnet 6\.0\.x .*$
6868
# One test for Java 8 and 11
6969
- status-success~=^Test \(.* java 8 .*$
7070
- status-success~=^Test \(.* java 11 .*$
@@ -114,7 +114,7 @@ pull_request_rules:
114114
- status-success~=^Test \(.* node 18 .*$
115115
# One test for each supported dotnet version
116116
- status-success~=^Test \(.* dotnet 3\.1\.x .*$
117-
- status-success~=^Test \(.* dotnet 5\.0\.x .*$
117+
- status-success~=^Test \(.* dotnet 6\.0\.x .*$
118118
# One test for Java 8 and 11
119119
- status-success~=^Test \(.* java 8 .*$
120120
- status-success~=^Test \(.* java 11 .*$
@@ -164,7 +164,7 @@ pull_request_rules:
164164
- status-success~=^Test \(.* node 18 .*$
165165
# One test for each supported dotnet version
166166
- status-success~=^Test \(.* dotnet 3\.1\.x .*$
167-
- status-success~=^Test \(.* dotnet 5\.0\.x .*$
167+
- status-success~=^Test \(.* dotnet 6\.0\.x .*$
168168
# One test for Java 8 and 11
169169
- status-success~=^Test \(.* java 8 .*$
170170
- status-success~=^Test \(.* java 11 .*$

CHANGELOG.md

+15
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [1.63.0](https://github.com/aws/jsii/compare/v1.62.0...v1.63.0) (2022-07-26)
6+
7+
8+
### Features
9+
10+
* **jsii:** allow specifying baseUrl and paths in tsconfig.json ([#3662](https://github.com/aws/jsii/issues/3662)) ([7eb11b7](https://github.com/aws/jsii/commit/7eb11b7d3173f450cd6bd4c29180f6edf7f6b219)), closes [#865](https://github.com/aws/jsii/issues/865)
11+
* **python:** add dynamic type checking ([#3660](https://github.com/aws/jsii/issues/3660)) ([6c4b773](https://github.com/aws/jsii/commit/6c4b77301341add25df059c66fabde225377a48a)), closes [#3639](https://github.com/aws/jsii/issues/3639)
12+
13+
14+
### Bug Fixes
15+
16+
* **go:** unused imports emitted for type unions ([#3664](https://github.com/aws/jsii/issues/3664)) ([68a80d9](https://github.com/aws/jsii/commit/68a80d98f1faa5772862c18b6907ca2298dccc76)), closes [#3399](https://github.com/aws/jsii/issues/3399)
17+
* **rosetta:** infuse incorrectly handles compressed assemblies ([#3669](https://github.com/aws/jsii/issues/3669)) ([a5bd219](https://github.com/aws/jsii/commit/a5bd2196f2e2e43686c3013a4671c55ddd8ee248))
18+
* **rosetta:** tablet compression handled incorrectly in multiple places ([#3670](https://github.com/aws/jsii/issues/3670)) ([30eded9](https://github.com/aws/jsii/commit/30eded98ec05734f687023ca04ec09769fb1e331)), closes [#3652](https://github.com/aws/jsii/issues/3652)
19+
520
## [1.62.0](https://github.com/aws/jsii/compare/v1.61.0...v1.62.0) (2022-07-12)
621

722

gh-pages/content/user-guides/lib-author/configuration/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ are set in the `jsii.tsc` section of the `package.json` file, but use the same n
197197
default, all visible `@types/*` packages will be loaded, which can be undesirable (in particular in monorepos, where
198198
some type libraries are not compatible with the TypeScript compiler version that `jsii` uses). The value specified
199199
here will be forwarded as-is to the TypeScript compiler.
200+
- `baseUrl` and `paths` can be used to configure TypeScript path mappings, and are copied verbatim to `tsconfig.json`.
200201

201202
Refer to the [TypeScript compiler options reference][ts-options] for more information about those options.
202203

gh-pages/requirements-dev.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
mkdocs~=1.3.0
2-
mkdocs-awesome-pages-plugin~=2.7.0
3-
mkdocs-material~=8.3.8
1+
mkdocs~=1.3.1
2+
mkdocs-awesome-pages-plugin~=2.8.0
3+
mkdocs-material~=8.3.9
44
mkdocs-git-revision-date-plugin~=0.3.2

lerna.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
"rejectCycles": true
1111
}
1212
},
13-
"version": "1.62.0"
13+
"version": "1.63.0"
1414
}

package.json

+12-12
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,26 @@
1515
"compliance": "(cd tools/jsii-compliance && yarn report)"
1616
},
1717
"devDependencies": {
18-
"@jest/types": "^28.1.1",
19-
"@types/jest": "^28.1.4",
20-
"@types/node": "^14.18.21",
21-
"@typescript-eslint/eslint-plugin": "^5.30.5",
22-
"@typescript-eslint/parser": "^5.30.5",
18+
"@jest/types": "^28.1.3",
19+
"@types/jest": "^28.1.6",
20+
"@types/node": "^14.18.22",
21+
"@typescript-eslint/eslint-plugin": "^5.30.7",
22+
"@typescript-eslint/parser": "^5.30.7",
2323
"all-contributors-cli": "^6.20.0",
24-
"eslint": "^8.19.0",
24+
"eslint": "^8.20.0",
2525
"eslint-config-prettier": "^8.5.0",
2626
"eslint-import-resolver-node": "^0.3.6",
27-
"eslint-import-resolver-typescript": "^3.2.4",
27+
"eslint-import-resolver-typescript": "^3.3.0",
2828
"eslint-plugin-import": "^2.26.0",
2929
"eslint-plugin-prettier": "^4.2.1",
30-
"jest": "^28.1.2",
31-
"jest-circus": "^28.1.2",
32-
"jest-config": "^28.1.2",
30+
"jest": "^28.1.3",
31+
"jest-circus": "^28.1.3",
32+
"jest-config": "^28.1.3",
3333
"jest-expect-message": "^1.0.2",
34-
"lerna": "^5.1.6",
34+
"lerna": "^5.1.8",
3535
"prettier": "^2.7.1",
3636
"standard-version": "^9.5.0",
37-
"ts-node": "^10.8.2",
37+
"ts-node": "^10.9.1",
3838
"typescript": "~4.7.4"
3939
},
4040
"repository": {

packages/@jsii/Directory.Build.targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<PackageReference Update="Microsoft.CodeQuality.Analyzers" Version="3.3.2" />
1212

1313
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.2.0" />
14-
<PackageReference Update="NSubstitute" Version="4.3.0" />
14+
<PackageReference Update="NSubstitute" Version="4.4.0" />
1515
<PackageReference Update="xunit" Version="2.4.1" />
1616
<PackageReference Update="xunit.runner.visualstudio" Version="2.4.5" />
1717
<PackageReference Update="XunitXml.TestLogger" Version="3.0.70" />

packages/@jsii/benchmarks/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"dependencies": {
88
"fs-extra": "^10.1.0",
99
"jsii": "^0.0.0",
10-
"npm": "^8.13.2",
10+
"npm": "^8.14.0",
1111
"tar": "^6.1.11",
1212
"typescript": "~3.9.10",
1313
"yargs": "^16.2.0"

packages/@jsii/java-runtime/pom.xml.t.js

+11-4
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ process.stdout.write(`<?xml version="1.0" encoding="UTF-8"?>
6060
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
6161
<!-- Versions of the dependencies -->
6262
<hamcrest.version>[1.3,1.4-a0)</hamcrest.version>
63-
<jackson.version>[2.11.3,2.12-a0)</jackson.version>
63+
<jackson.version>[2.11.3,2.14-a0)</jackson.version>
6464
<javax-annotations.version>[1.3.2,1.4.0)</javax-annotations.version>
65-
<jetbrains-annotations.version>[13.0.0,20.0-a0)</jetbrains-annotations.version>
66-
<junit.version>[5.7.0,5.8-a0)</junit.version>
67-
<mockito.version>[3.5.13,4.0-a0)</mockito.version>
65+
<jetbrains-annotations.version>[13.0.0,24.0-a0)</jetbrains-annotations.version>
66+
<junit.version>[5.8.0,5.10-a0)</junit.version>
67+
<mockito.version>[3.12.4,4.0-a0)</mockito.version>
6868
</properties>
6969
7070
<dependencies>
@@ -82,6 +82,13 @@ process.stdout.write(`<?xml version="1.0" encoding="UTF-8"?>
8282
<version>\${jackson.version}</version>
8383
</dependency>
8484
85+
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.datatype/jackson-datatype-jsr310 -->
86+
<dependency>
87+
<groupId>com.fasterxml.jackson.datatype</groupId>
88+
<artifactId>jackson-datatype-jsr310</artifactId>
89+
<version>\${jackson.version}</version>
90+
</dependency>
91+
8592
<!-- https://mvnrepository.com/artifact/org.jetbrains/annotations -->
8693
<dependency>
8794
<groupId>org.jetbrains</groupId>

packages/@jsii/kernel/src/kernel.test.ts

+7-11
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import * as fs from 'fs-extra';
33
import * as os from 'os';
44
import { join } from 'path';
55
import * as path from 'path';
6-
import * as vm from 'vm';
76

87
import * as api from './api';
98
import {
@@ -701,13 +700,13 @@ defineTest('async overrides: two overrides', async (sandbox) => {
701700
expect(callbacks1.callbacks.length).toBe(1);
702701

703702
sandbox.complete({ cbid: callbacks1.callbacks[0].cbid, result: 666 });
704-
await processPendingPromises(sandbox); // processing next promise
703+
await processPendingPromises(); // processing next promise
705704

706705
const callbacks2 = sandbox.callbacks();
707706
expect(callbacks2.callbacks.length).toBe(1);
708707

709708
sandbox.complete({ cbid: callbacks2.callbacks[0].cbid, result: 101 });
710-
await processPendingPromises(sandbox);
709+
await processPendingPromises();
711710

712711
const result = await sandbox.end({ promiseid: promise.promiseid });
713712
expect(result.result).toBe(775);
@@ -744,7 +743,7 @@ defineTest(
744743
// this is needed in order to cycle through another event loop so
745744
// that promises that are lazily called will be processed (nothing ensures
746745
// that the promise callback will be invokes synchronously).
747-
await processPendingPromises(sandbox);
746+
await processPendingPromises();
748747

749748
const callbacks1 = sandbox.callbacks();
750749

@@ -781,7 +780,7 @@ defineTest(
781780
sandbox.complete({ cbid: callbacks1.callbacks[0].cbid, result: 8888 });
782781

783782
// required: process pending promises so that we will get the next one in the callbacks list
784-
await processPendingPromises(sandbox);
783+
await processPendingPromises();
785784

786785
// ------ end of execution of "overrideMe"
787786

@@ -802,11 +801,8 @@ defineTest(
802801
},
803802
);
804803

805-
function processPendingPromises(sandbox: Kernel) {
806-
return vm.runInContext(
807-
'new Promise(done => setImmediate(done));',
808-
(sandbox as any).sandbox,
809-
);
804+
async function processPendingPromises() {
805+
return new Promise<void>((done) => setImmediate(done));
810806
}
811807

812808
defineTest('sync overrides', async (sandbox) => {
@@ -1347,7 +1343,7 @@ defineTest(
13471343
defineTest('node.js standard library', async (sandbox) => {
13481344
const objref = sandbox.create({ fqn: 'jsii-calc.NodeStandardLibrary' });
13491345
const promise = sandbox.begin({ objref, method: 'fsReadFile' });
1350-
await processPendingPromises(sandbox);
1346+
await processPendingPromises();
13511347

13521348
const output = await sandbox.end({ promiseid: promise.promiseid });
13531349
expect(output).toEqual({ result: 'Hello, resource!' });

0 commit comments

Comments
 (0)