-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 repo names for Bitbucket (Server) #20264
base: main
Are you sure you want to change the base?
Conversation
@@ -285,7 +285,7 @@ export class BitbucketServerContextParser extends AbstractContextParser implemen | |||
defaultBranch: BitbucketServer.Branch, | |||
): Repository { | |||
const owner = repo.project.owner ? repo.project.owner.slug : repo.project.key; | |||
const name = repo.name; | |||
const name = repo.slug; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the fix for the BBS bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking forward to removing more of these in the future, but removed this one here because of the slug
removals preventing compilation of this one.
Description
I was looking into ENT-724 and stumbled upon a bug with Bitbucket Server: when we resolve the context of a BBS URL, we take the
.name
from the response and use that for subsequent API requests as part of the URL (fetch/{user}/{name}/resource
). The problem is that.name
is actually the human-readable label for repositories and not the URL part, so we needed to swap it with.slug
to prevent these issues from happening.Additionally, when I was already changing names to slugs, I figured we could use the display name when importing repositories. Thus, I introduced
displayName
on the generalRepository
interface to let compatible providers (BB and BBS AFAIK) feed us with something more human-readable for our default configuration names.Furthermore, I removed
slug
fromCreateProjectParams
as we didn't use it anywhere and don't expose that to anyone.Fixes ENT-850
How to test
Import the following repos and check out their default names:
Wassup homies
)Spring Petclinic
)Check out the tests for a conclusive update in behavior. You need a bunch of setup and config for tests to work, so these are the results I can share when running against b7c832f: