Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions .github/workflows/CD_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ jobs:
run: |
uv run alembic upgrade head

- name: Refresh materialized views on production database
env:
DB_DRIVER: "cloudsql"
CLOUD_SQL_INSTANCE_NAME: "${{ secrets.CLOUD_SQL_INSTANCE_NAME }}"
CLOUD_SQL_DATABASE: "${{ vars.CLOUD_SQL_DATABASE }}"
CLOUD_SQL_USER: "${{ secrets.CLOUD_SQL_USER }}"
CLOUD_SQL_IAM_AUTH: true
Comment on lines +51 to +56
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

The env block for the DB connection is now duplicated across multiple steps (migrations + refresh). This increases drift risk if one step’s DB settings change later. Consider moving these shared DB env vars to a job-level env: (or using a YAML anchor) and overriding only what differs per-step.

Copilot uses AI. Check for mistakes.
run: |
uv run python -m cli.cli refresh-pygeoapi-materialized-views
Comment on lines +50 to +58
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

The PR description is still the unfilled template ("Use bullet points here" under Why/How/Notes). Please update the PR description to describe the problem being solved and what changed so reviewers/operators understand the deployment impact (e.g., when/why the materialized view refresh runs).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Refresh views concurrently to avoid blocking API reads

In the production deploy workflow, this command invokes refresh-pygeoapi-materialized-views with its default non-concurrent mode (concurrently=False in cli/cli.py), which runs REFRESH MATERIALIZED VIEW and can hold exclusive locks on each materialized view for the duration of the refresh transaction. Because these exact views are the backing tables for live pygeoapi collections (core/pygeoapi-config.yml), requests hitting those endpoints during deployment can block until refresh completes, creating avoidable user-facing downtime; pass --concurrently (supported by the CLI) or otherwise avoid lock-heavy refreshes in the deploy path.

Useful? React with 👍 / 👎.


- name: Ensure envsubst is available
run: |
if ! command -v envsubst >/dev/null 2>&1; then
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/CD_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ jobs:
run: |
uv run alembic upgrade head

- name: Refresh materialized views on staging database
env:
DB_DRIVER: "cloudsql"
CLOUD_SQL_INSTANCE_NAME: "${{ secrets.CLOUD_SQL_INSTANCE_NAME }}"
CLOUD_SQL_DATABASE: "${{ vars.CLOUD_SQL_DATABASE }}"
CLOUD_SQL_USER: "${{ secrets.CLOUD_SQL_USER }}"
CLOUD_SQL_IAM_AUTH: true
Comment on lines +51 to +56
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

The env block for the DB connection is now duplicated across multiple steps (migrations + refresh). This increases drift risk if one step’s DB settings change later. Consider moving these shared DB env vars to a job-level env: (or using a YAML anchor) and overriding only what differs per-step.

Copilot uses AI. Check for mistakes.
run: |
uv run python -m cli.cli refresh-pygeoapi-materialized-views

- name: Ensure envsubst is available
run: |
if ! command -v envsubst >/dev/null 2>&1; then
Expand Down
Loading