UserRepositories().Create() returns a UserRepository and the URL for the repository can be gotten by calling GetCloneUrl on the repository ref. A different URL from the created repository is gotten when the wrong string is set as UserLogin. This is because it makes a create request to the API (which doesn't need the UserLogin) and it succeeds. It then uses what's set as UserLogin to construct the URL string which is different from what is returned from the API (edited)
This causes this issue https://github.com/fluxcd/flux2/issues/3867 in flux2 when a user sets the personal flag when creating an org repository. While this is a user error, the output from Flux isn't helpful since it creates a repository and tries to clone a different one.
To Reproduce
Call UserRepositories().Create() and pass a UserRef.UserLogin that is wrong.
Expected behavior
Create should return the URL of the repository that it created.
Describe the bug
UserRepositories().Create()
returns aUserRepository
and the URL for the repository can be gotten by callingGetCloneUrl
on the repository ref. A different URL from the created repository is gotten when the wrong string is set as UserLogin. This is because it makes a create request to the API (which doesn't need the UserLogin) and it succeeds. It then uses what's set as UserLogin to construct the URL string which is different from what is returned from the API (edited)This causes this issue https://github.com/fluxcd/flux2/issues/3867 in flux2 when a user sets the personal flag when creating an org repository. While this is a user error, the output from Flux isn't helpful since it creates a repository and tries to clone a different one.
To Reproduce
Call
UserRepositories().Create()
and pass aUserRef.UserLogin
that is wrong.Expected behavior
Create should return the URL of the repository that it created.
Additional context