ref(aws-lambda): Catch potential exceptions when publishing AWS Lambda layers to new regions#178
Merged
Merged
Conversation
HazAT
approved these changes
Feb 11, 2021
BYK
reviewed
Feb 11, 2021
| return await Promise.all( | ||
| this.awsRegions.map(region => { | ||
| return this.publishLayerToRegion(region); | ||
| const publishedLayers = await Promise.all( |
Member
There was a problem hiding this comment.
There is Promise.allSettled beginning from Node 12.9.
This block would be much easier to follow (and more efficient) with the following code:
const = publishedLayers = await Promise.all(
this.awsRegions.map(
async region => this.publishLayerToRegion(region).catch(error => logger.warn(`Something went wrong when publishing to AWS region ${region}: ${error.message}`))
)
);
Comment on lines
+118
to
+120
| return publishedLayers.filter(layer => { | ||
| return layer !== undefined; | ||
| }) as PublishedLayer[]; |
Member
There was a problem hiding this comment.
Better as return publishedLayers.filter(Boolean);
BYK
added a commit
that referenced
this pull request
Jun 23, 2026
## Summary Resolves **10 open Dependabot alerts** across 5 CVEs and dismisses 2 low-severity esbuild alerts as tolerable risk. ### Alerts Fixed | Alert(s) | Package | Severity | CVE | Fix | |----------|---------|----------|-----|-----| | #180, #181 | `tar` | Medium | GHSA-vmf3-w455-68vh | Bump direct pin `7.5.11` -> `7.5.16` | | #178, #179 | `form-data` | High | GHSA-hmw2-7cc7-3qxx | `pnpm.overrides` for `4.0.6` (v4) and `2.5.6` (v2) | | #172, #176 | `vite` (root) | High + Medium | GHSA-fx2h-pf6j-xcff, GHSA-v6wh-96g9-6wx3 | Add as direct devDep `^7.3.5` + override | | #173, #177 | `vite` (docs) | High + Medium | same | `pnpm.overrides` in docs | | #174, #175 | `astro` | High + Medium | GHSA-2pvr-wf23-7pc7, GHSA-jrpj-wcv7-9fh9 | `pnpm update` -> `6.4.8` | ### Alerts Dismissed (tolerable_risk) | Alert(s) | Package | Severity | Reason | |----------|---------|----------|--------| | #167, #168 | `esbuild` | Low | GHSA-g7r4-m6w7-qqqr - Windows dev-server only vulnerability. Craft is a CLI tool, docs is a static site. Transitive dep of `[email protected]` which pins `esbuild@^0.27.0` - cannot fix without vite 8 major bump. | ## Changes ### Root project (`package.json`) - `tar`: `7.5.11` -> `7.5.16` (direct pin bump) - `vite`: added as devDependency at `^7.3.5` (was only transitive via vitest) - `pnpm.overrides`: added `form-data@>=4: ^4.0.6`, `form-data@<3: ^2.5.6`, `vite: ^7.3.5` ### Docs project (`docs/package.json`) - `astro`: resolved `5.16.11` -> `6.4.8` (specifier `^6.1.10` allowed it) - `@astrojs/starlight`: resolved `0.37.3` -> `0.38.3` - `pnpm.overrides`: added `vite: ^7.3.5` ## Verification - `pnpm build` - passed - `pnpm test` - 1025 passed, 1 skipped - `pnpm lint` - 0 errors - `pnpm docs:build` - 27 pages built successfully
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AWS regions are requested using the EC2 client, and Lambda layers are published to these regions using the Lambda client. However, it may be possible that an exception is raised (such as a timeout exception). With this PR these exceptions are catched and warned, without stopping Craft. Note that even if there's an exception, layers may be created.