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

fix: sync should ensure admin user is created #76683

Merged
merged 3 commits into from
Aug 28, 2024
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
35 changes: 32 additions & 3 deletions devenv/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def run_procs(
f"""
❌ {name}

failed command (code p.returncode):
failed command (code {p.returncode}):
{shlex.join(final_cmd)}

Output:
Expand Down Expand Up @@ -235,7 +235,7 @@ def main(context: dict[str, str]) -> int:
exit=True,
)

if run_procs(
if not run_procs(
repo,
reporoot,
venv_dir,
Expand All @@ -247,6 +247,35 @@ def main(context: dict[str, str]) -> int:
),
),
):
return 0
return 1

# faster prerequisite check than starting up sentry and running createuser idempotently
stdout = proc.run(
(
"docker",
"exec",
"sentry_postgres",
"psql",
"sentry",
"postgres",
"-t",
"-c",
"select exists (select from auth_user where email = 'admin@sentry.io')",
),
stdout=True,
)
if stdout != "t":
proc.run(
(
f"{venv_dir}/bin/sentry",
"createuser",
"--superuser",
"--email",
"admin@sentry.io",
"--password",
"admin",
"--no-input",
)
)

return 1
Loading