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

DM-40505: Add an audit CLI command (0.7.0 release) #142

Merged
merged 13 commits into from
Aug 31, 2023
Merged

Conversation

jonathansick
Copy link
Member

@jonathansick jonathansick commented Aug 25, 2023

The purpose of the ook audit CLI command is to audit the Algolia document indices and check if records are missing. The initial algorithm is to check that all documents registered with the LTD API have corresponding records in Algolia. This CLI is intended to be run periodically as a Kubernetes CronJob.

- The depenencies.yaml workflow ensures pre-commit hooks stay up to date
- The periodic CI workflow upgrades dependencies to their latest
  versions and runs tests.
This was a ruff bug and it's accepted now.
This is based on the confluent all-in-on Docker compose file.
This will help distinguish it from the services.
This is a minimal mock right now; more can be implemented later for
testing the usage of the search client.

Since the SearchClient is mocked, it means that the Algolia credentials
can always be required since the test environment supplies substitute
credentials. This will simplify the creation of a "ProcessContext" that
holds all reusable clients.
The purpose of this refactor is to make it easier to get a factory in
circumstances other than the FastAPI request handler (such as in a CLI
handler). The ProcessContext holds all clients that can persist across
requests. This design also nicely refactors the code for initializing
FastAPI dependencies out of the main module and into the
ProcessContext.create class method.

This is mimicking the structure of Gafaelfawr's Factory and
ProcessContext.
This service checks the Algolia indices to ensure that expected
documents are present. We intend to run this service primarily through
the CLI (ook audit) from a Kubernetes cron job.
AlgoliaAuditService can now optionally trigger the ingest of missing
documents via the ClassificationService. From the CLI this is triggered
with the --reingest flag.
@jonathansick jonathansick marked this pull request as ready for review August 31, 2023 20:25
@jonathansick jonathansick changed the title DM-40505: Add an audit CLI command DM-40505: Add an audit CLI command (0.7.0 release) Aug 31, 2023
@jonathansick jonathansick merged commit a820dd7 into main Aug 31, 2023
4 checks passed
@jonathansick jonathansick deleted the tickets/DM-40505 branch August 31, 2023 20:43
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.

1 participant