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

Create CRON to purge S3 buckets based on commit hash #1065

Closed
willmcvay opened this issue Apr 23, 2020 · 2 comments · Fixed by #1134
Closed

Create CRON to purge S3 buckets based on commit hash #1065

willmcvay opened this issue Apr 23, 2020 · 2 comments · Fixed by #1134
Assignees
Labels
enhancements Relates to a feature enhancement foundations Issues relating to Foundations front-end Relates to front end issues

Comments

@willmcvay
Copy link
Contributor

Background context or User story:

We get occasional chunk missing errors in dev when we deploy because currently we replace the content of a bucket with the new deployment. If a user has a session, the script will be missing when they navigate. eg of this behaviour https://sentry.io/organizations/reapit-ltd/issues/1623235951/?project=1885603&referrer=slack

Specification or Acceptance Criteria:

  • We should support at least 2 recent versions of each app in an S3 bucket.
  • We should update our webpack scripts so the master HEAD commit hash is prepended to the output script file names. This means we can identify the scripts by release
  • We should have a CRON job that runs weekly to purge all S3 buckets of all but the last two releases by most recent commit hash.
@willmcvay willmcvay added enhancements Relates to a feature enhancement foundations Issues relating to Foundations front-end Relates to front end issues labels Apr 23, 2020
@phmngocnghia phmngocnghia self-assigned this Apr 23, 2020
@phmngocnghia
Copy link
Contributor

We have dicussed about using service-worker, offline-plugin API to check if the assets have been changed to do a refetched-navigation and agreed to try this method: https://zach.codes/handling-client-side-app-updates-with-service-workers/

The service worker implemented by the lib “offline-plugin” (we are currently using it) allows us to detect when the new code is out by checking the status of the manifest file automatically every X time, or checking it manually, then we can use that info to do a re-fetched navigation when the user changes their route

phmngocnghia pushed a commit that referenced this issue Apr 28, 2020
willmcvay pushed a commit that referenced this issue Apr 29, 2020
vuhuucuong pushed a commit that referenced this issue Apr 29, 2020
nphivu414 pushed a commit that referenced this issue Apr 29, 2020
willmcvay pushed a commit that referenced this issue Apr 29, 2020
* [CLD-161] import back Pagination from elements (#93)

* Initial Commit

* Initial Commit

* feat: #1031 DB schema for web component config

* fix: #1065 fix loading chunk fail (#1092)

* feat: #1031 fix failing tests

* feat: #1031 update config.example.json

* fix: #1031 add daysOfWeek as a schema field

* fix: #1031 resolve conflict

* fix: #1031 update comment

* fix: #1031 rebasing into master

Co-authored-by: Thanh Pham <[email protected]>
Co-authored-by: Nghia Pham <[email protected]>
Co-authored-by: NghiaPham <[email protected]>
@willmcvay willmcvay reopened this Apr 30, 2020
@willmcvay
Copy link
Contributor Author

  • Had to remove S3 Cron file, this needs re-instating.

Also;

duong-se pushed a commit that referenced this issue May 5, 2020
fix #1065: re-instating purge unused s3 assets cronjob (#1134)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancements Relates to a feature enhancement foundations Issues relating to Foundations front-end Relates to front end issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants