Skip to content

Commit

Permalink
Merge branch 'master' into async-lib/plugins/package
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamba committed Jul 2, 2021
2 parents 96f7203 + 3e14f06 commit 23f2827
Show file tree
Hide file tree
Showing 71 changed files with 3,069 additions and 316 deletions.
50 changes: 39 additions & 11 deletions .github/workflows/integrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,40 @@ jobs:
- name: Unit tests
run: npm test -- -b

linuxNode16:
name: '[Linux] Node.js 16: Isolated unit tests'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Retrieve dependencies from cache
id: cacheNpm
uses: actions/cache@v2
with:
path: |
~/.npm
node_modules
key: npm-v16-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
restore-keys: npm-v16-${{ runner.os }}-${{ github.ref }}-

- name: Install Node.js and npm
uses: actions/setup-node@v1
with:
node-version: 16.x

- name: Install dependencies
if: steps.cacheNpm.outputs.cache-hit != 'true'
run: |
npm update --no-save
npm update --save-dev --no-save
- name: Unit tests
# Some tests depend on TTY support, which is missing in GA runner
# Workaround taken from https://github.com/actions/runner/issues/241#issuecomment-577360161
run: script -e -c "npm run test:isolated -- -b"

linuxNode12:
name: '[Linux] Node.js 12: Isolated unit tests'
name: '[Linux] Node.js 12: Unit tests with coverage'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down Expand Up @@ -130,10 +162,12 @@ jobs:
- name: Unit tests
# Some tests depend on TTY support, which is missing in GA runner
# Workaround taken from https://github.com/actions/runner/issues/241#issuecomment-577360161
run: script -e -c "npm run test:isolated -- -b"
run: script -e -c "npm run coverage"
- name: Push coverage
run: npx codecov

linuxNode10:
name: '[Linux] Node.js v10: Unit tests with coverage'
name: '[Linux] Node.js v10: Unit tests'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down Expand Up @@ -162,18 +196,12 @@ jobs:
- name: Unit tests
# Some tests depend on TTY support, which is missing in GA runner
# Workaround taken from https://github.com/actions/runner/issues/241#issuecomment-577360161
run: script -e -c "npm run coverage"
- name: Push coverage
# TODO: Remove inline token, once support for GA is added on Codecov side
# See: https://github.com/codecov/codecov-node/issues/118
env:
CODECOV_TOKEN: 3898f3e1-f317-453e-a3a9-0462390f93c5
run: npx codecov
run: script -e -c "npm test -- -b"

integrate:
name: Integrate
runs-on: ubuntu-latest
needs: [linuxNode14, windowsNode14, linuxNode12, linuxNode10]
needs: [linuxNode14, windowsNode14, linuxNode16, linuxNode12, linuxNode10]
timeout-minutes: 30 # Default is 360
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand Down
50 changes: 40 additions & 10 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,42 @@ jobs:
- name: Unit tests
run: npm test -- -b

linuxNode16:
name: '[Linux] Node.js 16: Isolated unit tests'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Retrieve dependencies from cache
id: cacheNpm
uses: actions/cache@v2
with:
path: |
~/.npm
node_modules
key: npm-v16-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
restore-keys: |
npm-v16-${{ runner.os }}-${{ github.ref }}-
npm-v16-${{ runner.os }}-refs/heads/master-
- name: Install Node.js and npm
uses: actions/setup-node@v1
with:
node-version: 16.x

- name: Install dependencies
if: steps.cacheNpm.outputs.cache-hit != 'true'
run: |
npm update --no-save
npm update --save-dev --no-save
- name: Unit tests
# Some tests depend on TTY support, which is missing in GA runner
# Workaround taken from https://github.com/actions/runner/issues/241#issuecomment-577360161
run: script -e -c "npm run test:isolated -- -b"

linuxNode12:
name: '[Linux] Node.js 12: Isolated unit tests'
name: '[Linux] Node.js 12: Unit tests with coverage'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down Expand Up @@ -136,10 +170,12 @@ jobs:
- name: Unit tests
# Some tests depend on TTY support, which is missing in GA runner
# Workaround taken from https://github.com/actions/runner/issues/241#issuecomment-577360161
run: script -e -c "npm run test:isolated -- -b"
run: script -e -c "npm run coverage"
- name: Push coverage
run: npx codecov

linuxNode10:
name: '[Linux] Node.js v10: Unit tests with coverage'
name: '[Linux] Node.js v10: Unit tests'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down Expand Up @@ -170,10 +206,4 @@ jobs:
- name: Unit tests
# Some tests depend on TTY support, which is missing in GA runner
# Workaround taken from https://github.com/actions/runner/issues/241#issuecomment-577360161
run: script -e -c "npm run coverage"
- name: Push coverage
# TODO: Remove inline token, once support for GA is added on Codecov side
# See: https://github.com/codecov/codecov-node/issues/118
env:
CODECOV_TOKEN: 3898f3e1-f317-453e-a3a9-0462390f93c5
run: npx codecov
run: script -e -c "npm test -- -b"
72 changes: 72 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,78 @@

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.

## [2.50.0](https://github.com/serverless/serverless/compare/v2.49.0...v2.50.0) (2021-07-01)

### Features

- **AWS Lambda:** Support `Fn::If` for `Principal.AWS` ([#9664](https://github.com/serverless/serverless/pull/9664)) ([894ac5b](https://github.com/serverless/serverless/commit/894ac5b6b67eb384dbc29b927161121679afce2d)) ([Piotr Grzesik](https://github.com/pgrzesik))
- **AWS Deploy:** Deprecate `function` option in `deploy` command ([#9364](https://github.com/serverless/serverless/pull/9364)) ([d861d11](https://github.com/serverless/serverless/commit/d861d119ef94baaaa266934783e00a50182d7434)) ([Jaakko Lappalainen](https://github.com/jkklapp) & [Piotr Grzesik](https://github.com/pgrzesik))
- **Variables:**
- Resolve vars in strings which are subject to be joined ([#9657](https://github.com/serverless/serverless/pull/9657)) ([0e3db01](https://github.com/serverless/serverless/commit/0e3db01db8aeb08b03a98dd7f58a09b66ec8c49e)) ([Mariusz Nowak](https://github.com/medikoo))
- Support `aws:region` and `aws:accountId` variables ([#9662](https://github.com/serverless/serverless/pull/9662)) ([33794ea](https://github.com/serverless/serverless/commit/33794ea504e714912137796009c29c802f2e24f0)) ([Piotr Grzesik](https://github.com/pgrzesik))
- Support variables across file address resolution ([#9657](https://github.com/serverless/serverless/pull/9657)) ([80b7640](https://github.com/serverless/serverless/commit/80b76406ac305ccb7e55cabd0bd39be6ac7c67c6)) ([Mariusz Nowak](https://github.com/medikoo))

### Bug Fixes

- **AWS Deploy:** Meaningfully report inaccessible file artifacts ([#9668](https://github.com/serverless/serverless/pull/9668)) ([23c290e](https://github.com/serverless/serverless/commit/23c290e4b4049242d62cfb57f4be6aadff6aecf8)) ([Mariusz Nowak](https://github.com/medikoo))
- **AWS Local Invocation:** Fix error handling of invalid file content ([#9667](https://github.com/serverless/serverless/pull/9667)) ([e836722](https://github.com/serverless/serverless/commit/e836722f976af98eb69fc6d3a85781bb7434dfac)) ([Mariusz Nowak](https://github.com/medikoo))
- **CLI Onboarding:**
- Do not attempt local fallback during onboarding ([#9660](https://github.com/serverless/serverless/pull/9660)) ([ae5be0f](https://github.com/serverless/serverless/commit/ae5be0f5dafaad933000e98142fcb1ec60e04555)) ([Piotr Grzesik](https://github.com/pgrzesik))
- Only call `handleError` if plugin defined ([#9659](https://github.com/serverless/serverless/pull/9659)) ([a80681f](https://github.com/serverless/serverless/commit/a80681ffbf23391cb31d34b8eecaef310d9599a3)) ([Piotr Grzesik](https://github.com/pgrzesik))

### Maintenance Improvements

- **Telemetry:**
- Include `commandUsage` in case of error ([#9671](https://github.com/serverless/serverless/pull/9671)) ([ac03d83](https://github.com/serverless/serverless/commit/ac03d832896eec26773e5ce06c22c249d240a9ed)) ([Piotr Grzesik](https://github.com/pgrzesik))
- Increase error location coverage ([#9669](https://github.com/serverless/serverless/pull/9669)) ([7264d16](https://github.com/serverless/serverless/commit/7264d1672e93fdb1046cf7ebe859b607c80e31ca)) ([Mariusz Nowak](https://github.com/medikoo))
- Report `configValidationMode` ([#9669](https://github.com/serverless/serverless/pull/9669)) ([8e2d48f](https://github.com/serverless/serverless/commit/8e2d48fee5a471a960b6a7b55cbd12edc5eb07e6)) ([Mariusz Nowak](https://github.com/medikoo))
- Report configuration validation result ([#9669](https://github.com/serverless/serverless/pull/9669)) ([01f1586](https://github.com/serverless/serverless/commit/01f158695b22d721320a77a9a0b68b166c63dc3f)) ([Mariusz Nowak](https://github.com/medikoo))

### Templates

- Adjust `runtime` for `openwhisk-python` template ([#9670](https://github.com/serverless/serverless/pull/9670)) ([6a020d1](https://github.com/serverless/serverless/commit/6a020d121ff2dacd6ad62a824964944ae391a662)) ([Piotr Grzesik](https://github.com/pgrzesik))

## [2.49.0](https://github.com/serverless/serverless/compare/v2.48.1...v2.49.0) (2021-06-29)

### Features

- **AWS Lambda:** Support `Fn::FindInMap` for `vpc` config ([#9653](https://github.com/serverless/serverless/pull/9653)) ([34a9d91](https://github.com/serverless/serverless/commit/34a9d91870c36d154427830d3555425b5fd2d14c)) ([Piotr Grzesik](https://github.com/pgrzesik))
- **CLI Onboarding:**
- Add deploy step ([#9536](https://github.com/serverless/serverless/pull/9536)) ([28a06a0](https://github.com/serverless/serverless/commit/28a06a05aba4306d2f28d26652067b44ed105151)) ([Piotr Grzesik](https://github.com/pgrzesik))
- Allow to setup Dashboard Provider credentials during onboarding ([#9509](https://github.com/serverless/serverless/pull/9509)) ([feb0421](https://github.com/serverless/serverless/commit/feb04219f6be186cc54462906394bbd82f9747b5)) ([Piotr Grzesik](https://github.com/pgrzesik))

### Bug Fixes

- **CLI:** Fix standalone detection on Windows ([#9648](https://github.com/serverless/serverless/pull/9648)) ([4bc8e2e](https://github.com/serverless/serverless/commit/4bc8e2e1944364e2c218cbfc05039c43afa9ab01)) ([Mariusz Nowak](https://github.com/medikoo))
- **Packaging:** Fix artifact generation with temp path on other device ([#9616](https://github.com/serverless/serverless/issues/9616)) ([70fb8b9](https://github.com/serverless/serverless/commit/70fb8b986133789b38fad93c0abab01eaf9dc0c7)) ([Sean Dawson](https://github.com/NoxHarmonium))

### Maintenance Improvements

- Replace `fse.chmod` with `fs.promises.chmod` ([#9647](https://github.com/serverless/serverless/issues/9647)) ([83c7726](https://github.com/serverless/serverless/commit/83c772684d655b233522d1e75128476c29339c83)) ([Sudipto Das](https://github.com/sdas13))
- Add `resolveRegion` util ([#9509](https://github.com/serverless/serverless/pull/9509)) ([98e3668](https://github.com/serverless/serverless/commit/98e3668a2cbb701c109e1ff8dd70a0ece1770f7b)) ([Piotr Grzesik](https://github.com/pgrzesik))
- Add `resolveStage` util ([#9509](https://github.com/serverless/serverless/pull/9509)) ([09bb4fa](https://github.com/serverless/serverless/commit/09bb4fa12270807702dcc26483dbcb94cf733342)) ([Piotr Grzesik](https://github.com/pgrzesik))
- **Telemetry:**
- Add `hasLocalCredentials` ([#9594](https://github.com/serverless/serverless/pull/9594)) ([5e0d805](https://github.com/serverless/serverless/commit/5e0d80579e857d016fb4db13288b9d81a3859ee1)) ([Piotr Grzesik](https://github.com/pgrzesik))
- Add interactive flow support ([#9594](https://github.com/serverless/serverless/pull/9594)) ([0eba2dc](https://github.com/serverless/serverless/commit/0eba2dcdfeabba58920462ac2cd54d86e3101e05)) ([Piotr Grzesik](https://github.com/pgrzesik))

### Templates

- Use `amd64` arch for `aws-go` template ([#9646](https://github.com/serverless/serverless/issues/9646)) ([cb9f7e2](https://github.com/serverless/serverless/commit/cb9f7e20eedc1db7bb31671c97449e269e992ded)) ([Andrey Kabylin](https://github.com/sysint64))

### [2.48.1](https://github.com/serverless/serverless/compare/v2.48.0...v2.48.1) (2021-06-25)

### Bug Fixes

- **AWS API Gateway:** Ensure that `Method` resource depends on `Permission` resource ([#9609](https://github.com/serverless/serverless/pull/9609)) ([93b9027](https://github.com/serverless/serverless/commit/93b9027f0d48650df50d0a8352d0edaf2bd2e0da)) ([Nyambayar Turbat](https://github.com/nyamba))
- **CLI:**
- Ensure to list version in case of fallback from some versions ([#9641](https://github.com/serverless/serverless/pull/9641)) ([989cb82](https://github.com/serverless/serverless/commit/989cb82db313177a64e062cc800eb85ba501fab5)) ([Mariusz Nowak](https://github.com/medikoo))
- Fix standalone detection (case of a fallback from standalone) ([#9641](https://github.com/serverless/serverless/pull/9641)) ([1681af4](https://github.com/serverless/serverless/commit/1681af4897eeec20c1d1af292f9bfde5b1e9ffc3)) ([Mariusz Nowak](https://github.com/medikoo))

### Maintenance Improvements

- **Config Schema:** Improve error message and documentation ([#9639](https://github.com/serverless/serverless/pull/9639)) ([a36247b](https://github.com/serverless/serverless/commit/a36247b7ac1212a27f5e8d671ba39ba4c7e4de18)) ([Mariusz Nowak](https://github.com/medikoo))
- Replace `fse.rename` with `fs.promises.rename` ([#9605](https://github.com/serverless/serverless/issues/9605)) ([e6ff228](https://github.com/serverless/serverless/commit/e6ff2286a55d8cb8f82e58d8173b0a386a4b1767)) ([Sudipto Das](https://github.com/sdas13))

## [2.48.0](https://github.com/serverless/serverless/compare/v2.47.0...v2.48.0) (2021-06-21)

### Features
Expand Down
8 changes: 8 additions & 0 deletions docs/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ Note:
- Configuration setting is ineffective for deprecations reported before service configuration is read.
- `SLS_DEPRECATION_DISABLE` env var and `disabledDeprecations` configuration setting remain respected, and no errors will be thrown for mentioned deprecation coodes.

<a name="CLI_DEPLOY_FUNCTION_OPTION"><div>&nbsp;</div></a>

## CLI `--function`/`-f` option for `deploy` command

Deprecation code: `CLI_DEPLOY_FUNCTION_OPTION'`

Starting with v3.0.0, `--function` or `-f` option for `deploy` command will be removed. In order to deploy a single function, please use `deploy function` command instead.

<a name="CHANGE_OF_DEFAULT_RUNTIME_TO_NODEJS14X"><div>&nbsp;</div></a>

## Change of default runtime to `nodejs14.x`
Expand Down
2 changes: 1 addition & 1 deletion docs/providers/aws/events/kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ In the following example, we specify that the `compute` function should be trigg

In order to configure `kafka` event, you have to provide three required properties:

- `accessConfigurations`, which is either secret credentials required to do [SASL_SCRAM auth](https://docs.confluent.io/platform/current/kafka/authentication_sasl/authentication_sasl_scram.html), or this is VPC configuration to allow Lambda to connect to your cluster
- `accessConfigurations`, which is either secret credentials required to do [SASL_SCRAM auth](https://docs.confluent.io/platform/current/kafka/authentication_sasl/authentication_sasl_scram.html),[SASL_PLAIN auth](https://docs.confluent.io/platform/current/kafka/authentication_sasl/authentication_sasl_plain.html) or this is VPC configuration to allow Lambda to connect to your cluster. Valid options are: `saslPlainAuth`, `saslScram256Auth`, or `saslScram512Auth`
- `topic` to consume messages from.
- `bootstrapServers` an array of bootstrap server addresses for your Kafka cluster

Expand Down
6 changes: 3 additions & 3 deletions docs/providers/aws/guide/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -463,15 +463,15 @@ functions:

By default, the framework creates function versions for every deploy. This behavior is optional, and can be turned off in cases where you don't invoke past versions by their qualifier. If you would like to do this, you can invoke your functions as `arn:aws:lambda:....:function/myFunc:3` to invoke version 3 for example.

To turn off this feature, set the provider-level option `versionFunctions`.
Versions are not cleaned up by serverless, so make sure you use a plugin or other tool to prune sufficiently old versions. The framework can't clean up versions because it doesn't have information about whether older versions are invoked or not. This feature adds to the number of total stack outputs and resources because a function version is a separate resource from the function it refers to.

To turn off function versioning, set the provider-level option `versionFunctions`.

```yml
provider:
versionFunctions: false
```

These versions are not cleaned up by serverless, so make sure you use a plugin or other tool to prune sufficiently old versions. The framework can't clean up versions because it doesn't have information about whether older versions are invoked or not. This feature adds to the number of total stack outputs and resources because a function version is a separate resource from the function it refers to.

## Dead Letter Queue (DLQ)

When AWS lambda functions fail, they are [retried](http://docs.aws.amazon.com/lambda/latest/dg/retries-on-errors.html). If the retries also fail, AWS has a feature to send information about the failed request to a SNS topic or SQS queue, called the [Dead Letter Queue](http://docs.aws.amazon.com/lambda/latest/dg/dlq.html), which you can use to track and diagnose and react to lambda failures.
Expand Down
43 changes: 22 additions & 21 deletions docs/providers/aws/guide/serverless.yml.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,27 +77,28 @@ provider:
cacheFrom:
- my-image:latest
cloudFront:
myCachePolicy1: # used as a reference in function.events[].cloudfront.cachePolicy.name
DefaultTTL: 60
MinTTL: 30
MaxTTL: 3600
Comment: my brand new cloudfront cache policy # optional
ParametersInCacheKeyAndForwardedToOrigin:
CookiesConfig:
CookieBehavior: whitelist # Possible values are 'none', 'whitelist', 'allExcept' and 'all'
Cookies:
- my-public-cookie
EnableAcceptEncodingBrotli: true # optional
EnableAcceptEncodingGzip: true
HeadersConfig:
HeadersBehavior: whitelist # Possible values are 'none' and 'whitelist'
Headers:
- authorization
- content-type
QueryStringsConfig:
QueryStringBehavior: allExcept # Possible values are 'none', 'whitelist', 'allExcept' and 'all'
QueryStrings:
- not-cached-query-string
cachePolicies:
myCachePolicy1: # used as a reference in function.events[].cloudfront.cachePolicy.name
DefaultTTL: 60
MinTTL: 30
MaxTTL: 3600
Comment: my brand new cloudfront cache policy # optional
ParametersInCacheKeyAndForwardedToOrigin:
CookiesConfig:
CookieBehavior: whitelist # Possible values are 'none', 'whitelist', 'allExcept' and 'all'
Cookies:
- my-public-cookie
EnableAcceptEncodingBrotli: true # optional
EnableAcceptEncodingGzip: true
HeadersConfig:
HeaderBehavior: whitelist # Possible values are 'none' and 'whitelist'
Headers:
- authorization
- content-type
QueryStringsConfig:
QueryStringBehavior: allExcept # Possible values are 'none', 'whitelist', 'allExcept' and 'all'
QueryStrings:
- not-cached-query-string
versionFunctions: false # Optional function versioning
environment: # Service wide environment variables
serviceEnvVar: 123456789
Expand Down

0 comments on commit 23f2827

Please sign in to comment.