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

Fix AzureCommentReporter where repo names contain spaces #4185

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lukelloyd1985
Copy link
Contributor

@lukelloyd1985 lukelloyd1985 commented Oct 23, 2024

Fixes #4184

Proposed Changes

When using SYSTEM_PULLREQUEST_SOURCEREPOSITORYURI variable any repositories that have spaces in the name will need the %20 URL encoded space converted back to a space.

Readiness Checklist

Author/Contributor

  • Add entry to the CHANGELOG listing the change and linking to the corresponding issue (if appropriate)
  • If documentation is needed for this change, has that been included in this pull request

Reviewing Maintainer

  • Label as breaking if this is a large fundamental change
  • Label as either automation, bug, documentation, enhancement, infrastructure, or performance

@@ -116,7 +116,7 @@ def produce_report(self):
+ "See https://learn.microsoft.com/en-us/azure/devops/pipelines/"
+ "build/variables?view=azure-devops&tabs=yaml"
)
repository_name = SYSTEM_PULLREQUEST_SOURCEREPOSITORYURI.split("/")[-1]
repository_name = SYSTEM_PULLREQUEST_SOURCEREPOSITORYURI.split("/")[-1].replace('%20', ' ')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it only spaces that need to be encoded? Or a general urlencoding should be used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's more decoding from the URL and spaces should be sufficient based on the ADO imposed restrictions?

https://learn.microsoft.com/en-us/azure/devops/organizations/settings/naming-restrictions?view=azure-devops#azure-repos-git

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just double checked and periods (.) & underscores (_) are within the URL so will work so think it's just the spaces

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.

[Beta] AzureCommentReporter fails when target repo contains spaces
2 participants