Skip to content

Conversation

@nesitor
Copy link
Member

@nesitor nesitor commented Jan 23, 2025

Problem: If a user wants to attach a volume that have a name with spaces or other weird symbols, it raises an error and don't allocate the VM.
Solution: Sanitize the volume name before creating it.

Self proofreading checklist

  • The new code clear, easy to read and well commented.
  • New code does not duplicate the functions of builtin or popular libraries.
  • An LLM was used to review the new code and look for simplifications.
  • New classes and functions contain docstrings explaining what they provide.
  • All new code is covered by relevant tests.
  • Documentation has been updated regarding these changes.
  • Dependencies update in the project.toml have been mirrored in the Debian package build script packaging/Makefile

Changes

Applied a regular expression to replace invalid characters for an _

How to test

Try to execute an instance or a program with a volume name with spaces or weird characters on their name.

@nesitor nesitor requested review from hoh and olethanh January 23, 2025 11:35
@nesitor nesitor self-assigned this Jan 23, 2025
@codecov
Copy link

codecov bot commented Jan 23, 2025

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 62.89%. Comparing base (6292bcd) to head (337695f).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/aleph/vm/storage.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #743   +/-   ##
=======================================
  Coverage   62.89%   62.89%           
=======================================
  Files          71       71           
  Lines        6352     6352           
  Branches      519      519           
=======================================
  Hits         3995     3995           
  Misses       2197     2197           
  Partials      160      160           

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

…es or other weird symbols, it raises an error and don't allocate the VM.

Solution: Sanitize the volume name before creating it.
@nesitor nesitor force-pushed the andres-fix-sanitize_invalid_volume_names branch from 33dfb62 to 337695f Compare January 23, 2025 14:20
@nesitor nesitor merged commit 77d5898 into main Jan 23, 2025
18 of 22 checks passed
@nesitor nesitor deleted the andres-fix-sanitize_invalid_volume_names branch January 23, 2025 14:32
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