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

fix: handle null values for TES volumes #49

Merged
merged 4 commits into from
Aug 27, 2024

Conversation

lvarin
Copy link
Contributor

@lvarin lvarin commented Aug 21, 2024

If spec.template.spec.volumes is null, use [] instead of None.

This is just to make taskmaster more robust

Summary by Sourcery

Fix the handling of null values in spec.template.spec.volumes by defaulting to an empty list to enhance robustness.

Bug Fixes:

  • Ensure that if spec.template.spec.volumes is null, it defaults to an empty list instead of None to prevent potential errors.

Copy link

sourcery-ai bot commented Aug 21, 2024

Reviewer's Guide by Sourcery

This pull request addresses a robustness issue in the taskmaster component. It modifies the run_executor function in src/tesk_core/taskmaster.py to handle the case where spec.template.spec.volumes is None by initializing it as an empty list before extending it with volume information.

File-Level Changes

Files Changes
src/tesk_core/taskmaster.py Added a check to initialize 'volumes' as an empty list if it is None

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @lvarin - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider adding a brief comment explaining why this None check is necessary. It could help future maintainers understand the reasoning behind this addition.
  • It might be worth investigating if the case where 'volumes' is None can be prevented earlier in the code flow. If not, this fix is a good defensive measure.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@uniqueg uniqueg changed the title Fix: If spec.template.spec.volumes is null, use [] instead of None fix: handle null values for TES volumes Aug 21, 2024
uniqueg
uniqueg previously approved these changes Aug 21, 2024
uniqueg
uniqueg previously approved these changes Aug 22, 2024
@lvarin lvarin merged commit d1fc869 into elixir-cloud-aai:master Aug 27, 2024
5 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.

2 participants