Skip to content

Commit

Permalink
chore(release): 1.106.0 (#4728)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrgrain authored Dec 16, 2024
2 parents 0a2adcb + 3fc147d commit e852934
Show file tree
Hide file tree
Showing 746 changed files with 2,688 additions and 42,782 deletions.
27 changes: 10 additions & 17 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
{
"name": "Dev Container - aws/jsii",
"build": {
"dockerfile": "superchain/Dockerfile",
"context": ".",
"target": "superchain",
"args": {
"BUILD_TIMESTAMP": "unknown",
"COMMIT_ID": "HEAD",
"REGISTRY": "docker.io/library",
},
},
"containerUser": "superchain",
"remoteUser": "superchain",
"postCreateCommand": "yarn install && yarn build",
"extensions": [
"[email protected]",
],
"name": "Dev Container - aws/jsii",
"image": "public.ecr.aws/jsii/superchain:1-bookworm-slim",
"containerUser": "superchain",
"remoteUser": "superchain",
"postCreateCommand": "yarn install",
"customizations": {
"vscode": {
"extensions": ["dbaeumer.vscode-eslint", "Orta.vscode-jest"]
}
}
}
287 changes: 0 additions & 287 deletions .github/workflows/docker-images.yml

This file was deleted.

105 changes: 23 additions & 82 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
# Workflows pertaining to the main branch
name: Main

on:
merge_group: {}
pull_request:
branches: [main, release]
push:
branches: [main, release]

env:
DOTNET_NOLOGO: true
NODE_OPTIONS: --max-old-space-size=4096

# This workflows currently has the following jobs:
# - build : Builds the source tree as-is
# - test : Runs all unit tests against the build result
# - create-release-package : Prepares a release package with the "real" version
# - integ-test : Runs integration tests against the release package

jobs:
build:
name: Build
Expand Down Expand Up @@ -101,7 +97,6 @@ jobs:
&& echo "Untracked files: ${untracked:-<none>}" \
&& test -z "${untracked}"
shell: bash

create-release-package:
name: Create Release Package
permissions:
Expand Down Expand Up @@ -182,7 +177,6 @@ jobs:
with:
name: release-package
path: ${{ github.workspace }}/dist/

test:
permissions:
contents: none
Expand Down Expand Up @@ -291,9 +285,7 @@ jobs:
java: '8'
node: '18'
os: ubuntu-latest

runs-on: ${{ matrix.os }}

steps:
# Check out the code
- name: Download Artifact
Expand Down Expand Up @@ -366,80 +358,30 @@ jobs:
&& echo "Untracked files: ${untracked:-<none>}" \
&& test -z "${untracked}"
shell: bash

test-ok:
name: Unit Tests
runs-on: ubuntu-latest
needs: test
steps:
- name: OK
# This is just a join target to simplify branch protection setup
run: echo OK

benchmark:
name: Run benchmark suite
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
needs: build
needs:
- test
if: always()
steps:
# Check out the code
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: built-tree
- name: Extract Artifact
run: |-
echo "::group::Untar Archive"
tar zxvf built-tree.tgz
echo "::endgroup"
rm built-tree.tgz
- name: Set up Node
uses: actions/setup-node@v4
with:
cache: yarn
node-version: 'lts/*'
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Run Benchmark
working-directory: packages/@jsii/benchmarks
run: yarn bench --output ${{ runner.temp }}/bench-output.json
- name: Compare Benchmark Results
if: github.event_name == 'pull_request'
uses: benchmark-action/github-action-benchmark@v1
with:
name: jsii Benchmark Regression
tool: 'customSmallerIsBetter'
output-file-path: ${{ runner.temp }}/bench-output.json
comment-always: true
github-token: ${{ secrets.GITHUB_TOKEN }}
fail-on-alert: true
- name: Upload Benchmark Results
if: github.event_name == 'push'
uses: benchmark-action/github-action-benchmark@v1
with:
name: jsii Benchmark
tool: 'customSmallerIsBetter'
output-file-path: ${{ runner.temp }}/bench-output.json
github-token: ${{ secrets.PROJEN_GITHUB_TOKEN }}
auto-push: true

- name: Build result
run: echo ${{ needs.test.result }}
- if: ${{ needs.test.result != 'success' }}
name: Set status based on matrix build
run: exit 1
pacmak-integration-test:
runs-on: ubuntu-latest
needs: create-release-package
strategy:
fail-fast: false
matrix:
rosetta:
# this will be the 1.x-dev version build in this repo
- ./jsii-rosetta.tgz
- 5.2.x
- 5.3.x
- latest
- 5.4.x
- 5.5.x
- 5.6.x
- 5.7.x
steps:
# Check out the code
- name: Download Artifact
Expand Down Expand Up @@ -473,15 +415,11 @@ jobs:
run: sudo apt install -y python3-venv
# Show time!
- name: Prepare Work Tree
# 1) Move the locally build version of jsii-rosetta somewhere else
# 2) Remove @jsii/integ-test because it messed up version dependencies and is not needed
# 3) Install aws-cdk-lib, and all locally build packages minus jsii-rosetta & @jsii/integ-test,
# and the specific version of jsii-rosetta
# This ensures we are running jsii-pacmak with the correct peer-dependency
# 4) Print the jsii-rosetta version for confirmation
# 1) Install aws-cdk-lib,
# all locally build packages,
# the specific version of jsii-rosetta.
# 2) Print the jsii-rosetta version for confirmation
run: |-
mv ${{ runner.temp }}/release-package/js/jsii-rosetta.tgz ./jsii-rosetta.tgz
rm ${{ runner.temp }}/release-package/private/@jsii-integ-test.tgz
npm install --no-save --omit=dev \
aws-cdk-lib@2 \
constructs@10 \
Expand All @@ -498,17 +436,20 @@ jobs:
./node_modules/.bin/jsii-pacmak --no-parallel ./node_modules/aws-cdk-lib
# Upload artifact only on main and for latest rosetta
- name: 'Upload Artifact: integtest_aws-cdk-lib'
if: github.ref == 'ref/head/main' && matrix.rosetta == '5.4.x'
if: github.ref == 'ref/head/main' && matrix.rosetta == 'latest'
uses: actions/upload-artifact@v4
with:
name: integtest_aws-cdk-lib
path: ./node_modules/aws-cdk-lib/dist/

pacmak-integration-test-ok:
name: Integration test (jsii-pacmak)
runs-on: ubuntu-latest
needs: pacmak-integration-test
needs:
- pacmak-integration-test
if: always()
steps:
- name: OK
# This is just a join target to simplify branch protection setup
run: echo OK
- name: Build result
run: echo ${{ needs.pacmak-integration-test.result }}
- if: ${{ needs.pacmak-integration-test.result != 'success' }}
name: Set status based on matrix build
run: exit 1
4 changes: 2 additions & 2 deletions .github/workflows/yarn-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ jobs:
# Upgrade all production dependencies (and other always major-pinned dependencies)
lerna exec --parallel ncu -- --upgrade --target=minor \
--filter='@types/diff,@types/fs-extra,${{ steps.production-dependencies.outputs.list }}' \
--reject='typescript,@xmldom/xmldom,${{ steps.monorepo-packages.outputs.list }}'
--reject='typescript,@xmldom/xmldom,jsii,jsii-rosetta,${{ steps.monorepo-packages.outputs.list }}'
# Upgrade all minor-pinned dependencies
lerna exec --parallel ncu -- --upgrade --target=patch \
--filter=typescript,@xmldom/xmldom
# Upgrade all other dependencies (devDependencies) to the latest
lerna exec --parallel ncu -- --upgrade --target=latest \
--reject='@types/diff,@types/inquirer,@types/node,@types/fs-extra,@types/yargs,@xmldom/xmldom,glob,typescript,typescript-json-schema,${{ steps.production-dependencies.outputs.list }},${{ steps.monorepo-packages.outputs.list }}'
--reject='@types/diff,@types/inquirer,@types/node,@types/fs-extra,@types/yargs,@xmldom/xmldom,glob,typescript,typescript-json-schema,${{ steps.production-dependencies.outputs.list }},jsii,jsii-rosetta,${{ steps.monorepo-packages.outputs.list }}'
# This will ensure the current lockfile is up-to-date with the dependency specifications (necessary for "yarn update" to run)
- name: Run "yarn install"
Expand Down
13 changes: 5 additions & 8 deletions .mergify/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
queue_rules:
- name: default-squash
conditions:
- status-success~=^jsii/superchain
- status-success=Unit Tests
- status-success=Integration test (jsii-pacmak)
commit_message_template: |-
{{ title }} (#{{ number }})
Expand All @@ -12,8 +12,8 @@ queue_rules:

- name: default-merge
conditions:
- status-success~=^jsii/superchain
- status-success=Unit Tests
- status-success=Integration test (jsii-pacmak)
commit_message_template: |-
{{ title }} (#{{ number }})
Expand Down Expand Up @@ -47,9 +47,8 @@ pull_request_rules:
- '#review-requested=0'
- '#changes-requested-reviews-by=0'
- status-success=Validate PR Title
# Docker image validation
- status-success~=^Done$
- status-success=Unit Tests
- status-success=Integration test (jsii-pacmak)

- name: Synchronize that PR to upstream and merge it (squash)
actions:
Expand All @@ -73,9 +72,8 @@ pull_request_rules:
- '#review-requested=0'
- '#changes-requested-reviews-by=0'
- status-success=Validate PR Title
# Docker image validation
- status-success~=^jsii/superchain
- status-success=Unit Tests
- status-success=Integration test (jsii-pacmak)

- name: Synchronize that PR to upstream and merge it (no-squash)
actions:
Expand All @@ -99,9 +97,8 @@ pull_request_rules:
- '#review-requested=0'
- '#changes-requested-reviews-by=0'
- status-success=Validate PR Title
# Docker image validation
- status-success~=^jsii/superchain
- status-success=Unit Tests
- status-success=Integration test (jsii-pacmak)

- name: Clean branch up
actions:
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

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.

## [1.106.0](https://github.com/aws/jsii/compare/v1.105.0...v1.106.0) (2024-12-16)


### Features

* **pacmak:** support jsii-rosetta 5.7 ([#4718](https://github.com/aws/jsii/issues/4718)) ([c4f52a7](https://github.com/aws/jsii/commit/c4f52a7fbde25e124b64afea4a1884c6f1f0ded2))

## [1.105.0](https://github.com/aws/jsii/compare/v1.104.0...v1.105.0) (2024-11-14)


Expand Down
41 changes: 18 additions & 23 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,9 @@ will need a number of tools.
We have built a Docker image with all the required tools, which we are using for
our own CI/CD: the ["superchain" image][superchain] from.

[superchain]: https://github.com/aws/jsii/blob/main/superchain/Dockerfile
[superchain]: https://github.com/aws/jsii-superchain

The image can be built for local usage, too:

```console
IMAGE=superchain
docker build -t ${IMAGE} -f superchain/Dockerfile .
```

In order to get an interactive shell within a Docker container using the
*superchain* image you just built:

```console
cd jsii # go to the root of the jsii repo
docker run --rm --net=host -it -v $PWD:$PWD -w $PWD ${IMAGE}
```

In the shell that pops up, the `npm run` commands in the following sections must
be executed.
Please see the superchain repo for usage instructions.

### Alternative: Manually install the toolchain

Expand Down Expand Up @@ -99,7 +83,7 @@ Each one of these scripts can be executed either from the root of the repo using
Troubleshooting bugs usually starts with adding a new test that demonstrates the
faulty behavior, then modifying implementations until the test passes.

The `jsii-calc` and `@scope/*` packages are used to test expected brhavior from
The `jsii-calc` and `@scope/*` packages are used to test expected behavior from
the compiler (note that the [aws/jsii-compiler](github.com/aws/jsii-compiler)
repository as a separate copy of these under the `fixtures` directory), as well
as downstream tooling (`jsii-pacmak`, `jsii-rosetta`, etc...). Each language
Expand Down Expand Up @@ -265,14 +249,25 @@ whether or not it is supported and tested, and produces appropriate warnings in
- [https://endoflife.date/nodejs](https://endoflife.date/nodejs)
- [Adding support for node 22 PR](https://github.com/aws/jsii/pull/4489)

## Support for new `jsii-rosetta` versions
## Support for new `jsii` & `jsii-rosetta` versions

When a new minor version of `jsii-rosetta` (modern) is released, we need to update the `jsii-pacmak` package.
`jsii-pacmak` uses `jsii-rosetta` to transpile examples in documentation.
Because every package can use its own version of jsii, TypeScript and jsii-rosetta, it is declared as a peer dependency.
To ensure compatibility, we also have integration tests.

### Adding a new `jsii-rosetta` version
### Adding a new `jsii` & `jsii-rosetta` version

1. Add the new version to the `jsii-rosetta` peer dependency in [package.json](./packages/jsii-pacmak/package.json)
2. Add the new version to the `pacmak-integration-test` matrix in the main build workflow in [main.yml](.github/workflows/main.yml)
Run the following command. It takes care of the required changes.
The script needs `jq` and `yq` installed to run.

```console
yarn upgrade:jsii
```

Then you need to run the build and update snapshots locally:

```console
yarn build
yarn test:update
```
Loading

0 comments on commit e852934

Please sign in to comment.