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

OC-888: Deploying ARI ingests to prod #692

Merged
merged 20 commits into from
Sep 27, 2024
Merged

OC-888: Deploying ARI ingests to prod #692

merged 20 commits into from
Sep 27, 2024

Conversation

finlay-jisc
Copy link
Collaborator

@finlay-jisc finlay-jisc commented Sep 24, 2024

The purpose of this PR was to provide a way to manually trigger ARI ingests on prod, rather than only scheduled runs, to avoid timing out the operation or creating a large number of new records unnecessarily.

This PR requires a new environment variable containing recipient emails to be defined before deployment.

Also:

  • Reworked serverless offline file to access environment variables directly from .env file, as we no longer need to "pretend" to get these from SSM with the serverless-offline-ssm package (because the offline stuff was split out into its own file).
  • Removed a helper that was only used in one file; the rest of the time we access env vars directly anyway without this helper.
  • Made some changes to the playwright setup because it suddenly stopped being able to find the env file and asset files.

Acceptance Criteria:

  • Run the script from "OC-884: Create script to create publications for existing ARIs" on prod to populate existing ARIs
    • This was run but asked to rollback, and now things have changed and it isn't ready to run anymore, so this AC is no longer applicable.
  • The weekly ingest on int no longer runs automatically
  • An API key protected endpoint is present to trigger the operation on prod or int
    • This endpoint does not trigger if if it is already running
  • Upon the completion of the operation, an email is dispatched to (redacted email addresses) including:
    • Number of publications checked
    • How long it took
    • Number of new publications created
    • Number of publications re-versioned updated (we update these in place rather than reversion)
    • Whether an unrecognised department was present
    • Whether an unrecognised topic was present

Checklist:

  • Local manual testing conducted
  • Automated tests added
  • Documentation updated

Tests:

API
Screenshot 2024-09-25 102046

E2E
Screenshot 2024-09-25 100711


Screenshots:

Email contents (HTML):
Screenshot 2024-09-18 142623

Email contents (text):
Screenshot 2024-09-18 142911

Copy link

vercel bot commented Sep 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
octopus ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 25, 2024 0:17am

@finlay-jisc finlay-jisc marked this pull request as ready for review September 25, 2024 09:30
@finlay-jisc finlay-jisc requested a review from a team as a code owner September 25, 2024 09:30
api/src/lib/sqs.ts Outdated Show resolved Hide resolved
@adwearing-jisc
Copy link

Just thinking with the moving from offline SSM. Noticed this with working on KSGW, adding the secrets from SSM to the lambda puts the raw secret in the lambda config. I won't put a screenshot here for obvious reasons but something that should be looked at eventually.

@finlay-jisc finlay-jisc merged commit 10c488b into main Sep 27, 2024
11 checks passed
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.

2 participants