Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ci/bootstrap_create_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ async def insert(tx: Transaction) -> Optional[int]:
if row:
if row['state'] == 'active':
return None
if row['state'] == 'inactive':
# Inactive users don't need recreating, but we should reactivate before we move on
await tx.execute_update(
'UPDATE users SET state = "active", last_activated = CURRENT_TIMESTAMP(3) WHERE id = %s;',
(row['id'],),
)
return None
Copy link
Contributor

@grohli grohli Oct 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just want to confirm, will this reactivate all inactive users rather than just any inactive test users (eg test-dev)? And then follow up if yes, do we think making every inactive user active again mess with anything else downstream of this in ci?

Disregard, I can't read. I see now that we're only doing this for the bot accounts:

users = [
# username, login_id, is_developer, is_service_account
('auth', None, 0, 1),
('batch', None, 0, 1),
('ci', None, 0, 1),
('test', None, 0, 0),
('test-dev', None, 1, 0),
('grafana', None, 0, 1),
]

...
for username, login_id, is_developer, is_service_account in users:
user_id = await insert_user_if_not_exists(app, username, login_id, is_developer, is_service_account)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, but actually bot or non-bot we can read this as "for the accounts that we are bootstrapping into the system, we should reactivate them if they already exist but are inactive". It doesn't do anything to any other preexisting accounts

return row['id']

hail_credentials_secret_name = f'{username}-gsa-key'
Expand Down