Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds create pr urls for other providers #4143

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

Conversation

eamodio
Copy link
Member

@eamodio eamodio commented Mar 12, 2025

Refs #4142

protected override getUrlForComparison(base: string, compare: string, _notation: '..' | '...'): string {
return this.encodeUrl(`${this.baseUrl}/branches/compare/${base}%0D${compare}`).replace('%250D', '%0D');
protected override getUrlForComparison(base: string, head: string, _notation: '..' | '...'): string {
return this.encodeUrl(`${this.baseUrl}/branches/compare/${base}%0D${head}`).replace('%250D', '%0D');

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding High

This replaces only the first occurrence of '%250D'.

Copilot Autofix AI 8 days ago

To fix the problem, we need to ensure that all occurrences of the string '%250D' are replaced in the URL. This can be achieved by using a regular expression with the global flag (g) in the replace method. This change will ensure that every instance of '%250D' in the URL is replaced with '%0D'.

Suggested changeset 1
src/git/remotes/bitbucket-server.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/git/remotes/bitbucket-server.ts b/src/git/remotes/bitbucket-server.ts
--- a/src/git/remotes/bitbucket-server.ts
+++ b/src/git/remotes/bitbucket-server.ts
@@ -160,3 +160,3 @@
 	protected override getUrlForComparison(base: string, head: string, _notation: '..' | '...'): string {
-		return this.encodeUrl(`${this.baseUrl}/branches/compare/${base}%0D${head}`).replace('%250D', '%0D');
+		return this.encodeUrl(`${this.baseUrl}/branches/compare/${base}%0D${head}`).replace(/%250D/g, '%0D');
 	}
EOF
@@ -160,3 +160,3 @@
protected override getUrlForComparison(base: string, head: string, _notation: '..' | '...'): string {
return this.encodeUrl(`${this.baseUrl}/branches/compare/${base}%0D${head}`).replace('%250D', '%0D');
return this.encodeUrl(`${this.baseUrl}/branches/compare/${base}%0D${head}`).replace(/%250D/g, '%0D');
}
Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
sergeibbb added a commit that referenced this pull request Mar 13, 2025
sergeibbb added a commit that referenced this pull request Mar 17, 2025
sergeibbb added a commit that referenced this pull request Mar 17, 2025
sergeibbb added a commit that referenced this pull request Mar 17, 2025
…rvices

Adds configuration options for comparison and create pull request URLs
to support custom remote services.

Updates the relevant interfaces and abstract methods to include
these new URL types.
(#4142, #4143)
sergeibbb added a commit that referenced this pull request Mar 18, 2025
…rvices

Adds configuration options for comparison and create pull request URLs
to support custom remote services.

Updates the relevant interfaces and abstract methods to include
these new URL types.
(#4142, #4143)
sergeibbb added a commit that referenced this pull request Mar 18, 2025
sergeibbb added a commit that referenced this pull request Mar 18, 2025
sergeibbb added a commit that referenced this pull request Mar 18, 2025
sergeibbb added a commit that referenced this pull request Mar 18, 2025
sergeibbb added a commit that referenced this pull request Mar 18, 2025
@sergeibbb sergeibbb force-pushed the feature/create-prs branch from 38021ba to f470126 Compare March 18, 2025 21:24
sergeibbb added a commit that referenced this pull request Mar 19, 2025
@sergeibbb sergeibbb force-pushed the feature/create-prs branch from f470126 to d324a33 Compare March 19, 2025 09:55
sergeibbb added a commit that referenced this pull request Mar 19, 2025
sergeibbb added a commit that referenced this pull request Mar 19, 2025
sergeibbb added a commit that referenced this pull request Mar 19, 2025
sergeibbb added a commit that referenced this pull request Mar 19, 2025
@sergeibbb sergeibbb force-pushed the feature/create-prs branch from d324a33 to 2f19e0e Compare March 19, 2025 12:55
sergeibbb added a commit that referenced this pull request Mar 19, 2025
sergeibbb added a commit that referenced this pull request Mar 19, 2025
sergeibbb added a commit that referenced this pull request Mar 19, 2025
sergeibbb added a commit that referenced this pull request Mar 19, 2025
sergeibbb added a commit that referenced this pull request Mar 19, 2025
sergeibbb added a commit that referenced this pull request Mar 19, 2025
sergeibbb added a commit that referenced this pull request Mar 19, 2025
sergeibbb added a commit that referenced this pull request Mar 19, 2025
@sergeibbb sergeibbb force-pushed the feature/create-prs branch from 3c8f601 to fcfae9b Compare March 19, 2025 13:24
sergeibbb added a commit that referenced this pull request Mar 19, 2025
sergeibbb added a commit that referenced this pull request Mar 19, 2025
sergeibbb added a commit that referenced this pull request Mar 19, 2025
sergeibbb added a commit that referenced this pull request Mar 19, 2025
@sergeibbb sergeibbb linked an issue Mar 19, 2025 that may be closed by this pull request
9 tasks
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.

Create Pull Request action fails for remotes other than GitHub
2 participants