Skip to content

Conversation

dragomirp
Copy link
Contributor

@dragomirp dragomirp commented Jul 9, 2025

Relates to #367

  • Conditionally import and initialise the legacy interface to support juju 4
  • Update charm libs

@dragomirp dragomirp added the enhancement New feature, UI change, or workload upgrade label Jul 9, 2025
@dragomirp dragomirp marked this pull request as ready for review July 9, 2025 10:03
self,
event: pgsql.DatabaseRelationJoinedEvent, # type: ignore
) -> None:
def _on_database_relation_joined(self, event) -> None:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Type definition, not strictly necessary.

self.db.on.database_relation_joined, self._on_database_relation_joined
)
if self.model.juju_version.major < 4:
pgsql = ops.lib.use("pgsql", 1, "postgresql-charmers@lists.launchpad.net")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved inside the if in case the lib loader also causes issues.

@dragomirp dragomirp requested review from a team, taurus-forever and marceloneppel and removed request for a team July 9, 2025 10:05
Copy link
Contributor

@taurus-forever taurus-forever left a comment

Choose a reason for hiding this comment

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

LGTM, Tnx!
@anvial please test from your side.

P.S. @dragomirp should we block the charm if user request psql relation on Juju 4+ ?

@dragomirp
Copy link
Contributor Author

P.S. @dragomirp should we block the charm if user request psql relation on Juju 4+ ?

No need IMHO. The interface is only used here to block the provider if roles and extensions are requested. It is not a functional integration in the first place.

@dragomirp
Copy link
Contributor Author

There seems to be an issue with the restart test on VM. Disabling for now to unblock Juju 4.

@dragomirp dragomirp merged commit 0d03e8d into main Jul 9, 2025
31 of 33 checks passed
@taurus-forever taurus-forever deleted the conditionally-db-rel branch July 11, 2025 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature, UI change, or workload upgrade Libraries: OK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants