Skip to content

Merge master fixes into develop#855

Merged
edwh merged 3 commits into
developfrom
master
May 21, 2026
Merged

Merge master fixes into develop#855
edwh merged 3 commits into
developfrom
master

Conversation

@edwh
Copy link
Copy Markdown
Collaborator

@edwh edwh commented May 21, 2026

Summary

  • Fix trigger definer error on yesterday startup — restores DB as root via Unix socket so DEFINER privileges on triggers are respected during backup restore
  • Add PR preview deploy to restarters.dev — web UI (/admin/preview-deploy) for admins to select any branch or open PR and trigger a rebuild of the restarters-dev container with the latest overnight DB backup

Preview deploy setup (one-time)

On the restarters-dev Fly app, set these secrets:

fly secrets set GITHUB_DEPLOY_PAT=<token-with-workflow-scope> --app restarters-dev
fly secrets set GDRIVE_BACKUP_FOLDER_ID=... --app restarters-dev
fly secrets set RCLONE_CONFIG_GDRIVE_TEAM_DRIVE=... --app restarters-dev
# plus any other rclone/gdrive secrets from restarters-yesterday

Also ensure FLY_API_TOKEN is set in GitHub repo secrets (used by preview-deploy.yml).

Test plan

  • CI passes
  • On restarters.dev, log in as admin → /admin/preview-deploy shows branch dropdown with open PRs
  • Selecting a branch and submitting triggers the GitHub Actions preview-deploy.yml workflow

edwh and others added 3 commits May 20, 2026 13:24
Production backup triggers use DEFINER='restarters'@'%', but the local
MariaDB only had 'restarters'@'127.0.0.1'. Create and grant both so
INSERT/UPDATE on devices doesn't fail with error 1449.

Safe: bind-address=127.0.0.1 means '%' cannot connect from outside.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements "deploy any branch from the web" to the develop container:

- fly.preview.toml: deploys to restarters-dev using yesterday-startup.sh
  (embedded MariaDB + overnight DB backup restore from Google Drive).
  Same credentials and secrets as the yesterday container.

- .github/workflows/preview-deploy.yml: workflow_dispatch workflow with
  a branch input. Runs fly deploy --config fly.preview.toml --remote-only.
  Requires FLY_API_TOKEN and (on the container) GDRIVE_BACKUP_FOLDER_ID,
  RCLONE_CONFIG_GDRIVE_TEAM_DRIVE secrets — same as restarters-yesterday.

- PreviewDeployController: admin-only page that fetches open PRs from
  GitHub API (using GITHUB_DEPLOY_PAT secret on the container), shows a
  dropdown of develop/master/PRs, and POSTs to trigger workflow_dispatch.

- config/services.php: adds github.deploy_pat from GITHUB_DEPLOY_PAT env.

Setup required:
  fly secrets set GITHUB_DEPLOY_PAT=<token-with-workflow-scope> --app restarters-dev
  fly secrets set GDRIVE_BACKUP_FOLDER_ID=<id> --app restarters-dev
  fly secrets set RCLONE_CONFIG_GDRIVE_TEAM_DRIVE=<id> --app restarters-dev
  (copy rclone.conf from yesterday container to restarters-dev as needed)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eature branches

Feature branches don't have fly.preview.toml, so fall back to master's copy.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@edwh edwh merged commit 63580a3 into develop May 21, 2026
1 check was pending
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

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