Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
dcdc4dd
Add first part of refresh v3 implementation
marceloneppel Sep 30, 2025
02651eb
Add second part of refresh v3 implementation
marceloneppel Oct 1, 2025
cd935f2
Merge remote-tracking branch 'origin/16/edge' into refresh-v3
marceloneppel Oct 2, 2025
0e073d0
Update poetry.lock
marceloneppel Oct 2, 2025
086bc7c
Revert (for testing) Set charm refresh compatibility version from git…
marceloneppel Oct 2, 2025
13fe1c2
Merge remote-tracking branch 'origin/16/edge' into refresh-v3
marceloneppel Oct 17, 2025
6482969
Update logic refresh to start workload at the right time
marceloneppel Oct 27, 2025
c40d26e
Wait some seconds before calling resume-refresh
marceloneppel Oct 27, 2025
7fe482a
Fix both integration tests and make them handle incompatible upgrades
marceloneppel Oct 28, 2025
e53aa35
Fix unit tests
marceloneppel Oct 28, 2025
9b9b03a
Remove partition check
marceloneppel Oct 28, 2025
2a806f7
Remove charm refresh compatibility versioning from the git tag implem…
marceloneppel Oct 28, 2025
38e4870
Remove commented code, fix scale down and pre-refresh check, and add …
marceloneppel Oct 29, 2025
9c1a026
Remove debug error messages
marceloneppel Oct 29, 2025
18c51c4
Switchover to unit zero when needed on upgrade tests
marceloneppel Oct 29, 2025
7a9c052
Fix trust test
marceloneppel Oct 29, 2025
bc4729f
Fix redis-k8s channel
marceloneppel Oct 29, 2025
d3a753e
Remove commented code
marceloneppel Oct 29, 2025
dfe5b0a
Remove commented code and fix log calls
marceloneppel Oct 29, 2025
06c15fe
Fix redis-k8s base
marceloneppel Oct 29, 2025
c7cdacd
Increase tests timeouts
marceloneppel Oct 29, 2025
ed74668
Increase one more test timeout
marceloneppel Oct 29, 2025
1cfc44d
Increase test timeout
marceloneppel Oct 29, 2025
46eac97
Merge remote-tracking branch 'origin/16/edge' into refresh-v3
marceloneppel Nov 4, 2025
86860f1
Reorder call to refresh logic and don't immediatelly exit hook when r…
marceloneppel Nov 19, 2025
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
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:
- '**.md'
- .github/renovate.json5
- 'docs/**'
- 'terraform/**'
Copy link
Member Author

Choose a reason for hiding this comment

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

Added to match the rule we have in the VM charm.

schedule:
- cron: '53 0 * * *' # Daily at 00:53 UTC
# Triggered on push to branch "main" by .github/workflows/release.yaml
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,24 @@ jobs:
uses: actions/checkout@v5
- name: Set up environment
run: |
sudo snap install charmcraft --classic
sudo snap install go --classic
go install github.com/snapcore/spread/cmd/spread@latest
pipx install tox poetry
- name: Collect spread jobs
id: collect-jobs
shell: python
run: |
import json
import pathlib
import os
import subprocess

spread_jobs = (
subprocess.run(
["charmcraft", "test", "--list", "github-ci"], capture_output=True, check=True, text=True
[pathlib.Path.home() / "go/bin/spread", "-list", "github-ci"],
capture_output=True,
check=True,
text=True,
Comment on lines +36 to +39
Copy link
Member Author

Choose a reason for hiding this comment

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

Update to list tests now that we're using charmcraft v4.

)
.stdout.strip()
.split("\n")
Expand Down
24 changes: 4 additions & 20 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Copyright 2023 Canonical Ltd.
# See LICENSE file for licensing details.
name: Release to Charmhub
name: Release to Charmhub edge

on:
push:
branches:
- '16/edge'
- '*/edge'
paths-ignore:
- 'tests/**'
- 'docs/**'
Expand All @@ -16,37 +16,21 @@ on:
- '.github/workflows/sync_docs.yaml'

jobs:

ci-tests:
name: Tests
uses: ./.github/workflows/ci.yaml
secrets: inherit
permissions:
contents: write # Needed for Allure Report

release-libraries:
name: Release libraries
needs:
- ci-tests
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Release charm libraries
uses: canonical/charming-actions/[email protected]
with:
credentials: "${{ secrets.CHARMHUB_TOKEN }}"
github-token: "${{ secrets.GITHUB_TOKEN }}"

release:
name: Release charm
needs:
- ci-tests
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
with:
track: 16
track: '16'
artifact-prefix: ${{ needs.ci-tests.outputs.artifact-prefix }}
secrets:
charmhub-token: ${{ secrets.CHARMHUB_TOKEN }}
Expand Down
57 changes: 55 additions & 2 deletions actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,43 @@ create-replication:
type: string
description: The name of the replication (defaults to 'default').
default: default
force-refresh-start:
description: |
Potential of data loss and downtime

Force refresh of first unit

Must run with at least one of the parameters `=false`
params:
check-compatibility:
type: boolean
default: true
description: |
Potential of data loss and downtime

If `false`, force refresh if new version of PostgreSQL and/or charm is not compatible with previous version
run-pre-refresh-checks:
type: boolean
default: true
description: |
Potential of data loss and downtime

If `false`, force refresh if app is unhealthy or not ready to refresh (and unit status shows "Pre-refresh check failed")
check-workload-container:
type: boolean
default: true
description: |
Potential of data loss and downtime during and after refresh

If `false`, allow refresh to PostgreSQL container version that has not been validated to work with the charm revision
additionalProperties: false
get-primary:
description: Get the unit with is the primary/leader in the replication.
list-backups:
description: Lists backups in s3 storage in AWS.
pre-upgrade-check:
description: Run necessary pre-upgrade checks and preparations before executing a charm refresh.
pre-refresh-check:
description: Check if charm is ready to refresh
additionalProperties: false
promote-to-primary:
description: Promotes the cluster of choice to a primary cluster. Must be ran against the leader unit when promoting a cluster
or against the unit to be promoted within the cluster.
Expand All @@ -44,5 +75,27 @@ restore:
restore-to-time:
type: string
description: Point-in-time-recovery target in PSQL format.
resume-refresh:
description: |
Refresh next unit(s) (after you have manually verified that refreshed units are healthy)

If the `pause-after-unit-refresh` config is set to `all`, this action will refresh the next unit.

If `pause-after-unit-refresh` is set to `first`, this action will refresh all remaining units.
Exception: if automatic health checks fail after a unit has refreshed, the refresh will pause.

If `pause-after-unit-refresh` is set to `none`, this action will have no effect unless it is called with `check-health-of-refreshed-units` as `false`.
params:
check-health-of-refreshed-units:
type: boolean
default: true
description: |
Potential of data loss and downtime

If `false`, force refresh (of next unit) if 1 or more refreshed units are unhealthy

Warning: if first unit to refresh is unhealthy, consider running `force-refresh-start` action on that unit instead of using this parameter.
If first unit to refresh is unhealthy because compatibility checks, pre-refresh checks, or workload container checks are failing, this parameter is more destructive than the `force-refresh-start` action.
additionalProperties: false
resume-upgrade:
description: Resume a rolling upgrade after asserting successful upgrade of a new revision.
1 change: 1 addition & 0 deletions charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ parts:
source: .
stage:
- LICENSE
- refresh_versions.toml
- scripts
- templates
libpq:
Expand Down
7 changes: 7 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,13 @@ options:
Allowed values are: from 0 to 1.80E+308.
type: float
default: 0.1
pause-after-unit-refresh:
description: |
Wait for manual confirmation to resume refresh after these units refresh

Allowed values: "all", "first", "none"
type: string
default: first
plugin_address_standardizer_data_us_enable:
default: false
type: boolean
Expand Down
Loading
Loading