fix(coder/modules/dotfiles): allow tilde in DOTFILES_URI shell validation#904
Open
35C4n0r wants to merge 2 commits into
Open
fix(coder/modules/dotfiles): allow tilde in DOTFILES_URI shell validation#90435C4n0r wants to merge 2 commits into
35C4n0r wants to merge 2 commits into
Conversation
…tion The shell-side regex in run.sh did not include ~ in the allowed character set, causing URLs with tilde paths (e.g. Bitbucket personal repos like ssh://git@bitbucket.example.org:7999/~user/repo.git) to be rejected with 'invalid characters'. The Terraform-side validations already allowed tilde. Also updated the 'accepts valid git URL formats' test to execute the rendered shell script, closing the coverage gap that let this inconsistency slip through. Fixes #762
Contributor
Version Bump RequiredOne or more modules in this PR need their versions updated. To fix this:
The CI will automatically re-run once you push the updated versions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #762
Problem
The shell-side URI validation regex in
run.shdid not include~in the allowed character set. URLs containing tilde paths (common in Bitbucket Server personal repositories, e.g.ssh://git@bitbucket.example.org:7999/~user/repo.git) were rejected at runtime withERROR: DOTFILES_URI contains invalid characters.The Terraform-side validations in
main.tfalready allowed~, so the inconsistency only surfaced when the script actually ran in a workspace.Changes
run.sh: Added~to the character class in the shell validation regex, making it consistent with the three Terraform regex patterns inmain.tf.main.test.ts: The "accepts valid git URL formats" test now also executes the rendered shell script and asserts that the shell-side validation does not reject any of the valid URLs. This closes the coverage gap that let the Terraform/shell inconsistency go undetected.