Skip to content
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

Fix/management lambda update logic and tests #248

Merged
merged 7 commits into from
May 10, 2024

Conversation

necipallef
Copy link
Contributor

No description provided.

Copy link
Contributor

This PR will create a major release 🚀

2.0.0 (2024-05-10)

⚠ BREAKING CHANGES

  • use node 20

Features

  • add ability to override API hosts in AWS Secret (11af4c4)
  • add endpoints structure and error handlers (c473539)
  • add event and ctx types (82c053b)
  • add lambda function update (38b445f)
  • add settings secret, update mgmt lambda permissions (#162) (ab3caa5)
  • check CodeSha256 before upgrading consequent resources (7fdbd21)
  • check version's state after Lambda@Edge function upgrade (12e5aad)
  • do not throw error if the secret manager has unexpected key (c6e3078)
  • improve error handling in mgmt-lambda (3736d14)
  • increase timeout for Fingerprint lambda (1e0ae54)
  • introduce deployment settings (ec13d5f)
  • introduce mgmt-token scheme for authorization (#176) (c884027)
  • mgmt-lambda-update: introduce error codes (6929756)
  • pass AWS clients into handlers (1aa3dc8)
  • remove fpjs_behavior_path variable (4c78f62)
  • rework logging (#184) (a88941c)
  • reworked getting env, updated tests (0b29764)
  • rollout as a code (#161) (0636c1a)
  • status endpoint: return necessary information about Lambda and CloudFront (2f3ceed)
  • update all cache behavior that has fingerprint pro association (#186) (2970364)
  • update lambda existence check (403680c)
  • update package management (#189) (5135b1b)
  • update secrets manager to V3, retrieve secret in mgmt-lambda (a60bee4)
  • upgrade Lambda functions runtime to Node 20 (2818c30)
  • use AWS SDK v3 Client mock for testing (0bb22ce)
  • use revisionId for Lambda code deployment (934dd37)

Bug Fixes

  • agent download reqs did not keep custom queries (e9ee3c4)
  • agent download request headers (b2dcb89)
  • browser cache req headers (4569f5e)
  • cache behavior origin matching logic (7b1ff11)
  • check set log level if true (15d9d53)
  • cloudformation templatex (#188) (a32e4ff)
  • cloudfront update logic add attempt (106b332)
  • don't set code 500 in status endpoint responses (b4a4d04)
  • handle requests with trailing and leading slashes in URI (cabe27a)
  • normalize secret before retrieving values (26ab35f)
  • remove aws-sdk v2 usage (b1d0d72)
  • remove CodePipeline client (ed7d52d)
  • remove CodePipeline part from mgmt code (fb79578)
  • remove FPJS_DEBUG header from the template (e58d6cd)
  • set correct type for public URL events (379ec65)
  • set log level (a02fbf9)
  • treat request.uri as the path, not the URL (131f2b7)
  • update handleResult tests with comparing hrefs (aeb49c8)
  • update logging (07664bc)
  • use default region for getting secret (ec596ec)

Documentation

  • README: fix typo (cac192c)
  • README: update links to v2, add deprecation notice (caa5cfa)

Copy link
Contributor

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements
93.02% (-0.99% 🔻)
640/688
🟢 Branches
81.92% (-0.56% 🔻)
145/177
🟢 Functions
89.93% (-1.8% 🔻)
125/139
🟢 Lines
93.2% (-0.64% 🔻)
603/647
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢
... / delay.ts
40% 100% 0% 100%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / updateHandler.ts
88.97% (-2.76% 🔻)
76.47% (-2.94% 🔻)
93.75% (+1.44% 🔼)
88.46% (-2.99% 🔻)

Test suite run success

169 tests passing in 18 suites.

Report generated by 🧪jest coverage report action from a5685ef

Show full coverage report
St File % Stmts % Branch % Funcs % Lines Uncovered Line #s
🟢 All files 93.02 81.92 89.92 93.19
🟢  mgmt-lambda 98.92 93.33 100 98.92
🟢   DefaultSettings.ts 100 100 100 100
🟢   app.ts 97.91 95 100 97.91 26
🟢   auth.ts 100 100 100 100
🟢   exceptions.ts 100 66.66 100 100 19
🟢   routing.ts 100 100 100 100
🟢  mgmt-lambda/handlers 86.63 60.37 81.48 86.18
🟢   errorHandlers.ts 100 71.42 100 100 22,41
🟡   statusHandler.ts 70.58 8.33 42.85 70.58 72-76,81,84-89
🟢   updateHandler.ts 88.97 76.47 93.75 88.46 45-46,62-63,131,134-137,210-219,308
🔴  mgmt-lambda/utils 40 100 0 100
🔴   delay.ts 40 100 0 100
🟢  proxy/handlers 87.77 86.36 90.32 88.5
🟢   handleAgentDowloading.ts 96.29 66.66 100 96.15 31
🟡   handleResult.ts 76.19 100 76.92 77.5 88-103
🟢   handleStatus.ts 100 100 100 100
🟡  proxy/test 77.77 100 50 71.42
🟡   aws.ts 77.77 100 50 71.42 4-5
🟢  proxy/test/utils/customer-variables 100 100 100 100
🟢   in-memory-customer-variables.ts 100 100 100 100
🟢  proxy/utils 98.11 85.71 97.05 97.94
🟢   buffer.ts 100 100 100 100
🟢   cache-control.ts 100 100 100 100
🟢   cookie.ts 100 100 100 100
🟢   headers.ts 100 100 100 100
🔴   is-blob.ts 0 0 0 0 6-7
🟢   log.ts 85.71 33.33 100 83.33 11
🟢   request.ts 100 100 100 100
🟢   routing.ts 100 100 100 100
🟢   traffic.ts 100 100 100 100
🟢  proxy/utils/customer-variables 100 100 100 100
🟢   customer-variables.ts 100 100 100 100
🟢   defaults.ts 100 100 100 100
🟢   header-customer-variables.ts 100 100 100 100
🟢   maybe-obfuscate-variable.ts 100 100 100 100
🟢   selectors.ts 100 100 100 100
🟢   types.ts 100 100 100 100
🟢  proxy/utils/customer-variables/secrets-manager 95.58 100 100 95.52
🟢   normalize-secret.ts 100 100 100 100
🟢   retrieve-secret.ts 100 100 100 100
🟢   secrets-manager-variables.ts 86.95 100 100 86.95 28,50-55
🟢   validate-secret.ts 100 100 100 100

@necipallef necipallef merged commit f7fc1c8 into rc May 10, 2024
13 of 14 checks passed
@necipallef necipallef deleted the fix/management_lambda_update_logic_and_tests branch May 10, 2024 14:17
@fingerprint-dx-team
Copy link
Contributor

🎉 This PR is included in version 2.0.0-rc.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants