-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(java): type generation code-gen issues (#3735)
Some collection validations were emitted twice, due to a bad merge conflict resolution. Additionally, in certain cases where overrides are being emitted for type unions, the type checking code made unnecessary assertions, some of which ending up being prohibited by the compiler. --- By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license]. [Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
- Loading branch information
1 parent
4c2dcd5
commit cf04f79
Showing
3 changed files
with
217 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,8 +39,8 @@ jobs: | |
- name: Set up Java 8 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '8' | ||
distribution: 'zulu' | ||
java-version: '8' | ||
- name: Set up Node 14 | ||
uses: actions/setup-node@v3 | ||
with: | ||
|
@@ -50,30 +50,19 @@ jobs: | |
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.7' | ||
cache: pip | ||
- name: Install python3-venv | ||
run: sudo apt install -y python3-venv | ||
- name: Locate Caches | ||
id: cache-locations | ||
run: |- | ||
echo "::group::Upgrade pip" | ||
# Need to have PIP >= 20.1 for "pip cache dir" to work | ||
python3 -m pip install --upgrade pip | ||
echo "::endgroup" | ||
echo "::set-output name=pip-cache::$(python3 -m pip cache dir)" | ||
- name: Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: |- | ||
${{ steps.cache-locations.outputs.pip-cache }} | ||
~/.m2/repository | ||
!~/.m2/repository/software/amazon/jsii/ | ||
~/.nuget/packages | ||
!~/.nuget/packages/amazon.jsii.* | ||
key: ${{ runner.os }}-node@[email protected]${{ hashFiles('**/yarn.lock', '**/Directory.Build.targets') }} | ||
key: ${{ runner.os }}-${{ hashFiles('**/Directory.Build.targets') }} | ||
restore-keys: |- | ||
${{ runner.os }}-node@[email protected] | ||
${{ runner.os }}-node@14- | ||
${{ runner.os }}- | ||
# Prepare dependencies and build | ||
- name: Install Dependencies | ||
|
@@ -133,8 +122,8 @@ jobs: | |
- name: Set up Java 8 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '8' | ||
distribution: 'zulu' | ||
java-version: '8' | ||
- name: Set up Node 14 | ||
uses: actions/setup-node@v3 | ||
with: | ||
|
@@ -144,30 +133,19 @@ jobs: | |
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.7' | ||
cache: pip | ||
- name: Install python3-venv | ||
run: sudo apt install -y python3-venv | ||
- name: Locate Caches | ||
id: cache-locations | ||
run: |- | ||
echo "::group::Upgrade pip" | ||
# Need to have PIP >= 20.1 for "pip cache dir" to work | ||
python3 -m pip install --upgrade pip | ||
echo "::endgroup" | ||
echo "::set-output name=pip-cache::$(python3 -m pip cache dir)" | ||
- name: Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: |- | ||
${{ steps.cache-locations.outputs.pip-cache }} | ||
~/.m2/repository | ||
!~/.m2/repository/software/amazon/jsii/ | ||
~/.nuget/packages | ||
!~/.nuget/packages/amazon.jsii.* | ||
key: ${{ runner.os }}-node@[email protected]${{ hashFiles('**/yarn.lock', '**/Directory.Build.targets') }} | ||
key: ${{ runner.os }}-${{ hashFiles('**/Directory.Build.targets') }} | ||
restore-keys: |- | ||
${{ runner.os }}-node@[email protected] | ||
${{ runner.os }}-node@14- | ||
${{ runner.os }}- | ||
# Prepare dependencies and build | ||
- name: Install Dependencies | ||
|
@@ -319,8 +297,8 @@ jobs: | |
- name: Set up Java ${{ matrix.java }} | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
distribution: 'zulu' | ||
java-version: ${{ matrix.java }} | ||
- name: Set up Node ${{ matrix.node }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
|
@@ -330,32 +308,21 @@ jobs: | |
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
cache: pip | ||
- name: 'Linux: Install python3-venv' | ||
if: runner.os == 'Linux' | ||
run: sudo apt install -y python3-venv | ||
- name: Locate Caches | ||
id: cache-locations | ||
run: |- | ||
echo "::group::Upgrade pip" | ||
# Need to have PIP >= 20.1 for "pip cache dir" to work | ||
python3 -m pip install --upgrade pip | ||
echo "::endgroup" | ||
echo "::set-output name=pip-cache::$(python3 -m pip cache dir)" | ||
- name: Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: |- | ||
${{ steps.cache-locations.outputs.pip-cache }} | ||
~/.m2/repository | ||
!~/.m2/repository/software/amazon/jsii/ | ||
~/.nuget/packages | ||
!~/.nuget/packages/amazon.jsii.* | ||
# Not including .NET / Java in the cache keys, those artifacts are SDK-version-independent | ||
key: ${{ runner.os }}-node@${{ matrix.node }}-python@${{ matrix.python }}-${{ hashFiles('**/yarn.lock', '**/Directory.Build.targets') }} | ||
key: ${{ runner.os }}-${{ hashFiles('**/Directory.Build.targets') }} | ||
restore-keys: |- | ||
${{ runner.os }}-node@${{ matrix.node }}-python@${{ matrix.python }}- | ||
${{ runner.os }}-node@${{ matrix.node }}- | ||
${{ runner.os }}- | ||
# Run the tests | ||
- name: Install Dependencies | ||
|
@@ -426,3 +393,55 @@ jobs: | |
output-file-path: ${{ runner.temp }}/bench-output.json | ||
github-token: ${{ secrets.PROJEN_GITHUB_TOKEN }} | ||
auto-push: true | ||
|
||
pacmak-integration-test: | ||
name: Integration test (jsii-pacmak) | ||
runs-on: ubuntu-latest | ||
needs: create-release-package | ||
steps: | ||
# Check out the code | ||
- name: Download Artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: release-package | ||
path: ${{ runner.temp }}/release-package | ||
# Set up all of our standard runtimes | ||
- name: Set up .NET 6 | ||
uses: actions/setup-dotnet@v2 | ||
with: | ||
dotnet-version: '6.0.x' | ||
- name: Set up Go 1.18 | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '1.18' | ||
- name: Set up Java 8 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '8' | ||
- name: Set up Node 14 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '14' | ||
- name: Set up Python 3.7 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.7' | ||
- name: Install python3-venv | ||
run: sudo apt install -y python3-venv | ||
# Show time! | ||
- name: Prepare Work Tree | ||
run: |- | ||
npm install --no-save aws-cdk-lib@2 constructs@10 \ | ||
${{ runner.temp }}/release-package/js/*.tgz \ | ||
${{ runner.temp }}/release-package/private/*.tgz | ||
- name: Run jsii-pacmak on aws-cdk-lib | ||
run: |- | ||
./node_modules/.bin/jsii-pacmak ./node_modules/aws-cdk-lib | ||
# Upload artifact (we'll tar it up to save time) | ||
- name: 'Upload Artifact: integtest_aws-cdk-lib' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: integtest_aws-cdk-lib | ||
path: ./node_modules/aws-cdk-lib/dist/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.