Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: check snapshot name for valid characters, fixes #6955#6956

Merged
rfay merged 2 commits intoddev:mainfrom
stasadev:20250203_stasadev_validate_snapshot_name
Feb 5, 2025
Merged

fix: check snapshot name for valid characters, fixes #6955#6956
rfay merged 2 commits intoddev:mainfrom
stasadev:20250203_stasadev_validate_snapshot_name

Conversation

@stasadev
Copy link
Member

@stasadev stasadev commented Feb 3, 2025

The Issue

How This PR Solves The Issue

Checks if the snapshot title contains letters, numbers, hyphens, or underscores.

Instead, we could escape or replace incorrect characters, but the validation is simpler.

Manual Testing Instructions

ddev snapshot --name="with spaces"
Failed to snapshot d11: invalid snapshot name 'with spaces': it may only contain letters, numbers, hyphens, periods, and underscores
ddev snapshot --name="single'quotes"
Failed to snapshot d11: invalid snapshot name 'single'quotes': it may only contain letters, numbers, hyphens, periods, and underscores
ddev snapshot --name="double\"quotes"
Failed to snapshot d11: invalid snapshot name 'double"quotes': it may only contain letters, numbers, hyphens, periods, and underscores
ddev snapshot --name="my_snapshot-123-test.name"
Creating database snapshot my_snapshot-123-test.name
Created database snapshot my_snapshot-123-test.name 
Restore this snapshot with 'ddev snapshot restore my_snapshot-123-test.name'

Automated Testing Overview

Release/Deployment Notes

@stasadev stasadev requested a review from a team as a code owner February 3, 2025 14:11
@github-actions github-actions bot added the bugfix label Feb 3, 2025
Copy link
Member

@rfay rfay left a comment

Choose a reason for hiding this comment

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

Looks great to me, thanks.

@github-actions
Copy link

github-actions bot commented Feb 3, 2025

@rfay rfay merged commit f321821 into ddev:main Feb 5, 2025
17 checks passed
@rfay rfay deleted the 20250203_stasadev_validate_snapshot_name branch February 5, 2025 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments