Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MISC] Bugfixes #252

Merged
merged 5 commits into from
Apr 5, 2024
Merged

[MISC] Bugfixes #252

merged 5 commits into from
Apr 5, 2024

Conversation

dragomirp
Copy link
Contributor

@dragomirp dragomirp commented Mar 20, 2024

Fixing bugs noticed during switching the VM charm to templates.

@dragomirp dragomirp force-pushed the bugfixes branch 2 times, most recently from 8dbe59e to a271b6d Compare March 24, 2024 00:49
Comment on lines -203 to -205
@pytest.mark.group(1)
@pytest.mark.unstable
async def test_relation_with_openldap(ops_test: OpsTest):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The image for the charm cannot be downloaded.

Copy link
Member

Choose a reason for hiding this comment

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

Which image? I deployed OpenLDAP through juju deploy openldap-charmers-openldap --channel edge and got it in the Waiting for database relation state.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I got errors pulling the image for the same charm last week. Will recheck.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looking deeper, it looks like this is the podspec charm and the pull failure seems to originate from the image pulled by the podspec.

@@ -237,7 +237,7 @@ def _on_relation_joined(self, join_event: RelationJoinedEvent):
return

dbs = self.charm.generate_relation_databases()
dbs[join_event.relation.id] = {"name": database, "legacy": True}
dbs[str(join_event.relation.id)] = {"name": database, "legacy": True}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

JSON keys are string

Comment on lines -647 to -648
if dbs := self.get_relation_databases():
return dbs
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Regenerating should be fast enough and if the mapping is wrong for whatever reason, always using the cache will never fix it.

@@ -335,7 +335,6 @@ def _on_relation_departed(self, event: RelationDepartedEvent):
return

self.postgres.delete_user(self.auth_user)
self.charm.peers.remove_user(self.auth_user)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Doesn't exist any more

@dragomirp dragomirp marked this pull request as ready for review March 25, 2024 13:12
Comment on lines -203 to -205
@pytest.mark.group(1)
@pytest.mark.unstable
async def test_relation_with_openldap(ops_test: OpsTest):
Copy link
Member

Choose a reason for hiding this comment

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

Which image? I deployed OpenLDAP through juju deploy openldap-charmers-openldap --channel edge and got it in the Waiting for database relation state.

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.

Nice stabilisation!

Copy link

codecov bot commented Apr 5, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 12 lines in your changes are missing coverage. Please review.

Project coverage is 72.24%. Comparing base (ea0c729) to head (6755cb2).

Files Patch % Lines
src/charm.py 0.00% 8 Missing and 1 partial ⚠️
src/relations/db.py 66.66% 1 Missing and 1 partial ⚠️
src/relations/backend_database.py 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #252      +/-   ##
==========================================
+ Coverage   71.90%   72.24%   +0.34%     
==========================================
  Files           8        8              
  Lines        1075     1081       +6     
  Branches      182      185       +3     
==========================================
+ Hits          773      781       +8     
+ Misses        235      230       -5     
- Partials       67       70       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dragomirp dragomirp merged commit 0c2a151 into main Apr 5, 2024
34 checks passed
@dragomirp dragomirp deleted the bugfixes branch April 5, 2024 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants