DRAFT: Add project ingestion to the DB to the project sync cron job#98
DRAFT: Add project ingestion to the DB to the project sync cron job#98alasdairwilson wants to merge 4 commits into
Conversation
|
I have marked this as a draft because I havent really let this change perculate in my head very long so I don't know if it is fully "right" but I am on AL so I figured if I atleast made the PR people could have a look. |
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
| git clone --branch "${PROJECTS_REPO_BRANCH}" "${PROJECTS_REPO_URL}" "${PROJECTS_DIR}" | ||
| fi | ||
| end_ts="$(date -u --iso-8601=seconds)" | ||
| echo "[${end_ts}] Sync finished successfully" |
There was a problem hiding this comment.
Might be useful for debugging to include the time diff end_ts - start_ts in the echo message to get an idea of sync times, so something like:
time_diff=$(echo "$(date --date=$end_ts +%s) - $(date --date=$start_ts +%s)" | bc -l)
echo "[${end_ts}] Sync finished successfully in $time_diff seconds"Had to install GNU coreutils on Mac to test the time diff with gdate (not date which errors), but this should work.
| @@ -0,0 +1,353 @@ | |||
| import argparse | |||
There was a problem hiding this comment.
We now have a VERTEX CLI. I'm wondering whether it would be worth adding this functionality, for example, in an admin command subgroup.
Obviously, the CLI is user-facing, but this particular script of yours requires certain credentials and information only admins would have, so I don't see a problem with it.
I think this looks fine in its current form, but it would be nice to have a uniform common CLI that can be used by users, developers and admins.
8a678b3 to
d0fce03
Compare
Documentation build overview
7 files changed ·
|
|
The code looks good to me. I tested it using my local database and test projects for ISARICAccount. Nothing loaded when one of the emails didn't exist. Should this one just be skipped?
I changed to an existing owner and they all loaded (as expected).
And then no reload attempt for the third run (as expected).
|
Adds syncing and ingestion for external project repos into the existing auth/access DB, so deployed static projects get registered automatically and linked to real users.
One behaviour that i am not sure about... at the moment if a new project is inserted and the owner does not exist in the Users table then we throw a RuntimeError so then you would have to make the account and then wait for the hourly resync I guess?
Maybe that is fine...