You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
is not being set correctly, likely because there is no public field in the JSON response any more? Hence, it is always false for all projects, irrespective of their visibility.
To reproduce:
Create a test private project
Create a test public project
Run:
package main
import (
"log"
"os"
"[github.com/xanzy/go-gitlab](http://github.com/xanzy/go-gitlab)"
)
func main() {
git, err := gitlab.NewClient(os.Getenv("GITLAB_TOKEN"))
if err != nil {
log.Fatal(err)
}
opts := gitlab.ListProjectsOptions{
Owned: gitlab.Bool(true),
}
projects, _, err := git.Projects.ListProjects(&opts)
if err != nil {
log.Fatal(err)
}
for _, p := range projects {
log.Printf("%v -> visibility: %v -> public: %v\n",
p.PathWithNamespace, p.Visibility, p.Public)
}
}
You will see Public is always false. Happy to create a PR as well.
The text was updated successfully, but these errors were encountered:
Guess a quick check with the docs or GitLab codebase would be good... And also make sure it's not used in older versions (as we still like to be able to support those as well).
This field was present in the first release of this repo in 2015. Looking through the GitLab codebase, it was removed from the API in this merge request back in 2017 https://gitlab.com/gitlab-org/gitlab/-/merge_requests/1267/diffs which was around version 9.0 of GitLab.
I believe
go-gitlab/projects.go
Line 43 in f484355
public
field in the JSON response any more? Hence, it is alwaysfalse
for all projects, irrespective of their visibility.To reproduce:
Run:
You will see
Public
is alwaysfalse
. Happy to create a PR as well.The text was updated successfully, but these errors were encountered: