Skip to content

Conversation

dragomirp
Copy link
Contributor

@dragomirp dragomirp commented Jan 9, 2023

Issue

  • DPE-1083
  • The charm should block in case extensions are enabled by a legacy relation

Solution

  • Changed where the charm was looking for if extensions were enabled

Context

  • Essentially the same as the fix for DPE-1034
  • The Postgresql charm should block in case relation extensions are enabled, but it was looking for them in the relation databags, not in the event data
  • Also updated action versions

Testing

  • Added integration test to verify that the charm will block

Release Notes

Fixes bug in preventing relation extensions

@codecov
Copy link

codecov bot commented Jan 9, 2023

Codecov Report

Merging #50 (4ee6f3b) into main (362ad57) will not change coverage.
The diff coverage is 0.00%.

@@           Coverage Diff           @@
##             main      #50   +/-   ##
=======================================
  Coverage   65.35%   65.35%           
=======================================
  Files           6        6           
  Lines         814      814           
  Branches      115      115           
=======================================
  Hits          532      532           
  Misses        258      258           
  Partials       24       24           
Impacted Files Coverage Δ
src/relations/db.py 69.74% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Comment on lines +167 to +178
await ops_test.model.deploy(
"nextcloud",
channel="edge",
application_name="nextcloud",
num_units=APPLICATION_UNITS,
)
await ops_test.model.wait_for_idle(
apps=["nextcloud"],
status="blocked",
raise_on_blocked=False,
timeout=1000,
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a third party charm requesting extensions.

Copy link
Member

Choose a reason for hiding this comment

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

Awesome finding!

@dragomirp
Copy link
Contributor Author

Codecov seems to complain that the patch doesn't change the coverage. How should we deal with such cases?

@dragomirp dragomirp marked this pull request as ready for review January 11, 2023 11:50
@taurus-forever
Copy link
Contributor

How should we deal with such cases?

@marceloneppel ? IMHO, enforcing test coverage is not something we should push now, IMHO.

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.

Tnx!

Copy link
Member

@marceloneppel marceloneppel left a comment

Choose a reason for hiding this comment

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

It looks great! @taurus-forever, I agree about not enforcing the coverage now. And also because IMO the specific issue we see in this PR may be a bug on codecov or its action.

In this case it commented The diff coverage is 0.00%. but it passed when it commented The diff coverage is n/a. (on #43 (comment)). I know we have a minor difference between both PRs, but it seems to be a bug on codecov.

Comment on lines +167 to +178
await ops_test.model.deploy(
"nextcloud",
channel="edge",
application_name="nextcloud",
num_units=APPLICATION_UNITS,
)
await ops_test.model.wait_for_idle(
apps=["nextcloud"],
status="blocked",
raise_on_blocked=False,
timeout=1000,
)
Copy link
Member

Choose a reason for hiding this comment

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

Awesome finding!

@dragomirp dragomirp merged commit 521b03c into main Jan 12, 2023
@dragomirp dragomirp deleted the dpe-1083-preventing-relation-extensions branch January 12, 2023 13:07
BON4 pushed a commit to BON4/postgresql-operator that referenced this pull request Apr 23, 2024
* Prevent relation extensions

* Integration test
github-actions bot added a commit to canonical/test-runners-2-github-x64-postgresql-operator that referenced this pull request May 24, 2024
github-actions bot added a commit to canonical/test-runners-2-azure-arm64-postgresql-operator that referenced this pull request May 24, 2024
github-actions bot added a commit to canonical/test-runners-2-is-x64-postgresql-operator that referenced this pull request May 25, 2024
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.

3 participants