Skip to content

gitlab supportedDomain modifies the domain name and returns an url  #175

Open
@enekofb

Description

@enekofb

Describe the bug

Gitlab SupportedDomain function implementation
returns a URL which seems to be breaking the SupportedDomain contract

It also updates the field overwriting the original value

To Reproduce

Create a test case like the following

	clientOptions := []gitprovider.ClientOption{}

	clientOptions = append(clientOptions, gitprovider.WithDomain("gitlab.git.xx"))

	c, err := gitlab.NewClient(os.Getenv("GITLAB_ENTERPRISE_TOKEN"), "", clientOptions...)
	checkErr(err)
	log.Printf("client supported domain: %s", c.SupportedDomain())

it will output a domain name value which is an URL

2022/12/28 22:44:08 client supported domain: https://gitlab.git.xx```

<!--
Steps to reproduce the behaviour
-->

### Expected behavior

A clear and concise description of what you expected to happen.

Given the previous example, I would expect to return a domain name instead of a url

```bash
2022/12/28 22:44:08 client supported domain: gitlab.git.xx```

### Additional context

- Go version: go version go1.19.1 darwin/arm64
- Git provider: gitlab

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggitlabGitlab related issues and PRs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions