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

As a user, I want to clear the cache after a deploy #1612

Closed
2 tasks done
jzbahrai opened this issue Jul 15, 2024 · 9 comments
Closed
2 tasks done

As a user, I want to clear the cache after a deploy #1612

jzbahrai opened this issue Jul 15, 2024 · 9 comments
Assignees
Labels
Dev Task for implementation of a technical solution High Priority | Haute priorité Incident Incident Ticket

Comments

@jzbahrai
Copy link
Collaborator

jzbahrai commented Jul 15, 2024

Description

Once we do a deploy, I want to clear the cache of Templates, TemplateCategories, Services, User, EmailBranding, Organisation

Acceptance Criteria

  • Check that the above entities that are in the cache pre deploy, are removed post deploy

QA Steps

  • Tested in staging
@jzbahrai jzbahrai self-assigned this Jul 15, 2024
@yaelberger-commits yaelberger-commits added Dev Task for implementation of a technical solution Incident Incident Ticket labels Jul 15, 2024
@yaelberger-commits
Copy link
Collaborator

Please add your planning poker estimate with Zenhub @jzbahrai

@yaelberger-commits
Copy link
Collaborator

Hey team! Please add your planning poker estimate with Zenhub @andrewleith @whabanks

@yaelberger-commits
Copy link
Collaborator

@andrewleith is working on this one today

@andrewleith
Copy link
Member

andrewleith commented Aug 30, 2024

TODO:

  • Misc: generate new CACHE_CLEAR_CLIENT_SECRET
  • MANIFESTS / #2904 - Add CACHE_CLEAR_CLIENT_SECRET to .env so that API can use it to authenticate calls to the new endpoint
  • UTILS / #315 - Move the list of cache keys here so they can be used by both admin and API
  • TF / #1508 - Update the WAF rules to allow the new api endpoint to be called
  • API / #2278 - Add a new protected endpoint that will clear all redis caches from the list in utils (in review)
  • Add CACHECLEAR_SECRET_KEY to github secrets (one for staging + one for prod) (you can find these values in manifests!)
  • MANIFESTS - Update one of the deployment workflows to call the cache clearing endpoint after deploy using new secret key injected from github secrets
    • Usage for the cache-clear.js script:
      • ❯ node clear_cache.js "CACHE_CLEAR_USER" "SECRET_HERE" "API_ENDPOINT_HERE"

For later:

  • ADMIN - (Optional, can come later) Update the admin cache clearing logic to use the list from utils, instead of the list currently hardcoded in admin

@yaelberger-commits
Copy link
Collaborator

2 PRs up, Jumana may pick this up today or when Callback work is done

@yaelberger-commits
Copy link
Collaborator

Mostly done, working in Staging. Next step is to merge in Staging

@yaelberger-commits
Copy link
Collaborator

Second PR needs to be merged

@yaelberger-commits
Copy link
Collaborator

Got it working in Staging, but failed in Prod. Jumana will take a look today.

@jzbahrai
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dev Task for implementation of a technical solution High Priority | Haute priorité Incident Incident Ticket
Projects
None yet
Development

No branches or pull requests

4 participants