diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e5e7353ef7..1c482c4eb5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -22,7 +22,7 @@ on: jobs: lint: name: Lint - uses: canonical/data-platform-workflows/.github/workflows/lint.yaml@v13.2.0 + uses: canonical/data-platform-workflows/.github/workflows/lint.yaml@v14.0.0 unit-test: name: Unit test charm @@ -42,7 +42,7 @@ jobs: build: name: Build charm - uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v13.2.0 + uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v14.0.0 with: cache: true @@ -58,12 +58,17 @@ jobs: allure_on_amd64: true architecture: - amd64 + include: + - juju: + agent: 3.1.8 # renovate: latest juju 3 + allure_on_amd64: true + architecture: arm64 name: Integration test charm | ${{ matrix.juju.agent }} | ${{ matrix.architecture }} needs: - lint - unit-test - build - uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@v13.2.0 + uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@v14.0.0 with: artifact-prefix: ${{ needs.build.outputs.artifact-prefix }} architecture: ${{ matrix.architecture }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ffc2119371..a4fb5d2afc 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -24,14 +24,14 @@ jobs: build: name: Build charm - uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v13.2.0 + uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v14.0.0 release: name: Release charm needs: - ci-tests - build - uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@v13.2.0 + uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@v14.0.0 with: channel: 14/edge artifact-prefix: ${{ needs.build.outputs.artifact-prefix }} diff --git a/.github/workflows/sync_issue_to_jira.yaml b/.github/workflows/sync_issue_to_jira.yaml index 6fbe36ba41..b1d1b02e3b 100644 --- a/.github/workflows/sync_issue_to_jira.yaml +++ b/.github/workflows/sync_issue_to_jira.yaml @@ -9,7 +9,7 @@ on: jobs: sync: name: Sync GitHub issue to Jira - uses: canonical/data-platform-workflows/.github/workflows/sync_issue_to_jira.yaml@v13.2.0 + uses: canonical/data-platform-workflows/.github/workflows/sync_issue_to_jira.yaml@v14.0.0 with: jira-base-url: https://warthogs.atlassian.net jira-project-key: DPE diff --git a/lib/charms/data_platform_libs/v0/upgrade.py b/lib/charms/data_platform_libs/v0/upgrade.py index ef74644de4..18a58ff09e 100644 --- a/lib/charms/data_platform_libs/v0/upgrade.py +++ b/lib/charms/data_platform_libs/v0/upgrade.py @@ -285,7 +285,7 @@ def restart(self, event) -> None: # Increment this PATCH version before using `charmcraft publish-lib` or reset # to 0 if you are raising the major API version -LIBPATCH = 16 +LIBPATCH = 17 PYDEPS = ["pydantic>=1.10,<2", "poetry-core"] @@ -907,6 +907,17 @@ def _on_upgrade_charm(self, event: UpgradeCharmEvent) -> None: logger.error(e) self.set_unit_failed() return + top_unit_id = self.upgrade_stack[-1] + top_unit = self.charm.model.get_unit(f"{self.charm.app.name}/{top_unit_id}") + if ( + top_unit == self.charm.unit + and self.peer_relation.data[self.charm.unit].get("state") == "recovery" + ): + # While in a rollback and the Juju leader unit is the top unit in the upgrade stack, emit the event + # for this unit to start the rollback. + self.peer_relation.data[self.charm.unit].update({"state": "ready"}) + self.on_upgrade_changed(event) + return self.charm.unit.status = WaitingStatus("other units upgrading first...") self.peer_relation.data[self.charm.unit].update({"state": "ready"}) diff --git a/poetry.lock b/poetry.lock index a83bddad16..1375a3d273 100644 --- a/poetry.lock +++ b/poetry.lock @@ -15,6 +15,26 @@ files = [ allure-python-commons = "2.13.5" pytest = ">=4.5.0" +[[package]] +name = "allure-pytest-collection-report" +version = "0.1.0" +description = "" +optional = false +python-versions = "^3.8" +files = [] +develop = false + +[package.dependencies] +allure-pytest = ">=2.13.5" +pytest = "*" + +[package.source] +type = "git" +url = "https://github.com/canonical/data-platform-workflows" +reference = "v14.0.0" +resolved_reference = "59afebbfa1a372140df6fc63e7d747cfc013adc5" +subdirectory = "python/pytest_plugins/allure_pytest_collection_report" + [[package]] name = "allure-python-commons" version = "2.13.5" @@ -1462,8 +1482,8 @@ develop = false [package.source] type = "git" url = "https://github.com/canonical/data-platform-workflows" -reference = "v13.2.0" -resolved_reference = "ba12595b3c9e91b245648a49c82dc181211a5769" +reference = "v14.0.0" +resolved_reference = "59afebbfa1a372140df6fc63e7d747cfc013adc5" subdirectory = "python/pytest_plugins/github_secrets" [[package]] @@ -1500,8 +1520,8 @@ pyyaml = "*" [package.source] type = "git" url = "https://github.com/canonical/data-platform-workflows" -reference = "v13.2.0" -resolved_reference = "ba12595b3c9e91b245648a49c82dc181211a5769" +reference = "v14.0.0" +resolved_reference = "59afebbfa1a372140df6fc63e7d747cfc013adc5" subdirectory = "python/pytest_plugins/pytest_operator_cache" [[package]] @@ -1519,8 +1539,8 @@ pytest = "*" [package.source] type = "git" url = "https://github.com/canonical/data-platform-workflows" -reference = "v13.2.0" -resolved_reference = "ba12595b3c9e91b245648a49c82dc181211a5769" +reference = "v14.0.0" +resolved_reference = "59afebbfa1a372140df6fc63e7d747cfc013adc5" subdirectory = "python/pytest_plugins/pytest_operator_groups" [[package]] @@ -2051,4 +2071,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "a73b8801ba490c66892f7cc917ab87480a8d29ae7cc37920023499f11536f6cd" +content-hash = "5eba2796328eeaad07e90fb8f2beebffedb191089e204af6cf7ff538155e948d" diff --git a/pyproject.toml b/pyproject.toml index ca1805e9de..a753a7fd71 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -66,10 +66,10 @@ optional = true [tool.poetry.group.integration.dependencies] pytest = "^8.2.0" -pytest-github-secrets = {git = "https://github.com/canonical/data-platform-workflows", tag = "v13.2.0", subdirectory = "python/pytest_plugins/github_secrets"} +pytest-github-secrets = {git = "https://github.com/canonical/data-platform-workflows", tag = "v14.0.0", subdirectory = "python/pytest_plugins/github_secrets"} pytest-operator = "^0.35.0" -pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", tag = "v13.2.0", subdirectory = "python/pytest_plugins/pytest_operator_cache"} -pytest-operator-groups = {git = "https://github.com/canonical/data-platform-workflows", tag = "v13.2.0", subdirectory = "python/pytest_plugins/pytest_operator_groups"} +pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", tag = "v14.0.0", subdirectory = "python/pytest_plugins/pytest_operator_cache"} +pytest-operator-groups = {git = "https://github.com/canonical/data-platform-workflows", tag = "v14.0.0", subdirectory = "python/pytest_plugins/pytest_operator_groups"} # renovate caret doesn't work: https://github.com/renovatebot/renovate/issues/26940 juju = "<=3.4.0.0" boto3 = "*" @@ -78,6 +78,7 @@ landscape-api-py3 = "^0.9.0" mailmanclient = "^3.3.5" psycopg2-binary = "^2.9.9" allure-pytest = "^2.13.5" +allure-pytest-collection-report = {git = "https://github.com/canonical/data-platform-workflows", tag = "v14.0.0", subdirectory = "python/pytest_plugins/allure_pytest_collection_report"} # Testing tools configuration [tool.coverage.run]