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

Release v2.0.3-test.2 #296

Closed
wants to merge 63 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
454fcfd
ci: restructure e2e tests
necipallef Sep 16, 2024
797dedd
Merge pull request #281 from fingerprintjs/new_rc
necipallef Sep 17, 2024
edf9576
ci: change trigger condition and rename e2e test for releases pipeline
necipallef Sep 17, 2024
e43cf1d
ci: use commit id instead of version
necipallef Sep 17, 2024
445d63f
Merge pull request #282 from fingerprintjs/ci/e2e_workflows_2
necipallef Sep 17, 2024
0325bb2
ci: rename e2e test job names
necipallef Sep 17, 2024
a4dc5d7
Merge pull request #283 from fingerprintjs/ci/rename_workflows
necipallef Sep 17, 2024
e719ef2
ci: fix comments
necipallef Sep 17, 2024
18e9e07
Merge pull request #284 from fingerprintjs/ci/fix_workflows
necipallef Sep 17, 2024
35837fd
ci: combine deploy test branch workflow with e2e test branch workflow
necipallef Sep 18, 2024
df5af77
ci: scope e2e test permissions to job rather than whole workflow
necipallef Sep 18, 2024
b86d35b
Merge pull request #286 from fingerprintjs/ci/combine_deploy_test_bra…
necipallef Sep 19, 2024
2e8c7ca
chore: trigger aws lambdas cleanup from github
ilfa Sep 18, 2024
ce3840d
Merge pull request #287 from fingerprintjs/fix-cleanup-pipeline
ilfa Sep 19, 2024
74fa989
chore: use node20 for aws lambdas cleanup pipeline
ilfa Sep 19, 2024
4c1bafd
Merge pull request #288 from fingerprintjs/fix-cleanup-pipeline
ilfa Sep 19, 2024
6f6a54a
chore: use aws-sdk v3 for cleanup script
ilfa Sep 19, 2024
76bfe6c
Merge pull request #289 from fingerprintjs/fix-cleanup-pipeline
ilfa Sep 19, 2024
1848c89
chore: migrate cleanup script to aws-sdk v3, but mute delete calls to…
ilfa Sep 20, 2024
101c073
chore: fix ListObjectsV2Command
ilfa Sep 20, 2024
9926db6
chore: use paginator to list s3 bucket objects
ilfa Sep 20, 2024
9f0c08c
chore: unmute delete commands
ilfa Sep 20, 2024
0482b26
chore: add link to the aws pipeline for cleanup workflow
ilfa Sep 20, 2024
8a01eff
Merge pull request #290 from fingerprintjs/fix-cleanup-pipeline
ilfa Sep 20, 2024
0636fb3
chore: move region from secrets to vars
ilfa Sep 20, 2024
5330a64
Merge pull request #292 from fingerprintjs/fix-cleanup-pipeline
ilfa Sep 20, 2024
27ac657
ci: replace test branch flow with new flow
necipallef Sep 20, 2024
1af4a24
ci: refactor e2e buildspec
necipallef Sep 20, 2024
90f4aca
ci: refactor e2e buildspec
necipallef Sep 20, 2024
706198b
ci: attempt to pass branch name as var to codepipeline
necipallef Sep 20, 2024
11991fb
ci: attempt to pass branch name as var to codepipeline & remove deplo…
necipallef Sep 20, 2024
4a664c1
ci: rename parameter name
necipallef Sep 20, 2024
a7e42fa
ci: fix buildspec dir
necipallef Sep 20, 2024
f430867
ci: fix mocked e2e tests
necipallef Sep 21, 2024
9a53576
ci: add todo
necipallef Sep 21, 2024
38bd422
ci: fix mock e2e
necipallef Sep 21, 2024
4afb5fa
ci: fix mock e2e
necipallef Sep 21, 2024
6f5b3dd
chore: remove outdated comments
necipallef Sep 23, 2024
083a731
ci: try --source-revisions
necipallef Sep 23, 2024
e7e010e
ci: fix --source-revisions
necipallef Sep 23, 2024
8cef93e
ci: fix --source-revisions
necipallef Sep 23, 2024
7f4d37c
ci: add debug log
necipallef Sep 23, 2024
c32bc20
ci: fix commit id
necipallef Sep 23, 2024
36165ef
ci: fix commit id
necipallef Sep 23, 2024
3d845a6
ci: fix commit id
necipallef Sep 23, 2024
0260a3d
ci: remove branch name related logic from e2e tests
necipallef Sep 23, 2024
ab6ed16
ci: fix file paths
necipallef Sep 23, 2024
49be83d
ci: e2e tests clean up and put aws execution link to the action summary
necipallef Sep 24, 2024
0e1f9cb
ci: fix workflow trigger conditions
necipallef Sep 25, 2024
4f1ed3e
ci: replace github output with github env var
necipallef Sep 25, 2024
8a10f10
ci: replace github output with github env var
necipallef Sep 25, 2024
31c5c14
ci: revert back to using github outputs
necipallef Sep 25, 2024
3663e4f
ci: manual implementation of the diff action
necipallef Sep 25, 2024
b1fcf2c
ci: manual implementation of the diff action
necipallef Sep 25, 2024
b137b12
ci: manual implementation of the diff action
necipallef Sep 25, 2024
df761b6
ci: manual implementation of the diff action
necipallef Sep 25, 2024
c31ccb5
ci: manual implementation of the diff action
necipallef Sep 25, 2024
c4d0b0e
ci: debug job output
necipallef Sep 25, 2024
36d6e79
ci: debug job output
necipallef Sep 25, 2024
6841fc5
ci: fix diff filter and remove unused steps
necipallef Sep 25, 2024
f29afc7
Merge pull request #291 from fingerprintjs/ci/e2e_test_improvements
necipallef Sep 25, 2024
39e8484
ci: fix mock e2e tests
necipallef Sep 26, 2024
750ca3b
Merge pull request #294 from fingerprintjs/ci/fix-mock-e2e
necipallef Sep 27, 2024
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
Prev Previous commit
Next Next commit
chore: use paginator to list s3 bucket objects
ilfa committed Sep 20, 2024

Verified

This commit was signed with the committer’s verified signature.
jrfnl Juliette
commit 9926db6ddf1bebce9c5968c89fbbfa9567e4307e
39 changes: 15 additions & 24 deletions e2e/scripts/cleanup.mjs
Original file line number Diff line number Diff line change
@@ -13,9 +13,9 @@ import {
DeleteBucketCommand,
DeleteObjectsCommand,
ListBucketsCommand,
ListObjectsV2Command,
S3Client
} from "@aws-sdk/client-s3"
paginateListObjectsV2,
S3Client,
} from '@aws-sdk/client-s3'

const lambda = new LambdaClient()
const secretsManager = new SecretsManagerClient()
@@ -203,28 +203,19 @@ async function* listS3Buckets() {
}

async function emptyS3Bucket(bucketName) {
const listObjectsCommand = new ListObjectsV2Command({ Bucket: bucketName })
const listedObjects = await s3.send(listObjectsCommand)

console.log('listedObjects:', listedObjects)

if (listedObjects.Contents.length === 0) {
return
}

const deleteParams = {
Bucket: bucketName,
Delete: { Objects: listedObjects.Contents.map(({ Key }) => ({ Key })) },
}

console.info(`Removing objects from S3 bucket: ${JSON.stringify(deleteParams)}. `)

const deleteObjectsCommand = new DeleteObjectsCommand(deleteParams)
console.log(deleteObjectsCommand)
// await s3.send(deleteObjectsCommand)
const paginator = paginateListObjectsV2({ client: s3 }, { Bucket: bucketName })
for await (const page of paginator) {
if (page?.KeyCount > 0) {
const deleteParams = {
Bucket: bucketName,
Delete: { Objects: page.Contents.map(({ Key }) => ({ Key })) },
}
console.info(`Removing objects from S3 bucket: ${JSON.stringify(deleteParams)}. `)

if (listedObjects.IsTruncated) {
await emptyS3Bucket(bucketName)
const deleteObjectsCommand = new DeleteObjectsCommand(deleteParams)
console.log(deleteObjectsCommand)
// await s3.send(deleteObjectsCommand)
}
}
}