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

HOTFIX: Add version prefix to build status files #22126

Merged
merged 1 commit into from
Jan 31, 2023

Conversation

bnchrch
Copy link
Contributor

@bnchrch bnchrch commented Jan 31, 2023

What

When migrating previous build status reports from test/history/${CONNECTOR} to test/history/connectors/${CONNECTOR} the information for last_modified_at was set to today.

This caused our login for the reports to be invalid

How

This solves it by

  1. Making the LAST_10 logs work off the unix timestamp included in the filename
  2. Adding a version prefix to all versioned logs
  3. filtering out those versioned logs when getting the top 10

Roadblocks Encountered

A few were encountered here.

  1. AWS s3 cli made it difficult to non destructively copy files to the new destinations
  2. AWS list-objects-api doesnt let you match on regex

Post merge

  • Copy the previous build artifacts to the new path using the script below
  • Ensure all semver artifacts are removed
  • Run the integrations workflow
  • Run the report status workflow
  • Run the build report workflow

s3 copy script

aws s3 cp "s3://airbyte-connector-build-status/tests/history" s3://airbyte-connector-build-status/tests/history/connectors/ --recursive  --exclude "*" --include "source-*" --exclude "connectors/*" --profile dev
aws s3 cp "s3://airbyte-connector-build-status/tests/history" s3://airbyte-connector-build-status/tests/history/connectors/ --recursive  --exclude "*" --include "destinations-*" --exclude "connectors/*" --profile dev

@bnchrch bnchrch self-assigned this Jan 31, 2023
@bnchrch bnchrch temporarily deployed to more-secrets January 31, 2023 04:28 — with GitHub Actions Inactive
@bnchrch bnchrch temporarily deployed to more-secrets January 31, 2023 04:28 — with GitHub Actions Inactive
Comment on lines 71 to 74
LAST_TEN_FILES=$(aws s3api list-objects-v2 --bucket "$BUCKET" \
--query "reverse(sort_by(Contents[?contains(Key, \`tests/history/$CONNECTOR\`)], &LastModified))[:10].Key" \
--prefix "tests/history/$CONNECTOR" \
--query "reverse(sort_by(Contents[?!contains(Key, \`$VERSION_PREFIX\`)], &Key))[:10].Key" \
--output=text)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This query is done by the S3 API, yes? That means we don't actually need to download the ever-growing list of files and do the sort locally?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That also why this took a bit longer as I wanted to make s3 responsilbe for the final "take 10". Just so this wouldnt get slower and slower as more logs pile up

@github-actions
Copy link
Contributor

Airbyte Code Coverage

There is no coverage information present for the Files changed

Total Project Coverage 24.51%

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

Successfully merging this pull request may close these issues.

None yet

2 participants