Skip to content

Conversation

@juev
Copy link
Owner

@juev juev commented Sep 5, 2025

The main changes are:

  • Update SSH URL regex to handle URLs with port numbers (e.g. ssh://user@host:port/path)
  • Add support for ~ character in valid repo path pattern
  • Improve URL format detection efficiency by using string prefix checks
  • Fix regex group handling for SSH URLs with optional port number
  • Add test cases for alternative SSH URL formats

The commit focuses on improving SSH URL handling while maintaining security validation.

The main changes are:
- Update SSH URL regex to handle URLs with port numbers (e.g.
  ssh://user@host:port/path)
- Add support for ~ character in valid repo path pattern
- Improve URL format detection efficiency by using string prefix checks
- Fix regex group handling for SSH URLs with optional port number
- Add test cases for alternative SSH URL formats

The commit focuses on improving SSH URL handling while maintaining
security validation.
@juev juev requested a review from Copilot September 5, 2025 11:35
@juev juev self-assigned this Sep 5, 2025

This comment was marked as outdated.

@juev juev requested a review from Copilot September 7, 2025 07:03

This comment was marked as outdated.

@juev juev requested a review from Copilot September 7, 2025 07:12

This comment was marked as outdated.

@juev juev requested a review from Copilot September 7, 2025 07:18
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Enhances SSH URL parsing to support port numbers and improves repository URL validation. The changes modernize URL format detection and add comprehensive test coverage for different SSH URL formats.

  • Updated SSH URL regex to handle port numbers in ssh://user@host:port/path format
  • Added support for tilde character in repository path validation
  • Improved URL format detection using efficient string prefix checks

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
main.go Updates SSH regex pattern to support port numbers, improves URL detection logic with prefix checks, and adjusts regex group handling
main_test.go Adds test cases for URL detection function and includes test for domain with port numbers

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@juev juev merged commit 276d9b2 into main Sep 7, 2025
2 checks passed
@juev juev deleted the fix/regexp branch September 7, 2025 07:23
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