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 controller crash Scripting #279

Merged
merged 228 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
228 commits
Select commit Hold shift + click to select a range
257c00a
Add CI with github actions
EliSnow Feb 19, 2020
02b5aec
Update CI
EliSnow Feb 19, 2020
5132a4d
Update CI
EliSnow Feb 19, 2020
029d8e9
Fix clippy warnings
EliSnow Feb 19, 2020
f73b5a6
Make sure CI clippy checks all packages
EliSnow Feb 20, 2020
48a1833
See if we can make this test pass on CI
EliSnow Feb 20, 2020
c90df3f
Show CI status in README
EliSnow Feb 20, 2020
818e56a
Add `headers_all` property to both `request` and
EliSnow Feb 24, 2020
4bebb9e
Fix bug where non-ascii characters could cause anerror reading a file…
EliSnow Mar 5, 2020
852dd12
License check (#23)* Add cargo-deny to CI and hush warnings* Eliminat…
EliSnow Mar 14, 2020
ee0ce36
Change the format of the stats output file so data can be appended to…
EliSnow Nov 21, 2019
610a0f1
Fixes for json stdout summary output
EliSnow Mar 20, 2020
fe1f8ec
Bump version number
EliSnow Mar 20, 2020
665e848
Update dependencies for results viewer to silence
EliSnow Apr 8, 2020
41eea41
Tweak auto sized buffers to grow anytime there is
EliSnow Apr 9, 2020
791376c
Update the Dockerfile used to build Linux
EliSnow Apr 10, 2020
c645c0a
Add new section to the guide as an introduction to
EliSnow Apr 15, 2020
b7af0dd
Update script for building the guide
EliSnow Apr 16, 2020
f3e2de3
Tweak wording on the design document
EliSnow Apr 16, 2020
d7bb0a6
Fix bug where the `line` `format` of a file
EliSnow Apr 16, 2020
fd68bb1
Add license
EliSnow May 6, 2020
4d49732
Update references from the old repo to the new
EliSnow May 8, 2020
8bf3b5a
Fix release CI badge
EliSnow May 8, 2020
99afca6
Fix issue when, under heavy load, pewpew panicswith message "found a …
EliSnow Apr 17, 2020
621dd97
Update mod_interval to futures 0.3 async/await
EliSnow Apr 24, 2020
27e0fdd
Update select_any to futures 0.3 async/await
EliSnow Apr 27, 2020
68a609f
Updating main WIP
EliSnow Apr 28, 2020
6dc07e5
Update body_reader
EliSnow May 22, 2020
629ea6d
Update channel
EliSnow May 22, 2020
e86c585
Update config/expressions
EliSnow May 22, 2020
eb59dbb
Update either
EliSnow May 22, 2020
9e5a05f
Update for_each_parallel
EliSnow May 22, 2020
cf43aee
Update mod_interval
EliSnow May 22, 2020
bbb64a6
Update select_any
EliSnow May 22, 2020
a34b99f
Update test_common
EliSnow May 22, 2020
d299bfc
Update zip_all
EliSnow May 22, 2020
0036574
Update main. Stuck on compiler bug
EliSnow May 22, 2020
086e194
All tests passing and watching for changes works
EliSnow Jun 3, 2020
cba46fd
Fix clippy lints
EliSnow Jun 3, 2020
7405f49
Update the GitHub action for releases to check
EliSnow Jun 3, 2020
ca053ef
Fix previous issue in release GitHub action
EliSnow Jun 3, 2020
779c35a
Fix issue with conditional compilation causing
EliSnow Jun 3, 2020
b0bb863
Another attempt to fix release CI
EliSnow Jun 3, 2020
d2c39ae
Fix bug where each segment of a load pattern had
EliSnow Jun 4, 2020
b4e0745
Fix failing CI test on windows resulting from
EliSnow Jun 4, 2020
56db61a
Tweak how we determine the limit for parallel
EliSnow Jun 5, 2020
06e3e01
Preview3 (#15)
EliSnow Jun 9, 2020
d1cd2bc
* Fix issue with integer overflow introduced in
EliSnow Jun 10, 2020
fdbc4f6
Fixes #17
EliSnow Jun 29, 2020
622fdf3
Update release action to build and upload the
EliSnow Jul 1, 2020
885fc11
Remove unused dependencies
EliSnow Jun 22, 2020
af7265d
Get the results viewer working again
EliSnow Jun 29, 2020
1dcef53
Bump version
EliSnow Jul 1, 2020
7c80afc
Reduce the amount of warning messages about
EliSnow Jul 3, 2020
b995ee5
Fix CI workflows and update Cargo.lock
EliSnow Jul 2, 2020
21868c5
Update documentation and CLI help to reflect
EliSnow Jul 6, 2020
6c2d8c3
Update PR CI workflow to only run the checks if a
EliSnow Jul 6, 2020
cc7fa2c
Update to build on stable rust
EliSnow Jul 27, 2020
090993b
Having trouble installing newer versions of
EliSnow Jul 27, 2020
a442fd9
Add new workflow for test-server release
EliSnow Jul 29, 2020
fbd939a
Bump lodash from 4.17.15 to 4.17.19 in /guide/results-viewer
dependabot[bot] Jul 20, 2020
7a03eb5
Bump elliptic from 6.5.1 to 6.5.3 in /guide/results-viewer
dependabot[bot] Aug 1, 2020
709c3e9
Upates for lints
EliSnow Sep 1, 2020
e7e91c7
Update dependencies
EliSnow Sep 1, 2020
b4c981e
Fixes #29
EliSnow Sep 1, 2020
672da61
Bump version for release and update .gitignore
EliSnow Sep 1, 2020
946aef8
Fix regression in v0.5.6 where pewpew does not
EliSnow Sep 5, 2020
ad22e77
bump version for release
EliSnow Sep 5, 2020
3506995
Refactor channels to fix #33
EliSnow Oct 12, 2020
0ad16ad
Fixes #35
EliSnow Oct 28, 2020
3a70809
Add in unique providers. Also do some
EliSnow Jan 22, 2021
7d68335
- Fix cargo clippy lints
EliSnow Jan 22, 2021
10c7be9
Add in the ability for `peak_load` to have a
EliSnow Jan 26, 2021
1d7b9a5
Fix regression in earlier 0.5.8 preview builds
EliSnow Jan 27, 2021
8ba4062
Add comments and rename a few things for
EliSnow Jan 29, 2021
9b56928
Change from the old (now removed) way of setting
EliSnow Jan 29, 2021
1414061
Fix config wasm (#44)
tkmcmaster Jan 29, 2021
fd34048
Bump dot-prop from 4.2.0 to 4.2.1 in /guide/results-viewer (#40)
dependabot[bot] Feb 1, 2021
48c5ff2
More comments and renaming things for clarity (#45)
EliSnow Feb 9, 2021
1ff30a5
On demand issue46 (#47)
tkmcmaster Mar 2, 2021
b51f3d2
Reverted some of the name fixes due to Splunk Dashboard issues (#49)
tkmcmaster Mar 9, 2021
9555f68
Epoch config wasm (#52)
tkmcmaster Mar 11, 2021
5bd8204
Update for release of 0.5.8 (#53)
tkmcmaster Mar 12, 2021
a4223c3
Downgraded wasm-pack to 0.8.1 due to issues building the guide (#54)
tkmcmaster Mar 12, 2021
3f392f5
Create a devcontainer for development (#55)
EliSnow Apr 27, 2021
3f9d50a
Update most dependencies to the latest version (#57)
EliSnow Sep 3, 2021
51a88d1
Update dependencies (#62)
tkmcmaster Sep 3, 2021
e9625af
Fixed the tar command
tkmcmaster Sep 3, 2021
2d09c91
Added a link to the new online har to yaml converter (#65)
tkmcmaster Sep 8, 2021
a240aaf
Release59 (#68)
tkmcmaster Sep 28, 2021
7ad2dcd
New Feature: Logging (#67)
tkmcmaster Sep 28, 2021
0a1a3f4
Binary logging (#69)
tkmcmaster Oct 6, 2021
e17c4bc
Wasm optional param (#70)
tkmcmaster Nov 3, 2021
73f3d1a
Config logging (#71)
tkmcmaster Nov 8, 2021
facde8c
Channel logging (#72)
tkmcmaster Feb 10, 2022
4f18aa9
Update clap and other dependencies (#74)
tkmcmaster Feb 10, 2022
a68a8f7
Update docs (#75)
jessica-yauney Mar 21, 2022
0ba3de7
Bump minimist from 1.2.5 to 1.2.6 in /guide/results-viewer (#76)
dependabot[bot] Mar 29, 2022
d6f484d
Request logging (#77)
tkmcmaster Mar 29, 2022
53a095d
Node updates (#78)
tkmcmaster Mar 30, 2022
3c2e377
Parse int (#80)
tkmcmaster Apr 15, 2022
c8e4db5
Release 5.10 (#81)
tkmcmaster Apr 26, 2022
39b1335
Graviton2 arm build (#82)
tkmcmaster May 17, 2022
bcf6381
Arm test server (#84)
tkmcmaster May 17, 2022
40a915e
Bump dashmap from 4.0.2 to 5.1.0 (#85)
dependabot[bot] Jun 17, 2022
c61fcde
Bump openssl-src from 111.18.0+1.1.1n to 111.20.0+1.1.1o (#86)
dependabot[bot] Jun 17, 2022
2c61abd
React viewer (#87)
tkmcmaster Jun 28, 2022
5ddf333
Har to yaml (#88)
tkmcmaster Jun 29, 2022
5c1436b
Results viewer updates (#89)
tkmcmaster Jun 30, 2022
b529e70
Har to yaml filter bug (#91)
tkmcmaster Jul 5, 2022
198265a
Fixed more bugs in the Results Viewer (#92)
tkmcmaster Jul 6, 2022
5b1a2bd
Bump openssl-src from 111.20.0+1.1.1o to 111.22.0+1.1.1q (#93)
dependabot[bot] Jul 6, 2022
a4f8e13
Bump moment from 2.29.3 to 2.29.4 in /guide/results-viewer-react (#95)
dependabot[bot] Jul 6, 2022
2af0f04
Bump moment from 2.29.2 to 2.29.4 in /guide/results-viewer (#94)
dependabot[bot] Jul 6, 2022
0efd650
Bump svelte from 3.48.0 to 3.49.0 in /guide/results-viewer (#96)
dependabot[bot] Jul 15, 2022
2864962
Updated versions of mdbook and Node to 16 (#97)
tkmcmaster Jul 19, 2022
4c97783
Pewpew updates20220906 (#98)
tkmcmaster Sep 7, 2022
5fa2031
pewpew -d crash (#99)
tkmcmaster Sep 9, 2022
7e3a7fd
Update PR flows and update dependencies (#101)
tkmcmaster Sep 15, 2022
f2a76ee
Updated version for release (#100)
tkmcmaster Oct 3, 2022
8b1482a
Bump decode-uri-component from 0.2.0 to 0.2.2 in /guide/results-viewe…
dependabot[bot] Dec 6, 2022
9b1eb4b
Bump decode-uri-component in /guide/results-viewer-react (#105)
dependabot[bot] Dec 6, 2022
6ebb3d8
Bump loader-utils from 1.4.0 to 1.4.2 in /guide/results-viewer-react …
dependabot[bot] Dec 28, 2022
f3a1620
Bump json5 from 1.0.1 to 1.0.2 in /guide/results-viewer (#107)
dependabot[bot] Jan 9, 2023
e79331a
Bump json5 from 1.0.1 to 1.0.2 in /guide/results-viewer-react (#108)
dependabot[bot] Jan 9, 2023
ba64255
Update dependencies20230123 (#110)
tkmcmaster Jan 30, 2023
52f8bd5
Bump openssl-src from 111.24.0+1.1.1s to 111.25.0+1.1.1t (#111)
dependabot[bot] Feb 8, 2023
296e2bc
Bump webpack from 5.75.0 to 5.76.0 in /guide/results-viewer-react (#113)
dependabot[bot] Mar 15, 2023
f7a5310
Update dependencies20230327 (#115)
tkmcmaster Mar 28, 2023
8e2840d
Bump h2 from 0.3.16 to 0.3.17 (#116)
dependabot[bot] Apr 13, 2023
f174d9a
Update dependencies 20230421 (#117)
tkmcmaster Apr 21, 2023
ae4e6fa
Bump version for release (#118)
tkmcmaster Apr 25, 2023
bdf381c
Fix histogram (#119)
tkmcmaster Apr 26, 2023
7316781
Fix docs (#120)
tkmcmaster May 15, 2023
a9413e4
Use clap derive, fixing behavior of `--include` flag. (#121)
OlsonZacheryFS May 17, 2023
24818e7
Small fixes, comments (#122)
OlsonZacheryFS May 25, 2023
58c0cfc
Add `zip_all_map` function to `zip_all` lib crate. (#124)
OlsonZacheryFS Jun 9, 2023
bc8f907
Bump openssl from 0.10.51 to 0.10.55 (#125)
dependabot[bot] Jun 22, 2023
a041a20
Trevorm examples (#127)
tkmcmaster Jul 14, 2023
a816515
Bump word-wrap from 1.2.3 to 1.2.4 in /guide/results-viewer-react (#128)
dependabot[bot] Jul 25, 2023
8e57b02
Bump word-wrap from 1.2.3 to 1.2.4 in /guide/results-viewer-react (#128)
dependabot[bot] Jul 25, 2023
fe7d42f
Fix yaml loggers (#129)
tkmcmaster Jul 28, 2023
46029dc
use IsTerminal trait (Rust 1.70.0), removing (direct) dependency on `…
OlsonZacheryFS Jul 31, 2023
e046590
update jsonpath-lib to 0.3.0, removing all atty deps (#131)
OlsonZacheryFS Jul 31, 2023
15a1f6a
Added additional examples with different body types including multipa…
tkmcmaster Aug 10, 2023
d7ce4e7
Renamed the Job Name to be able to distinguish it from the normal rel…
tkmcmaster Aug 11, 2023
8703ae4
Removed references to SystemTest (#134)
tkmcmaster Aug 14, 2023
816bd47
Added README instructions for building and link to examples (#136)
tkmcmaster Aug 15, 2023
dcc4772
Zip all map (#138)
tkmcmaster Aug 15, 2023
8b2d979
Adds skipBody CLI argument - Skips Request and Response Body in Try O…
Aug 25, 2023
10e2781
Updated dependencies and fixed deprecations (#143)
tkmcmaster Sep 1, 2023
5dc5672
Example wasm tests (#147)
tkmcmaster Sep 8, 2023
fbddcda
Open source PPaaS (#149)
tkmcmaster Sep 14, 2023
62407d9
Fix tests (#152)
tkmcmaster Sep 29, 2023
e2c62a6
Update node dependencies (#154)
tkmcmaster Sep 29, 2023
48b6f47
Updates on master PPaaS (#156)
tkmcmaster Oct 3, 2023
a51870e
Removed links to Splunk that shouldn't be in OpenSource (#158)
tkmcmaster Oct 11, 2023
98c71a5
Changed agent version greaterthan to use semver (#160)
tkmcmaster Oct 17, 2023
6c28822
Bump @babel/traverse in /guide/results-viewer-react (#161)
dependabot[bot] Oct 17, 2023
4a92b7b
Bump rustix from 0.37.23 to 0.37.25 (#163)
dependabot[bot] Oct 18, 2023
296eecd
Updated lock files to fix audit vulnerabilities (#164)
summersjc Oct 24, 2023
ecbd73c
Update the world (#166)
summersjc Oct 25, 2023
a50c6cc
Bug fixes 2023-10-26 (#168)
tkmcmaster Oct 26, 2023
444426d
Split the skipBody try parameter into separate request/response skip …
tkmcmaster Oct 26, 2023
730c715
Turned off fail-fast for the Rest cross os tests (#172)
tkmcmaster Oct 31, 2023
b05aa08
Added Apple M1 Arm64 to the PR and Release flow (#174)
tkmcmaster Nov 2, 2023
3e2ebf6
Added the Mac M1 build to the test-server (#176)
tkmcmaster Nov 2, 2023
6dbbb70
Pewpew try hang (#177)
tkmcmaster Nov 6, 2023
febcaaa
Updated pewpew version for release (#179)
tkmcmaster Nov 7, 2023
db9938f
Bump openssl from 0.10.57 to 0.10.60 (#181)
dependabot[bot] Nov 28, 2023
4eee641
Update 2023-11-28 (#182)
tkmcmaster Nov 30, 2023
dba5076
Fixed an issue where searching for old tests that were yml failed to …
tkmcmaster Dec 13, 2023
7abe182
Bump zerocopy from 0.7.15 to 0.7.31 (#185)
dependabot[bot] Dec 15, 2023
e39d02c
Updated version and dependencies for release of PPaaS (#186)
tkmcmaster Dec 15, 2023
2943ae2
Update readme (#187)
tkmcmaster Dec 27, 2023
41b21b6
Retain tests longer (#188)
tkmcmaster Dec 28, 2023
100bf8a
Update Dependencies 2023-12-28 (#189)
tkmcmaster Dec 28, 2023
9829f65
Additional tagging changes found while deploying (#191)
tkmcmaster Jan 3, 2024
71742fd
Bump h2 from 0.3.21 to 0.3.24 (#193)
dependabot[bot] Jan 19, 2024
9ac8406
Update20240124 (#194)
tkmcmaster Jan 24, 2024
761c59a
Updated ppaas version and dependencies (#196)
tkmcmaster Feb 27, 2024
2179951
Replace actions-rs with rustup (#198)
tkmcmaster Feb 27, 2024
ea594c2
Bump mio from 0.8.10 to 0.8.11 (#200)
dependabot[bot] Mar 5, 2024
096d0f7
Add lint rules (#202)
tkmcmaster Mar 14, 2024
370361e
Added eslint key-spacing rule (#204)
tkmcmaster Mar 15, 2024
0850ea6
Adding toaster, dynamically checking pewpewVersion (#201)
bryan-e-lopez Mar 18, 2024
2b5fc00
Test mac and windows executables (#209)
tkmcmaster Mar 26, 2024
c8d3173
Fixed the getTags call to get the latest tags (#211)
tkmcmaster Mar 26, 2024
b4b9357
Updated version and dependencies (#212)
tkmcmaster Mar 27, 2024
ea34d3e
Update pr script (#214)
tkmcmaster Mar 29, 2024
bcb51c0
Bump h2 from 0.3.24 to 0.3.26 (#216)
dependabot[bot] Apr 7, 2024
f0919dc
Updated version and dependencies (#217)
tkmcmaster Apr 26, 2024
0e597d1
Fixed the pr script to run the clean-up correctly and not exit on fai…
tkmcmaster Apr 26, 2024
57f4cd0
Fixed issue with shared s3 buckets (#221)
tkmcmaster May 10, 2024
4b6776a
Update Dependencies 2024-05-29 (#223)
tkmcmaster May 29, 2024
108fb45
Fixed a typo in the provider docs (#227)
tkmcmaster May 30, 2024
cb18338
Update Rust Dependencies 2024-05-29 (#226)
tkmcmaster Jun 3, 2024
ce6d8a2
Update dependencies 2024-07-01 (#231)
tkmcmaster Jul 1, 2024
48e2479
Extended acceptance tests AWS (#233)
tkmcmaster Jul 9, 2024
8afada4
Fix acceptance test status file (#235)
tkmcmaster Jul 9, 2024
b285162
Bump openssl from 0.10.64 to 0.10.66 (#238)
dependabot[bot] Jul 22, 2024
00106fd
Update rust dependencies 2024-07-18 (#236)
tkmcmaster Jul 23, 2024
03eeff5
Update node dependencies 2024-07-22 (#239)
tkmcmaster Jul 25, 2024
5246ac6
Updated hyper and http (#237)
tkmcmaster Jul 31, 2024
b393a02
Update pewpew examples and test (#243)
tkmcmaster Aug 2, 2024
f049fcd
Fix response status and headers (#245)
tkmcmaster Aug 13, 2024
6d902a5
Fixed dependabot issues (#247)
tkmcmaster Aug 26, 2024
0c5e5d7
Update node dependencies 2024-08-29 (#249)
tkmcmaster Aug 30, 2024
a8e70a3
Guide viewer eslint (#250)
tkmcmaster Aug 30, 2024
6c9af5e
Update node dependencies 2024-09-27 (#254)
tkmcmaster Sep 27, 2024
4743888
Update node dependencies 2024-11-01 (#256)
tkmcmaster Nov 5, 2024
d5d1fb3
Node coverage fixes (#258)
tkmcmaster Nov 5, 2024
88e62e2
Fix Cookie Login (#259)
tkmcmaster Nov 6, 2024
77e940d
More configs that need to be cleaned up (#261)
tkmcmaster Nov 6, 2024
ca5b5fd
Fix provider docs (#262)
tkmcmaster Nov 11, 2024
a1d6e83
Update node dependencies 2024-11-22 (#265)
tkmcmaster Nov 22, 2024
d486bf3
Fix storybook webpack error (#267)
tkmcmaster Nov 25, 2024
f29a8a2
Fix multiple test results bug (#269)
tkmcmaster Nov 26, 2024
be84a78
Michael/perf 1699 (#270)
blonde-mike Nov 27, 2024
1b1e411
PewPew improvements (#271)
blonde-mike Dec 4, 2024
ce6a0c7
Remove har to yaml from controller (#272)
tkmcmaster Dec 6, 2024
aee646e
PewRL fixes and updates (#274)
blonde-mike Dec 19, 2024
a2b04e7
Update node dependencies 2024-12-19 (#275)
tkmcmaster Dec 19, 2024
46321e9
Merge branch 'master' of https://github.com/FamilySearch/pewpew
tkmcmaster Jan 6, 2025
adef3fc
Merge branch 'master' of https://github.com/FamilySearch/pewpew
tkmcmaster Jan 6, 2025
5277879
Merge branch 'master' of https://github.com/FamilySearch/pewpew
tkmcmaster Jan 6, 2025
b32cb72
Fix controller crash (#278)
tkmcmaster Jan 16, 2025
24a8741
rampTime, loadTime, and peakLoad vars applied in form (#277)
blonde-mike Jan 16, 2025
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
4 changes: 2 additions & 2 deletions agent/hooks/post-build/000-run-build
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ nvm install v18

# Environment variables are not passed to our run-build hook/script. Hard code them in the script
export NODE_ENV=production
export LoggingLevel=info
export LoggingLevelConsole=warn
export LOGGING_LEVEL=info
export LOGGING_LEVEL_CONSOLE=warn

# Now run whatever node or npm commands you need to run
npm run build
2 changes: 1 addition & 1 deletion agent/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fs/ppaas-agent",
"version": "3.3.5",
"version": "3.3.6",
"description": "Agent Service for running pewpew tests",
"main": "dist/src/app.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion common/integration/s3.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ describe("S3Util Integration", () => {

before (async () => {
// This test was failing until we reset everything. I don't know why and it bothers me.
s3Config.s3Client = undefined as any;
s3Config.s3Client = undefined;
initS3();
defaultTagKey = initTags();
expect(defaultTagKey, "defaultTagKey").to.not.equal(undefined);
Expand Down
2 changes: 1 addition & 1 deletion common/integration/sqs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ describe("SqsUtil Integration", () => {

before(async () => {
// reset everything in case the mocks ran.
sqsConfig.sqsClient = undefined as any;
sqsConfig.sqsClient = undefined;
initSqs();
log("QUEUE_URL_TEST=" + [...QUEUE_URL_TEST], LogLevel.DEBUG);
log("QUEUE_URL_SCALE=" + [...QUEUE_URL_SCALE_IN], LogLevel.DEBUG);
Expand Down
5 changes: 3 additions & 2 deletions common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fs/ppaas-common",
"version": "3.3.5",
"version": "3.3.6",
"description": "Common Code for the PewPewController and PewPewAgent",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
Expand All @@ -15,7 +15,7 @@
"testonly": "nyc mocha ./dist/test --timeout 30000 -r dotenv-flow/config",
"integration": "npm run build && nyc mocha ./dist/integration --timeout 300000 -r dotenv-flow/config",
"coverage": "npm run build && nyc mocha ./dist/test ./dist/integration --timeout 300000 -r dotenv-flow/config",
"prepare": "npm run buildonly",
"prepare": "tsc --project tsconfig.lib.json",
"clean": "rimraf dist/"
},
"repository": {
Expand All @@ -35,6 +35,7 @@
"dependencies": {
"@aws-sdk/client-s3": "^3.363.0",
"@aws-sdk/client-sqs": "^3.363.0",
"@aws-sdk/credential-providers": "^3.363.0",
"@aws-sdk/ec2-metadata-service": "^3.363.0",
"@aws-sdk/lib-storage": "^3.363.0",
"bunyan": "~1.8.0",
Expand Down
65 changes: 40 additions & 25 deletions common/src/util/s3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ import {
S3ServiceException,
Tag as S3Tag
} from "@aws-sdk/client-s3";
import { IS_RUNNING_IN_AWS, getPrefix } from "./util";
import { LogLevel, log } from "./log";
import { createGzip, gunzip as zlibGunzip} from "zlib";
import { createReadStream, writeFile as fsWriteFile } from "fs";
import { S3File } from "../../types";
import { Upload } from "@aws-sdk/lib-storage";
import { constants as bufferConstants } from "node:buffer";
import { getPrefix } from "./util";
import { fromIni } from "@aws-sdk/credential-providers";
import { promisify } from "util";
import stream from "stream";
const { MAX_STRING_LENGTH } = bufferConstants;
Expand All @@ -47,8 +48,8 @@ export let BUCKET_URL: string;
export let KEYSPACE_PREFIX: string;
// let REGION_ENDPOINT: string | undefined;
// Export for testing so we can reset s3
export const config: { s3Client: S3Client } = {
s3Client: undefined as unknown as S3Client
export const config: { s3Client: (() => S3Client) | undefined } = {
s3Client: undefined
};
/**
* ADDITIONAL_TAGS_ON_ALL if set via environment variable is expected to be a comma delimited list of key=value pairs
Expand All @@ -69,10 +70,10 @@ export const defaultTestExtraFileTags = (): Map<string, string> => new Map(TEST_
/**
* Initializes the S3 object using environment variables. Runs later so it doesn't throw on start-up
*/
export function init (): void {
export function init (): S3Client {
if (BUCKET_NAME && config.s3Client) {
// If we've already set the BUCKET_NAME then we've done this already.
return;
return config.s3Client();
}
// Where <prefix> is your application name, system name, and service name concatenated with underscores, capitalized, and all dashes replaced with underscores.
// The s3 service name is s3 in the application which is then capitalized to _S3_ below
Expand Down Expand Up @@ -101,12 +102,6 @@ export function init (): void {
// Since we don't have a private s3 bucket. This will be populated. If we ever move to a private we don't want to tack on the trailing /
KEYSPACE_PREFIX = keyspacePrefix.length > 0 && !keyspacePrefix.endsWith("/") ? (keyspacePrefix + "/") : keyspacePrefix;

// Create an S3 service object
config.s3Client = new S3Client({
// params: { Bucket: BUCKET_NAME },
region: "us-east-1"
});

if (process.env.ADDITIONAL_TAGS_ON_ALL && ADDITIONAL_TAGS_ON_ALL.size === 0) {
try {
for (const keyPair of process.env.ADDITIONAL_TAGS_ON_ALL.split(",")) {
Expand All @@ -124,6 +119,26 @@ export function init (): void {
throw error;
}
}

// Create an S3 service object
if (IS_RUNNING_IN_AWS) {
// Create a fixed client that will be returned every time.
const s3Client = new S3Client({
// params: { Bucket: BUCKET_NAME },
region: "us-east-1"
});
config.s3Client = () => s3Client;
} else {
// https://github.com/aws/aws-sdk-js-v3/issues/3396
// When not running in AWS, use the fromIni rather than automatic configuration, don't cache the credentials,
// and create a new instance every time
config.s3Client = () => new S3Client({
// params: { Bucket: BUCKET_NAME },
credentials: fromIni({ ignoreCache: true }),
region: "us-east-1"
});
}
return config.s3Client();
}

let accessCallback: (date: Date) => void | undefined;
Expand Down Expand Up @@ -459,7 +474,7 @@ export async function listObjects (options?: string | ListObjectsOptions): Promi
({ prefix, maxKeys, continuationToken } = options || {});
}
log(`listObjects(${prefix}, ${maxKeys}, ${continuationToken})`, LogLevel.DEBUG);
init();
const s3Client = init();
if (!prefix || !prefix.startsWith(KEYSPACE_PREFIX)) {
prefix = KEYSPACE_PREFIX + (prefix || "");
}
Expand All @@ -471,7 +486,7 @@ export async function listObjects (options?: string | ListObjectsOptions): Promi
};
try {
log("listObjects request", LogLevel.DEBUG, params);
const result: ListObjectsV2CommandOutput = await config.s3Client.send(new ListObjectsV2Command(params));
const result: ListObjectsV2CommandOutput = await s3Client.send(new ListObjectsV2Command(params));
log("listObjects succeeded", LogLevel.DEBUG, result);
callAccessCallback(new Date()); // Update the last timestamp
return result;
Expand All @@ -483,7 +498,7 @@ export async function listObjects (options?: string | ListObjectsOptions): Promi

// export for testing
export async function getObject (key: string, lastModified?: Date): Promise<GetObjectCommandOutput> {
init();
const s3Client = init();
if (!key || !key.startsWith(KEYSPACE_PREFIX)) {
key = KEYSPACE_PREFIX + (key || "");
}
Expand All @@ -494,7 +509,7 @@ export async function getObject (key: string, lastModified?: Date): Promise<GetO
};
try {
log("getObject request", LogLevel.DEBUG, params);
const result: GetObjectCommandOutput = await config.s3Client.send(new GetObjectCommand(params));
const result: GetObjectCommandOutput = await s3Client.send(new GetObjectCommand(params));
log("getObject succeeded", LogLevel.DEBUG, Object.assign({}, result, { Body: undefined })); // Log it without the body
callAccessCallback(new Date()); // Update the last timestamp
return result;
Expand All @@ -512,7 +527,7 @@ export async function getObject (key: string, lastModified?: Date): Promise<GetO

// export for testing
export async function uploadObject (file: S3File): Promise<CompleteMultipartUploadCommandOutput> {
init();
const s3Client = init();
if (!file.key || !file.key.startsWith(KEYSPACE_PREFIX)) {
file.key = KEYSPACE_PREFIX + (file.key || "");
}
Expand Down Expand Up @@ -548,7 +563,7 @@ export async function uploadObject (file: S3File): Promise<CompleteMultipartUplo
try {
log("uploadObject request", LogLevel.DEBUG, Object.assign({}, params, { Body: undefined })); // Log it without the body
const upload = new Upload({
client: config.s3Client,
client: s3Client,
// tags: file.tags && [...file.tags].map(([Key, Value]) => ({ Key, Value })),
params
});
Expand Down Expand Up @@ -582,7 +597,7 @@ export interface CopyObjectOptions {
* @returns {CopyObjectCommandOutput}
*/
export async function copyObject ({ sourceFile, destinationFile, tags }: CopyObjectOptions): Promise<CopyObjectCommandOutput> {
init();
const s3Client = init();
if (!sourceFile.key || !sourceFile.key.startsWith(KEYSPACE_PREFIX)) {
sourceFile.key = KEYSPACE_PREFIX + (sourceFile.key || "");
}
Expand Down Expand Up @@ -614,7 +629,7 @@ export async function copyObject ({ sourceFile, destinationFile, tags }: CopyObj
};
try {
log("copyObject request", LogLevel.DEBUG, Object.assign({}, params, { Body: undefined })); // Log it without the body
const result: CopyObjectCommandOutput = await config.s3Client.send(new CopyObjectCommand(params));
const result: CopyObjectCommandOutput = await s3Client.send(new CopyObjectCommand(params));
log("copyObject succeeded", LogLevel.DEBUG, result);
callAccessCallback(new Date()); // Update the last timestamp
return result;
Expand All @@ -626,7 +641,7 @@ export async function copyObject ({ sourceFile, destinationFile, tags }: CopyObj

// export for testing
export async function deleteObject (s3FileKey: string): Promise<DeleteObjectCommandOutput> {
init();
const s3Client = init();
if (!s3FileKey || !s3FileKey.startsWith(KEYSPACE_PREFIX)) {
s3FileKey = KEYSPACE_PREFIX + (s3FileKey || "");
}
Expand All @@ -636,7 +651,7 @@ export async function deleteObject (s3FileKey: string): Promise<DeleteObjectComm
};
try {
log("deleteObject request", LogLevel.DEBUG, params);
const result: DeleteObjectCommandOutput = await config.s3Client.send(new DeleteObjectCommand(params));
const result: DeleteObjectCommandOutput = await s3Client.send(new DeleteObjectCommand(params));
log(`deleteObject ${s3FileKey} succeeded`, LogLevel.DEBUG, result);
callAccessCallback(new Date()); // Update the last timestamp
return result;
Expand All @@ -647,7 +662,7 @@ export async function deleteObject (s3FileKey: string): Promise<DeleteObjectComm
}

export async function getObjectTagging (s3FileKey: string): Promise<GetObjectTaggingCommandOutput> {
init();
const s3Client = init();
if (!s3FileKey || !s3FileKey.startsWith(KEYSPACE_PREFIX)) {
s3FileKey = KEYSPACE_PREFIX + (s3FileKey || "");
}
Expand All @@ -657,7 +672,7 @@ export async function getObjectTagging (s3FileKey: string): Promise<GetObjectTag
};
try {
log("getObjectTagging request", LogLevel.DEBUG, params);
const result: GetObjectTaggingCommandOutput = await config.s3Client.send(new GetObjectTaggingCommand(params));
const result: GetObjectTaggingCommandOutput = await s3Client.send(new GetObjectTaggingCommand(params));
log(`getObjectTagging ${s3FileKey} succeeded`, LogLevel.DEBUG, result);
callAccessCallback(new Date()); // Update the last timestamp
return result;
Expand All @@ -673,7 +688,7 @@ export interface PutObjectTaggingOptions {
}

export async function putObjectTagging ({ key, tags }: PutObjectTaggingOptions): Promise<PutObjectTaggingCommandOutput> {
init();
const s3Client = init();
if (!key || !key.startsWith(KEYSPACE_PREFIX)) {
key = KEYSPACE_PREFIX + (key || "");
}
Expand All @@ -694,7 +709,7 @@ export async function putObjectTagging ({ key, tags }: PutObjectTaggingOptions):
};
try {
log("putObjectTagging request", LogLevel.DEBUG, params);
const result: PutObjectTaggingCommandOutput = await config.s3Client.send(new PutObjectTaggingCommand(params));
const result: PutObjectTaggingCommandOutput = await s3Client.send(new PutObjectTaggingCommand(params));
log(`putObjectTagging ${key} succeeded`, LogLevel.DEBUG, result);
callAccessCallback(new Date()); // Update the last timestamp
return result;
Expand Down
Loading
Loading