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

[DPE-5039] - Simple charm ops #19

Merged
merged 11 commits into from
Aug 12, 2024
Merged

[DPE-5039] - Simple charm ops #19

merged 11 commits into from
Aug 12, 2024

Conversation

MiaAltieri
Copy link
Collaborator

@MiaAltieri MiaAltieri commented Aug 6, 2024

Issue

Right now the mongos charm does nothing. Before even implementing relations to clients + config-server it should perform some basic operations. Namely:

  • listen to pebble event
  • show status messages for waiting for relations
  • copy in other helpers/libs from mongos charm that are applicable

Solution

Implement the above items and

  • test that mongos on start goes into blocked state while waiting for integrations
  • keep as much similarity as possible between itself and the mongos vm charm

@MiaAltieri MiaAltieri changed the title Simple charm ops [DPE-5039] - Simple charm ops Aug 7, 2024
Copy link
Contributor

@Gu1nness Gu1nness left a comment

Choose a reason for hiding this comment

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

A few general comments and remarks:

  • Sorry for the amount of comments, it's just I'm reading most of this reused code for the first time.
  • Overall in typing with python3.10, you can forget about Optional[X] and move to more modern and easier to understand (and better handled) X | None
  • A few nits in my comments, about typos between Mongos and MongoDB.
  • A few comments about code that could be moved to shared libraries/python packages.

src/charm.py Show resolved Hide resolved
src/charm.py Outdated Show resolved Hide resolved
src/charm.py Show resolved Hide resolved
src/charm.py Outdated Show resolved Hide resolved
src/charm.py Outdated Show resolved Hide resolved
src/charm.py Outdated Show resolved Hide resolved
src/charm.py Show resolved Hide resolved
src/exceptions.py Outdated Show resolved Hide resolved
src/config.py Outdated Show resolved Hide resolved
src/exceptions.py Show resolved Hide resolved
@MiaAltieri MiaAltieri requested a review from Gu1nness August 7, 2024 09:20
Copy link
Contributor

@Gu1nness Gu1nness left a comment

Choose a reason for hiding this comment

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

Two last minor mistakes here

src/charm.py Outdated Show resolved Hide resolved
src/charm.py Outdated Show resolved Hide resolved
src/charm.py Outdated Show resolved Hide resolved
@MiaAltieri MiaAltieri requested a review from Gu1nness August 7, 2024 12:59
Copy link
Contributor

@Mehdi-Bendriss Mehdi-Bendriss left a comment

Choose a reason for hiding this comment

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

Thanks Mia, I have a few questions

src/charm.py Outdated Show resolved Hide resolved
src/charm.py Outdated Show resolved Hide resolved
return

value = secret.get_content().get(key)
if value != Config.Secrets.SECRET_DELETED_LABEL:
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain this? why are we testing against the string "None"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I actually cannot, I believe this was initially written by Judit 😅

Copy link
Contributor

Choose a reason for hiding this comment

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

okay - let's please track it in a separate ticket and understand what exactly is happening there for a future PR

src/charm.py Outdated Show resolved Hide resolved
src/charm.py Outdated Show resolved Hide resolved
src/charm.py Outdated Show resolved Hide resolved
src/charm.py Show resolved Hide resolved
src/charm.py Show resolved Hide resolved
src/charm.py Show resolved Hide resolved
Copy link

codecov bot commented Aug 12, 2024

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@MiaAltieri MiaAltieri merged commit b62bc54 into 6/edge Aug 12, 2024
8 of 9 checks passed
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