Skip to content

fix(coder/modules/dotfiles): allow tilde in DOTFILES_URI shell validation#904

Open
35C4n0r wants to merge 2 commits into
mainfrom
fix/dotfiles-allow-tilde-in-uri
Open

fix(coder/modules/dotfiles): allow tilde in DOTFILES_URI shell validation#904
35C4n0r wants to merge 2 commits into
mainfrom
fix/dotfiles-allow-tilde-in-uri

Conversation

@35C4n0r
Copy link
Copy Markdown
Collaborator

@35C4n0r 35C4n0r commented May 28, 2026

Fixes #762

Problem

The shell-side URI validation regex in run.sh did 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 with ERROR: DOTFILES_URI contains invalid characters.

The Terraform-side validations in main.tf already 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 in main.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.

🤖 Generated by Coder Agents

…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
@35C4n0r 35C4n0r requested a review from DevelopmentCats May 28, 2026 17:21
@35C4n0r 35C4n0r self-assigned this May 28, 2026
@matifali matifali added the version:patch Add to PRs requiring a patch version upgrade label May 30, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Version Bump Required

One or more modules in this PR need their versions updated.

To fix this:

  1. Run the version bump script locally:
    ./.github/scripts/version-bump.sh patch
  2. Commit the changes:
    git add . && git commit -m "chore: bump module versions (patch)"
  3. Push your changes

The CI will automatically re-run once you push the updated versions.

@35C4n0r 35C4n0r added version:patch Add to PRs requiring a patch version upgrade and removed version:patch Add to PRs requiring a patch version upgrade labels May 30, 2026
@matifali matifali marked this pull request as ready for review May 30, 2026 09:33
Copy link
Copy Markdown
Member

@matifali matifali left a comment

Choose a reason for hiding this comment

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

LGTM.

@35C4n0r please test manualy before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

version:patch Add to PRs requiring a patch version upgrade

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dotfiles: tilde sign in git repository URL is not allowed

2 participants