Skip to content

fix: version command refactor #1107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4275134
fix: version command refactor
saragerion Sep 29, 2022
a574406
fix: captureMethod correctly detect method name when used with extern…
dreamorosi Oct 4, 2022
77025b2
chore(cicd): add lerna commands in github actions - PR checks
saragerion Oct 4, 2022
a3763d4
fix(cicd): lint & test commands for examples and layer
saragerion Oct 4, 2022
69d1fcc
fix(cicd): same cached modules for examples and layer PR lint
saragerion Oct 4, 2022
92a3e8d
fix(cicd): add foreground script to ci
saragerion Oct 4, 2022
83f6efb
feat: publish lib as Lambda Layer (#1095)
flochaz Oct 10, 2022
ee243de
fix: ts-node version for layer-publisher (#1112)
flochaz Oct 10, 2022
5f1da98
doc(layer): bump layer version to 2 to match the one built for latest…
flochaz Oct 11, 2022
0bb77af
Chore(tracer): unit tests to verify decorators await decorated class …
dreamorosi Oct 11, 2022
d4174eb
feat(tracer): specify subsegment name when capturing class method (#1…
dreamorosi Oct 11, 2022
3b5c799
chore(layer): fix bundling and e2e tests by manually setting hash of …
flochaz Oct 13, 2022
6f14fb3
fix(all): update version command to use lint-fix (#1119)
dreamorosi Oct 17, 2022
3a6d791
chore(release): v1.3.0 [skip ci]
github-actions[bot] Oct 17, 2022
9b52de4
docs: update layer version in docs (#1120)
dreamorosi Oct 17, 2022
652b7f0
docs: fix format issues (#1122)
dreamorosi Oct 17, 2022
13ec0c4
fix: version command refactor
saragerion Sep 29, 2022
9f65070
chore(cicd): add lerna commands in github actions - PR checks
saragerion Oct 4, 2022
bcab998
fix(cicd): lint & test commands for examples and layer
saragerion Oct 4, 2022
529c9f3
fix(cicd): same cached modules for examples and layer PR lint
saragerion Oct 4, 2022
cda0ee8
fix(cicd): add foreground script to ci
saragerion Oct 4, 2022
0c700d8
fix: merge conflicts
dreamorosi Oct 18, 2022
b9066a5
Revert "fix: merge conflicts"
dreamorosi Oct 18, 2022
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
8 changes: 8 additions & 0 deletions .github/workflows/pr-run-linting-check-and-unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: On PR code update

on:
pull_request:
types: [opened, synchronize]
jobs:
run-linting-check-and-unit-tests:
uses: ./.github/workflows/reusable-run-linting-check-and-unit-tests.yml
8 changes: 0 additions & 8 deletions .github/workflows/pr_lint_and_test.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_call:

jobs:
run-unit-tests-on-utils:
run-linting-check-and-unit-tests:
runs-on: ubuntu-latest
env:
NODE_ENV: dev
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
run: |
npm run build -w packages/commons
npm run build -w packages/logger & npm run build -w packages/tracer & npm run build -w packages/metrics
- name: Lint
- name: Run linting
run: npm run lint -w packages/commons -w packages/logger -w packages/tracer -w packages/metrics
- name: Run unit tests
run: npm t -w packages/commons -w packages/logger -w packages/tracer -w packages/metrics
Expand Down Expand Up @@ -80,6 +80,8 @@ jobs:
# We can skip the install if there was a cache hit
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
- name: Run linting
run: npm run lint
- name: Run tests
run: npm t
check-layer-publisher:
Expand Down Expand Up @@ -108,3 +110,5 @@ jobs:
# We can skip the install if there was a cache hit
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
- name: Run linting
run: npm run lint
1 change: 0 additions & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run lerna-lint-fix
npm run test
Copy link
Contributor

@dreamorosi dreamorosi Oct 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should change this to npm test -ws.

Currently, it will run npm run lerna-test which will run tests in all packages, examples, and layer-publisher.
If instead we changed it to the above we'd be running the unit tests only in packages/* and not in the others.

This is on line with what we discussed in the last conversation about the topic and is captured in #1106. If you want to keep this separate I can open a PR later on.

Aside from where the tests are run only difference between npm run test & npm test -ws is that npm workspaces still doesn't run in parallel but sequentially. I don't think it's a big deal at this stage, but if you want to run it in parallel you can use npm t -w packages/commons & npm t -w packages/logger & npm t -w packages/tracer & npm t -w packages/metrics instead.

2 changes: 2 additions & 0 deletions layer-publisher/src/layer-publisher-stack.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { CfnOutput, RemovalPolicy, Stack, StackProps } from 'aws-cdk-lib';
import { Construct } from 'constructs';
import * as lambda from 'aws-cdk-lib/aws-lambda';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import { LambdaPowertoolsLayer } from 'cdk-lambda-powertools-python-layer';
import { StringParameter } from 'aws-cdk-lib/aws-ssm';
import { CfnLayerVersionPermission } from 'aws-cdk-lib/aws-lambda';
Expand Down
9 changes: 3 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,17 @@
"test": "npm run lerna-test",
"commit": "commit",
"package": "npm run package",
"setup-local": "npm ci --foreground-scripts && cd examples/cdk && npm ci && cd ../.. && cd examples/sam && npm ci && cd ../.. && npm run init-environment",
"setup-local": "npm ci --foreground-scripts && cd examples/cdk && npm ci && cd ../../examples/sam && npm ci && cd ../../layer-publisher && npm ci && cd ../.. && npm run init-environment",
"lerna-test": "lerna exec -- npm run test",
"lerna-test:unit": "lerna exec -- npm run test:unit",
"lerna-test:e2e": "lerna exec -- npm run test:e2e",
"lerna-package": "lerna exec -- npm run package",
"lerna-package-bundle": "lerna exec -- npm run package-bundle",
"lerna-build": "lerna exec -- tsc",
"lerna-build": "lerna exec -- npm run build",
"lerna-lint": "lerna exec -- npm run lint",
"lerna-lint-fix": "lerna exec -- npm run lint-fix",
"lerna-prepare": "lerna exec -- npm run build",
"lerna-prepublishOnly": "lerna exec -- npm test && lerna exec -- npm run lint",
"lerna-preversion": "lerna exec -- npm run lint",
"lerna-version": "lerna exec -- npm run format && git add -A src",
"postversion": "git push && git push --tags",
"postversion": "git push --tags",
"docs-website-build-run": "npm run docs-buildDockerImage && npm run docs-runLocalDocker",
"docs-buildDockerImage": "docker build -t powertool-typescript/docs ./docs/",
"docs-runLocalDocker": "docker run --rm -it -p 8000:8000 -v ${PWD}:/docs powertool-typescript/docs",
Expand Down
5 changes: 1 addition & 4 deletions packages/commons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@
"package": "mkdir -p dist/ && npm pack && mv *.tgz dist/",
"package-bundle": "../../package-bundler.sh commons-bundle ./dist",
"prepare": "npm run build",
"prepublishOnly": "npm test && npm run lint",
"preversion": "npm run lint",
"version": "npm run format && git add -A src",
"postversion": "git push && git push --tags"
"postversion": "git push --tags"
},
"homepage": "https://github.com/awslabs/aws-lambda-powertools-typescript/tree/master/packages/metrics#readme",
"license": "MIT-0",
Expand Down
5 changes: 1 addition & 4 deletions packages/idempotency/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@
"package": "mkdir -p dist/ && npm pack && mv *.tgz dist/",
"package-bundle": "../../package-bundler.sh logger-bundle ./dist",
"prepare": "npm run build",
"prepublishOnly": "npm test && npm run lint",
"preversion": "npm run lint",
"version": "npm run format && git add -A src",
"postversion": "git push && git push --tags"
"postversion": "git push --tags"
},
"homepage": "https://github.com/awslabs/aws-lambda-powertools-typescript/tree/master/packages/idempotency#readme",
"license": "MIT",
Expand Down
5 changes: 1 addition & 4 deletions packages/logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@
"package": "mkdir -p dist/ && npm pack && mv *.tgz dist/",
"package-bundle": "../../package-bundler.sh logger-bundle ./dist",
"prepare": "npm run build",
"prepublishOnly": "npm test && npm run lint",
"preversion": "npm run lint",
"version": "npm run format && git add -A src",
"postversion": "git push && git push --tags"
"postversion": "git push --tags"
},
"homepage": "https://github.com/awslabs/aws-lambda-powertools-typescript/tree/master/packages/logging#readme",
"license": "MIT",
Expand Down
5 changes: 1 addition & 4 deletions packages/metrics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@
"package": "mkdir -p dist/ && npm pack && mv *.tgz dist/",
"package-bundle": "../../package-bundler.sh metrics-bundle ./dist",
"prepare": "npm run build",
"prepublishOnly": "npm test && npm run lint",
"preversion": "npm run lint",
"version": "npm run format && git add -A src",
"postversion": "git push && git push --tags"
"postversion": "git push --tags"
},
"homepage": "https://github.com/awslabs/aws-lambda-powertools-typescript/tree/master/packages/metrics#readme",
"license": "MIT-0",
Expand Down
5 changes: 1 addition & 4 deletions packages/tracer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
"lint": "eslint --ext .ts --no-error-on-unmatched-pattern src tests",
"lint-fix": "eslint --fix --ext .ts --no-error-on-unmatched-pattern src tests",
"prepare": "npm run build",
"prepublishOnly": "npm test && npm run lint",
"preversion": "npm run lint",
"version": "npm run format && git add -A src",
"postversion": "git push && git push --tags",
"postversion": "git push --tags",
"package": "mkdir -p dist/ && npm pack && mv *.tgz dist/",
"package-bundle": "../../package-bundler.sh tracer-bundle ./dist"
},
Expand Down