diff --git a/Makefile b/Makefile index 92bfc1e..8e1b2ee 100644 --- a/Makefile +++ b/Makefile @@ -207,7 +207,6 @@ test_lib: ##@test Run lib tests _test_lib: @echo "${YELLOW}Running lib tests${RESET}" - @${MAKE} ensure_wiremock_is_up --no-print-directory @go test -v ${TESTS_OPTS} ./gitlab/. @echo "${GREEN}✔ Lib tests successfully passed${RESET}\n" diff --git a/README.md b/README.md index cd2f4e8..6bfa9de 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,18 @@ Visit the docs at http://godoc.org/github.com/plouc/go-gitlab-client/gitlab - [x] Single user - [x] Current user +#### SSH Keys + +[gitlab api doc](http://api.gitlab.org/users.html#list-ssh-keys) + +- [x] List SSH keys +- [x] List SSH keys for user +- [x] Single SSH key +- [x] Add SSH key +- [x] Add SSH key for user +- [x] Delete SSH key for current user +- [x] Delete SSH key for given user + #### Groups [gitlab api doc](https://docs.gitlab.com/ce/api/groups.html) diff --git a/cli/cmd/get_project_badge.go b/cli/cmd/get_project_badge.go index 07c4a64..43ae78d 100644 --- a/cli/cmd/get_project_badge.go +++ b/cli/cmd/get_project_badge.go @@ -3,6 +3,7 @@ package cmd import ( "github.com/fatih/color" "github.com/spf13/cobra" + "strconv" ) func init() { @@ -19,10 +20,15 @@ var getProjectBadgeCmd = &cobra.Command{ return err } - color.Yellow("Fetching project's badge (project id: %s, badge id: %s)…", ids["project_id"], ids["badge_id"]) + badgeId, err := strconv.Atoi(ids["badge_id"]) + if err != nil { + return err + } + + color.Yellow("Fetching project's badge (project id: %s, badge id: %s)…", ids["project_id"], badgeId) loader.Start() - badge, meta, err := client.ProjectBadge(ids["project_id"], ids["badge_id"]) + badge, meta, err := client.ProjectBadge(ids["project_id"], badgeId) loader.Stop() if err != nil { return err diff --git a/cli/cmd/ls_ssh_keys.go b/cli/cmd/ls_ssh_keys.go new file mode 100644 index 0000000..812095e --- /dev/null +++ b/cli/cmd/ls_ssh_keys.go @@ -0,0 +1,48 @@ +package cmd + +import ( + "fmt" + + "github.com/fatih/color" + "github.com/plouc/go-gitlab-client/gitlab" + "github.com/spf13/cobra" +) + +func init() { + lsCmd.AddCommand(lsSshKeysCmd) +} + +func fetchSshKeys() { + color.Yellow("Fetching current user ssh keys…") + + o := &gitlab.PaginationOptions{} + o.Page = page + o.PerPage = perPage + + loader.Start() + keys, meta, err := client.CurrentUserSshKeys(o) + loader.Stop() + if err != nil { + fmt.Println(err.Error()) + return + } + + if len(keys) == 0 { + color.Red("No ssh key found") + } else { + sshKeysOutput(keys) + } + + metaOutput(meta, true) + + handlePaginatedResult(meta, fetchSshKeys) +} + +var lsSshKeysCmd = &cobra.Command{ + Use: "ssh-keys", + Aliases: []string{"sk"}, + Short: "List current user ssh keys", + Run: func(cmd *cobra.Command, args []string) { + fetchSshKeys() + }, +} diff --git a/cli/cmd/ls_user_ssh_keys.go b/cli/cmd/ls_user_ssh_keys.go new file mode 100644 index 0000000..f5363c4 --- /dev/null +++ b/cli/cmd/ls_user_ssh_keys.go @@ -0,0 +1,63 @@ +package cmd + +import ( + "fmt" + + "github.com/fatih/color" + "github.com/plouc/go-gitlab-client/gitlab" + "github.com/spf13/cobra" + "strconv" +) + +func init() { + lsCmd.AddCommand(lsUserSshKeysCmd) +} + +func fetchUserSshKeys(userId int) { + color.Yellow("Fetching user %d ssh keys…", userId) + + o := &gitlab.PaginationOptions{} + o.Page = page + o.PerPage = perPage + + loader.Start() + keys, meta, err := client.CurrentUserSshKeys(o) + loader.Stop() + if err != nil { + fmt.Println(err.Error()) + return + } + + if len(keys) == 0 { + color.Red("No ssh key found for user: %d", userId) + } else { + sshKeysOutput(keys) + } + + metaOutput(meta, true) + + handlePaginatedResult(meta, func() { + fetchUserSshKeys(userId) + }) +} + +var lsUserSshKeysCmd = &cobra.Command{ + Use: resourceCmd("user-ssh-keys", "user"), + Aliases: []string{"usk"}, + Short: "List specific user ssh keys", + RunE: func(cmd *cobra.Command, args []string) error { + ids, err := config.aliasIdsOrArgs(currentAlias, "user", args) + if err != nil { + return err + } + + userId, err := strconv.Atoi(ids["user_id"]) + if err != nil { + return err + } + + fetchUserSshKeys(userId) + + return nil + }, +} diff --git a/cli/cmd/output_ssh_keys.go b/cli/cmd/output_ssh_keys.go new file mode 100644 index 0000000..0652cf5 --- /dev/null +++ b/cli/cmd/output_ssh_keys.go @@ -0,0 +1,36 @@ +package cmd + +import ( + "fmt" + + "github.com/olekukonko/tablewriter" + "github.com/plouc/go-gitlab-client/gitlab" +) + +func sshKeysOutput(keys []*gitlab.SshKey) { + if outputFormat == "json" { + jsonOutput(keys) + } else if outputFormat == "yaml" { + yamlOutput(keys) + } else { + fmt.Fprintln(output, "") + table := tablewriter.NewWriter(output) + table.SetHeader([]string{ + "Id", + "Title", + "Key", + "Created at", + }) + table.SetBorders(tablewriter.Border{Left: true, Top: false, Right: true, Bottom: false}) + for _, key := range keys { + table.Append([]string{ + fmt.Sprintf("%d", key.Id), + key.Title, + key.Key[:16] + "…", + key.CreatedAtRaw, + }) + } + table.Render() + fmt.Fprintln(output, "") + } +} diff --git a/docker-compose.yml b/docker-compose.yml index f845a28..e62fafb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,13 @@ version: '2' + services: + wiremock: image: ${WIREMOCK_IMAGE} entrypoint: java -Xms512M -Xmx1024M -jar wiremock.jar volumes: - - ${PWD}/mocks/__files:/wiremock/__files - - ${PWD}/mocks/mappings:/wiremock/mappings + - ${PWD}/mocks/__files:/wiremock/__files:cached + - ${PWD}/mocks/mappings:/wiremock/mappings:cached ports: - 8080:8080 @@ -14,7 +16,8 @@ services: command: /bin/sh -c "while [ 1 ]; do sleep 3600; done" working_dir: /go/src/${GO_PKG_SRC_PATH} volumes: - - ${PWD}/gitlab:/go/src/${GO_PKG_SRC_PATH}/gitlab - - ${PWD}/cli:/go/src/${GO_PKG_SRC_PATH}/cli - - ${PWD}/integration:/go/src/${GO_PKG_SRC_PATH}/integration - - ${PWD}/Makefile:/go/src/${GO_PKG_SRC_PATH}/Makefile \ No newline at end of file + - ${PWD}/gitlab:/go/src/${GO_PKG_SRC_PATH}/gitlab:consistent + - ${PWD}/cli:/go/src/${GO_PKG_SRC_PATH}/cli:consistent + - ${PWD}/integration:/go/src/${GO_PKG_SRC_PATH}/integration:consistent + - ${PWD}/Makefile:/go/src/${GO_PKG_SRC_PATH}/Makefile:consistent + - ${PWD}/mocks:/go/src/${GO_PKG_SRC_PATH}/mocks:cached diff --git a/gitlab/badges.go b/gitlab/badges.go index 68be8ef..6a108d7 100644 --- a/gitlab/badges.go +++ b/gitlab/badges.go @@ -2,6 +2,7 @@ package gitlab import ( "encoding/json" + "strconv" ) const ( @@ -31,10 +32,10 @@ func (g *Gitlab) ProjectBadges(projectId string, o *PaginationOptions) ([]*Badge return badges, meta, err } -func (g *Gitlab) ProjectBadge(projectId, badgeId string) (*Badge, *ResponseMeta, error) { +func (g *Gitlab) ProjectBadge(projectId string, badgeId int) (*Badge, *ResponseMeta, error) { u := g.ResourceUrl(ProjectBadgeApiPath, map[string]string{ ":id": projectId, - ":badge_id": badgeId, + ":badge_id": strconv.Itoa(badgeId), }) badge := new(Badge) diff --git a/gitlab/badges_test.go b/gitlab/badges_test.go new file mode 100644 index 0000000..818255d --- /dev/null +++ b/gitlab/badges_test.go @@ -0,0 +1,36 @@ +package gitlab + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestProjectBadges(t *testing.T) { + ts, gitlab := mockServerFromMapping(t, "badges/project_1_badges.json") + defer ts.Close() + + badges, meta, err := gitlab.ProjectBadges("1", nil) + + assert.NoError(t, err) + + assert.Equal(t, 5, len(badges)) + + assert.IsType(t, new(ResponseMeta), meta) + assert.Equal(t, 1, meta.Page) + assert.Equal(t, 10, meta.PerPage) +} + +func TestProjectBadge(t *testing.T) { + ts, gitlab := mockServerFromMapping(t, "badges/project_1_badge_1.json") + defer ts.Close() + + badge, meta, err := gitlab.ProjectBadge("1", 1) + + assert.NoError(t, err) + + assert.IsType(t, new(Badge), badge) + assert.Equal(t, 1, badge.Id) + + assert.IsType(t, new(ResponseMeta), meta) +} diff --git a/gitlab/branches_test.go b/gitlab/branches_test.go new file mode 100644 index 0000000..056c1b3 --- /dev/null +++ b/gitlab/branches_test.go @@ -0,0 +1,22 @@ +package gitlab + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestProjectBranches(t *testing.T) { + ts, gitlab := mockServerFromMapping(t, "branches/project_1_branches.json") + defer ts.Close() + + branches, meta, err := gitlab.ProtectedBranches("1", nil) + + assert.NoError(t, err) + + assert.Equal(t, 10, len(branches)) + + assert.IsType(t, new(ResponseMeta), meta) + assert.Equal(t, 1, meta.Page) + assert.Equal(t, 10, meta.PerPage) +} diff --git a/gitlab/deploy_keys.go b/gitlab/deploy_keys.go index 769e3ed..0ae554a 100644 --- a/gitlab/deploy_keys.go +++ b/gitlab/deploy_keys.go @@ -20,10 +20,10 @@ Parameters: id The ID of a project */ -func (g *Gitlab) ProjectDeployKeys(id string) ([]*PublicKey, *ResponseMeta, error) { +func (g *Gitlab) ProjectDeployKeys(id string) ([]*SshKey, *ResponseMeta, error) { u := g.ResourceUrl(ProjectDeployKeysApiPath, map[string]string{":id": id}) - var deployKeys []*PublicKey + var deployKeys []*SshKey contents, meta, err := g.buildAndExecRequest("GET", u.String(), nil) if err == nil { @@ -44,13 +44,13 @@ Parameters: keyId The ID of a key */ -func (g *Gitlab) ProjectDeployKey(id, keyId string) (*PublicKey, *ResponseMeta, error) { +func (g *Gitlab) ProjectDeployKey(id, keyId string) (*SshKey, *ResponseMeta, error) { u := g.ResourceUrl(ProjectDeployKeyApiPath, map[string]string{ ":id": id, ":key_id": keyId, }) - var deployKey *PublicKey + var deployKey *SshKey contents, meta, err := g.buildAndExecRequest("GET", u.String(), nil) if err == nil { diff --git a/gitlab/stale_tests/groups_test.go b/gitlab/groups_test.go similarity index 92% rename from gitlab/stale_tests/groups_test.go rename to gitlab/groups_test.go index a105768..ca69429 100644 --- a/gitlab/stale_tests/groups_test.go +++ b/gitlab/groups_test.go @@ -1,4 +1,4 @@ -package stale_tests +package gitlab import ( "testing" @@ -7,19 +7,26 @@ import ( ) func TestGroups(t *testing.T) { - ts, gitlab := Stub("stubs/groups/index.json") + ts, gitlab := mockServerFromMapping(t, "groups/groups.json") defer ts.Close() - groups, err := gitlab.Groups() + groups, meta, err := gitlab.Groups(nil) assert.NoError(t, err) + assert.Equal(t, len(groups), 2) assert.Equal(t, groups[0].Id, 1) assert.Equal(t, groups[0].Name, "Foobar Group") assert.Equal(t, groups[0].Path, "foo-bar") assert.Equal(t, groups[1].ParentId, 1) assert.Equal(t, groups[1].FullPath, "foo-bar/another") + + assert.IsType(t, new(ResponseMeta), meta) + assert.Equal(t, 1, meta.Page) + assert.Equal(t, 10, meta.PerPage) } + +/* func TestGroup(t *testing.T) { ts, gitlab := Stub("stubs/groups/show.json") defer ts.Close() @@ -110,3 +117,4 @@ func TestGroupMembers(t *testing.T) { assert.Equal(t, members[1].State, "active") assert.Equal(t, members[1].CreatedAt, "2012-10-22T14:13:35Z") } +*/ diff --git a/gitlab/helper_test.go b/gitlab/helper_test.go index 7f8d031..1b7bba3 100644 --- a/gitlab/helper_test.go +++ b/gitlab/helper_test.go @@ -1,29 +1,96 @@ package gitlab import ( + "encoding/json" "io/ioutil" "net/http" "net/http/httptest" + "path/filepath" + "runtime" + "testing" ) -const testsHost = "http://wiremock:8080" +const mocksDir = "mocks" +const mocksMappingsDir = "mappings" +const mocksFilesDir = "__files" -func Stub(filename string) (*httptest.Server, *Gitlab) { - var err error +type mockMapping struct { + Request struct { + Url string `json:"url"` + Method string `json:"method"` + } `json:"request"` + Response struct { + Status int `json:"status"` + BodyFileName string `json:"bodyFileName"` + Headers map[string]string `json:"headers"` + } `json:"response"` +} - stub := []byte("") +type responseMock struct { + mapping *mockMapping + body []byte +} - if len(filename) > 0 { - stub, err = ioutil.ReadFile(filename) +func loadResponseMock(t *testing.T, mappingFile string) *responseMock { + t.Helper() - if err != nil { - panic(err) - } + _, currentFilename, _, ok := runtime.Caller(0) + if !ok { + t.Errorf("unable to determine caller") + t.FailNow() + return nil + } + + baseDir, err := filepath.Abs(filepath.Join(filepath.Dir(currentFilename), "..")) + if err != nil { + t.Errorf("unable to determine base dir from %s\n%v", currentFilename, err) + t.FailNow() + return nil + } + + mappingFilePath := filepath.Join(baseDir, mocksDir, mocksMappingsDir, mappingFile) + mappingRaw, err := ioutil.ReadFile(mappingFilePath) + if err != nil { + t.Errorf("unable to load mock mapping file: %s\n%v", mappingFilePath, err) + t.FailNow() + return nil + } + + mapping := new(mockMapping) + err = json.Unmarshal(mappingRaw, &mapping) + if err != nil { + t.Errorf("unable to unmarshal mock mapping file: %s\n%v\n\ncontent:\n%s", mappingFilePath, err, mappingRaw) + t.FailNow() + return nil } - ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte(stub)) - })) + bodyFilePath := filepath.Join(baseDir, mocksDir, mocksFilesDir, mapping.Response.BodyFileName) + body, err := ioutil.ReadFile(bodyFilePath) + if err != nil { + t.Errorf("unable to load mock body file: %s\n%v", bodyFilePath, err) + t.FailNow() + return nil + } + + return &responseMock{ + mapping: mapping, + body: body, + } +} + +func mockServerFromMapping(t *testing.T, mappingFile string) (*httptest.Server, *Gitlab) { + mock := loadResponseMock(t, mappingFile) + + handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + for k, v := range mock.mapping.Response.Headers { + w.Header().Add(k, v) + } + + w.WriteHeader(mock.mapping.Response.Status) + w.Write([]byte(mock.body)) + }) + + ts := httptest.NewServer(handler) gitlab := NewGitlab(ts.URL, "", "") return ts, gitlab diff --git a/gitlab/stale_tests/commits_test.go b/gitlab/legacy_tests/commits_test.go similarity index 98% rename from gitlab/stale_tests/commits_test.go rename to gitlab/legacy_tests/commits_test.go index e5c8729..2c55949 100644 --- a/gitlab/stale_tests/commits_test.go +++ b/gitlab/legacy_tests/commits_test.go @@ -1,4 +1,4 @@ -package stale_tests +package legacy_tests import ( "testing" diff --git a/gitlab/stale_tests/hooks_test.go b/gitlab/legacy_tests/hooks_test.go similarity index 98% rename from gitlab/stale_tests/hooks_test.go rename to gitlab/legacy_tests/hooks_test.go index b8114d7..94bf614 100644 --- a/gitlab/stale_tests/hooks_test.go +++ b/gitlab/legacy_tests/hooks_test.go @@ -1,4 +1,4 @@ -package stale_tests +package legacy_tests import ( "github.com/stretchr/testify/assert" diff --git a/gitlab/stale_tests/issue_test.go b/gitlab/legacy_tests/issues_test.go similarity index 97% rename from gitlab/stale_tests/issue_test.go rename to gitlab/legacy_tests/issues_test.go index 31f145c..4796f3d 100644 --- a/gitlab/stale_tests/issue_test.go +++ b/gitlab/legacy_tests/issues_test.go @@ -1,4 +1,4 @@ -package stale_tests +package legacy_tests import ( "testing" diff --git a/gitlab/stale_tests/public_keys_test.go b/gitlab/legacy_tests/public_keys_test.go similarity index 98% rename from gitlab/stale_tests/public_keys_test.go rename to gitlab/legacy_tests/public_keys_test.go index 0cdf260..465dc3c 100644 --- a/gitlab/stale_tests/public_keys_test.go +++ b/gitlab/legacy_tests/public_keys_test.go @@ -1,4 +1,4 @@ -package stale_tests +package legacy_tests import ( "github.com/stretchr/testify/assert" diff --git a/gitlab/stale_tests/repositories_test.go b/gitlab/legacy_tests/repositories_test.go similarity index 98% rename from gitlab/stale_tests/repositories_test.go rename to gitlab/legacy_tests/repositories_test.go index 6fa7a28..baa8a30 100644 --- a/gitlab/stale_tests/repositories_test.go +++ b/gitlab/legacy_tests/repositories_test.go @@ -1,4 +1,4 @@ -package stale_tests +package legacy_tests import ( "github.com/stretchr/testify/assert" diff --git a/gitlab/members.go b/gitlab/members.go index 3b25420..8a25df6 100644 --- a/gitlab/members.go +++ b/gitlab/members.go @@ -11,14 +11,13 @@ const ( type Member struct { Id int `json:"id"` - Username string `json:"username"` Name string `json:"name"` + Username string `json:"username"` State string `json:"state"` AvatarUrl string `json:"avatar_url"` WebUrl string `json:"web_url"` - CreatedAt string `json:"created_at"` - ExpiresAt string `json:"expires_at"` AccessLevel int `json:"access_level"` + ExpiresAt string `json:"expires_at"` } type MembersOptions struct { diff --git a/gitlab/members_test.go b/gitlab/members_test.go new file mode 100644 index 0000000..b5d88e3 --- /dev/null +++ b/gitlab/members_test.go @@ -0,0 +1,37 @@ +package gitlab + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestProjectMembers(t *testing.T) { + ts, gitlab := mockServerFromMapping(t, "members/project_1_members.json") + defer ts.Close() + + members, meta, err := gitlab.ProjectMembers("1", nil) + + assert.NoError(t, err) + + assert.Equal(t, 10, len(members)) + + assert.IsType(t, new(ResponseMeta), meta) + assert.Equal(t, 1, meta.Page) + assert.Equal(t, 10, meta.PerPage) +} + +func TestGroupMembers(t *testing.T) { + ts, gitlab := mockServerFromMapping(t, "members/group_1_members.json") + defer ts.Close() + + members, meta, err := gitlab.GroupMembers("1", nil) + + assert.NoError(t, err) + + assert.Equal(t, 10, len(members)) + + assert.IsType(t, new(ResponseMeta), meta) + assert.Equal(t, 1, meta.Page) + assert.Equal(t, 10, meta.PerPage) +} diff --git a/gitlab/merge_requests.go b/gitlab/merge_requests.go index fe59952..67c3380 100644 --- a/gitlab/merge_requests.go +++ b/gitlab/merge_requests.go @@ -121,67 +121,60 @@ const ( type MergeRequestsOptions struct { PaginationOptions + SortOptions // Return the request having the given iid // only available for generic merge requests API endpoint - iids []int + Iids []int `url:"iids,omitempty,comma"` // Return all merge requests or just those that are // opened, closed, locked, or merged - State string - - // Return merge requests ordered by created_at or - // updated_at fields. Default is created_at - OrderBY string - - // sort string no Return requests sorted in asc or desc order - // Default is desc - Sort string + State string `url:"state,omitempty"` // Return merge requests for a specific milestone - Milestone string + Milestone string `url:"milestone,omitempty"` // If simple, returns the iid, URL, title, description, // and basic state of merge request - View string + View string `url:"view,omitempty"` // Return merge requests matching a comma separated // list of labels - Labels []string + Labels []string `url:"labels,omitempty,comma"` // Return merge requests created on or after the given time - CreatedAfter *time.Time + CreatedAfter *time.Time `url:"created_after,omitempty"` // Return merge requests created on or before the given time - CreatedBefore *time.Time + CreatedBefore *time.Time `url:"created_before,omitempty"` // Return merge requests updated on or after the given time - UpdatedAfter *time.Time + UpdatedAfter *time.Time `url:"updated_after,omitempty"` // Return merge requests updated on or before the given time - UpdatedBefore *time.Time + UpdatedBefore *time.Time `url:"updated_before,omitempty"` // Return merge requests with the given source branch - SourceBranch string + SourceBranch string `url:"source_branch,omitempty"` // Return merge requests with the given target branch - TargetBranch string + TargetBranch string `url:"target_branch,omitempty"` // Search merge requests against their title and description - Search string + Search string `url:"search,omitempty"` // Returns merge requests created by the given user id - AuthorId int + AuthorId int `url:"author_id,omitempty"` // Returns merge requests assigned to the given user id - AssigneeId int + AssigneeId int `url:"assignee_id,omitempty"` // Return merge requests reacted by the authenticated user by the given emoji - MyReactionEmoji string + MyReactionEmoji string `url:"my_reaction_emoji,omitempty"` // Return merge requests for the given scope: created_by_me, assigned_to_me or all, // For versions before 11.0, use the now deprecated created-by-me or assigned-to-me scopes instead. - Scope MergeRequestScope + Scope MergeRequestScope `url:"scope,omitempty"` } func (g *Gitlab) getMergeRequests(u *url.URL) ([]*MergeRequest, *ResponseMeta, error) { diff --git a/gitlab/stale_tests/merge_requests_test.go b/gitlab/merge_requests_test.go similarity index 64% rename from gitlab/stale_tests/merge_requests_test.go rename to gitlab/merge_requests_test.go index fa04af6..c843390 100644 --- a/gitlab/stale_tests/merge_requests_test.go +++ b/gitlab/merge_requests_test.go @@ -1,4 +1,4 @@ -package stale_tests +package gitlab import ( "testing" @@ -6,15 +6,52 @@ import ( "github.com/stretchr/testify/assert" ) +func TestMergeRequests(t *testing.T) { + ts, gitlab := mockServerFromMapping(t, "merge_requests/merge_requests.json") + defer ts.Close() + + mergeRequests, meta, err := gitlab.MergeRequests(nil) + + assert.NoError(t, err) + + assert.Equal(t, 10, len(mergeRequests)) + + assert.IsType(t, new(ResponseMeta), meta) + assert.Equal(t, 1, meta.Page) + assert.Equal(t, 10, meta.PerPage) +} + func TestProjectMergeRequests(t *testing.T) { - ts, gitlab := Stub("stubs/merge_requests/index.json") - mrs, err := gitlab.ProjectMergeRequests("3", nil) + ts, gitlab := mockServerFromMapping(t, "merge_requests/project_merge_requests.json") + defer ts.Close() + + mergeRequests, meta, err := gitlab.ProjectMergeRequests("1", nil) assert.NoError(t, err) - assert.Equal(t, len(mrs), 1) + + assert.Equal(t, 10, len(mergeRequests)) + + assert.IsType(t, new(ResponseMeta), meta) + assert.Equal(t, 1, meta.Page) + assert.Equal(t, 10, meta.PerPage) +} + +func TestGroupMergeRequests(t *testing.T) { + ts, gitlab := mockServerFromMapping(t, "merge_requests/group_merge_requests.json") defer ts.Close() + + mergeRequests, meta, err := gitlab.GroupMergeRequests(1, nil) + + assert.NoError(t, err) + + assert.Equal(t, 10, len(mergeRequests)) + + assert.IsType(t, new(ResponseMeta), meta) + assert.Equal(t, 1, meta.Page) + assert.Equal(t, 10, meta.PerPage) } +/* func TestProjectMergeRequest(t *testing.T) { ts, gitlab := Stub("stubs/merge_requests/show.json") mr, err := gitlab.ProjectMergeRequest("3", "1") @@ -82,3 +119,4 @@ func TestProjectMergeRequestCancelMerge(t *testing.T) { assert.NoError(t, err) defer ts.Close() } +*/ diff --git a/gitlab/milestones.go b/gitlab/milestones.go index 450f783..c7bb8a7 100644 --- a/gitlab/milestones.go +++ b/gitlab/milestones.go @@ -3,12 +3,14 @@ package gitlab type Milestone struct { Id int `json:"id,omitempty" yaml:"id,omitempty"` Iid int `json:"iid,omitempty" yaml:"iid,omitempty"` - ProjectID int `json:"project_id,omitempty" yaml:"project_id,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` + GroupId int `json:"group_id,omitempty" yaml:"group_id,omitempty"` + ProjectId int `json:"project_id,omitempty" yaml:"project_id,omitempty"` Title string `json:"title,omitempty" yaml:"title,omitempty"` Description string `json:"description,omitempty" yaml:"description,omitempty"` - StartDate string `json:"start_date,omitempty" yaml:"start_date,omitempty"` - DueDate string `json:"due_date,omitempty" yaml:"due_date,omitempty"` + State string `json:"state,omitempty" yaml:"state,omitempty"` UpdatedAt string `json:"updated_at,omitempty" yaml:"updated_at,omitempty"` CreatedAt string `json:"created_at,omitempty" yaml:"created_at,omitempty"` + DueDate string `json:"due_date,omitempty" yaml:"due_date,omitempty"` + StartDate string `json:"start_date,omitempty" yaml:"start_date,omitempty"` + WebUrl string `json:"web_url,omitempty" yaml:"web_url,omitempty"` } diff --git a/gitlab/namespaces_test.go b/gitlab/namespaces_test.go index fe9ad48..9f3b46d 100644 --- a/gitlab/namespaces_test.go +++ b/gitlab/namespaces_test.go @@ -7,27 +7,39 @@ import ( ) func TestNamespaces(t *testing.T) { - ts, gitlab := Stub("stubs/namespaces/all.json") + ts, gitlab := mockServerFromMapping(t, "namespaces/namespaces.json") defer ts.Close() - namespaces, _, err := gitlab.Namespaces(nil) - assert.Equal(t, nil, err) + namespaces, meta, err := gitlab.Namespaces(nil) + + assert.NoError(t, err) + assert.IsType(t, new(Namespace), namespaces[0]) assert.Equal(t, 3, len(namespaces)) assert.Equal(t, 1, namespaces[0].Id) assert.Equal(t, "group1", namespaces[1].Path) + + assert.IsType(t, new(ResponseMeta), meta) + assert.Equal(t, 1, meta.Page) + assert.Equal(t, 10, meta.PerPage) } func TestSearchNamespaces(t *testing.T) { - ts, gitlab := Stub("stubs/namespaces/search.json") + ts, gitlab := mockServerFromMapping(t, "namespaces/namespaces_search.json") defer ts.Close() - namespaces, _, err := gitlab.Namespaces(&NamespacesOptions{ + + namespaces, meta, err := gitlab.Namespaces(&NamespacesOptions{ Search: "twitter", }) assert.NoError(t, err) + assert.IsType(t, new(Namespace), namespaces[0]) assert.Equal(t, 1, len(namespaces)) assert.Equal(t, 4, namespaces[0].Id) assert.Equal(t, "twitter", namespaces[0].Path) + + assert.IsType(t, new(ResponseMeta), meta) + assert.Equal(t, 1, meta.Page) + assert.Equal(t, 10, meta.PerPage) } diff --git a/gitlab/stale_tests/projects_test.go b/gitlab/projects_test.go similarity index 89% rename from gitlab/stale_tests/projects_test.go rename to gitlab/projects_test.go index a917930..602d9b1 100644 --- a/gitlab/stale_tests/projects_test.go +++ b/gitlab/projects_test.go @@ -1,4 +1,4 @@ -package stale_tests +package gitlab import ( "github.com/stretchr/testify/assert" @@ -6,14 +6,21 @@ import ( ) func TestProjects(t *testing.T) { - ts, gitlab := Stub("stubs/projects/index.json") - projects, err := gitlab.Projects() + ts, gitlab := mockServerFromMapping(t, "projects/projects.json") + defer ts.Close() + + projects, meta, err := gitlab.Projects(nil) assert.NoError(t, err) + assert.Equal(t, len(projects), 2) - defer ts.Close() + + assert.IsType(t, new(ResponseMeta), meta) + assert.Equal(t, 1, meta.Page) + assert.Equal(t, 10, meta.PerPage) } +/* func TestProject(t *testing.T) { ts, gitlab := Stub("stubs/projects/show.json") project, err := gitlab.Project("1") @@ -75,3 +82,4 @@ func TestRemoveProject(t *testing.T) { assert.NoError(t, err) assert.Equal(t, result, true) } +*/ diff --git a/gitlab/public_keys.go b/gitlab/public_keys.go deleted file mode 100644 index db39692..0000000 --- a/gitlab/public_keys.go +++ /dev/null @@ -1,94 +0,0 @@ -package gitlab - -import ( - "encoding/json" - "net/url" -) - -const ( - CurrentUserKeysApiPath = "/user/keys" - CurrentUserKeyApiPath = "/user/keys/:id" - UserKeysApiPath = "/users/:id/keys" -) - -type PublicKey struct { - Id int `json:"id,omitempty"` - Title string `json:"title,omitempty"` - Key string `json:"key,omitempty"` - CreatedAtRaw string `json:"created_at,omitempty"` -} - -func (g *Gitlab) UserKeys(userId string) ([]*PublicKey, *ResponseMeta, error) { - u := g.ResourceUrl(UserKeysApiPath, map[string]string{":id": userId}) - - var keys []*PublicKey - - contents, meta, err := g.buildAndExecRequest("GET", u.String(), nil) - if err == nil { - err = json.Unmarshal(contents, &keys) - } - - return keys, meta, err -} - -func (g *Gitlab) CurrentUserKeys() ([]*PublicKey, *ResponseMeta, error) { - u := g.ResourceUrl(CurrentUserKeysApiPath, nil) - - var keys []*PublicKey - - contents, meta, err := g.buildAndExecRequest("GET", u.String(), nil) - if err == nil { - err = json.Unmarshal(contents, &keys) - } - - return keys, meta, err -} - -func (g *Gitlab) CurrentUserKey(id string) (*PublicKey, *ResponseMeta, error) { - u := g.ResourceUrl(CurrentUserKeyApiPath, map[string]string{":id": id}) - - var key *PublicKey - - contents, meta, err := g.buildAndExecRequest("GET", u.String(), nil) - if err == nil { - err = json.Unmarshal(contents, &key) - } - - return key, meta, err -} - -func (g *Gitlab) addKey(u *url.URL, title, key string) (*ResponseMeta, error) { - var err error - - v := url.Values{} - v.Set("title", title) - v.Set("key", key) - - body := v.Encode() - - _, meta, err := g.buildAndExecRequest("POST", u.String(), []byte(body)) - - return meta, err -} - -func (g *Gitlab) AddUserKey(userId, title, key string) (*ResponseMeta, error) { - u := g.ResourceUrl(UserKeysApiPath, map[string]string{":id": userId}) - - return g.addKey(u, title, key) -} - -func (g *Gitlab) AddCurrentUserKey(title, key string) (*ResponseMeta, error) { - u := g.ResourceUrl(CurrentUserKeysApiPath, nil) - - return g.addKey(u, title, key) - -} - -func (g *Gitlab) DeleteCurrentUserKey(id string) error { - u := g.ResourceUrl(CurrentUserKeyApiPath, map[string]string{":id": id}) - - var err error - _, _, err = g.buildAndExecRequest("DELETE", u.String(), nil) - - return err -} diff --git a/gitlab/runners_test.go b/gitlab/runners_test.go index 9fb8d77..c138ff2 100644 --- a/gitlab/runners_test.go +++ b/gitlab/runners_test.go @@ -7,17 +7,20 @@ import ( ) func TestRunners(t *testing.T) { - g := NewGitlab(testsHost, "/api/v4", "") - o := RunnersOptions{} - o.Page = 1 - o.PerPage = 10 - runners, meta, err := g.Runners(&o) + ts, gitlab := mockServerFromMapping(t, "runners/runners.json") + defer ts.Close() + + runners, meta, err := gitlab.Runners(nil) + + assert.NoError(t, err) assert.NotNil(t, runners) - assert.NotNil(t, meta) assert.Equal(t, meta.StatusCode, 200) - assert.NoError(t, err) assert.Equal(t, len(runners), 2) + + assert.IsType(t, new(ResponseMeta), meta) + assert.Equal(t, 1, meta.Page) + assert.Equal(t, 10, meta.PerPage) } /* diff --git a/gitlab/ssh_keys.go b/gitlab/ssh_keys.go new file mode 100644 index 0000000..31e84dc --- /dev/null +++ b/gitlab/ssh_keys.go @@ -0,0 +1,109 @@ +package gitlab + +import ( + "encoding/json" + "net/url" + "strconv" +) + +const ( + CurrentUserSshKeysApiPath = "/user/keys" + UserSshKeysApiPath = "/users/:id/keys" + CurrentUserSshKeyApiPath = "/user/keys/:key_id" + UserSshKeyApiPath = "/user/:id/keys/:key_id" +) + +type SshKey struct { + Id int `json:"id,omitempty" yaml:"id,omitempty"` + Title string `json:"title,omitempty" yaml:"title,omitempty"` + Key string `json:"key,omitempty" yaml:"key,omitempty"` + CreatedAtRaw string `json:"created_at,omitempty" yaml:"created_at,omitempty"` +} + +func (g *Gitlab) getSshKeys(u *url.URL) ([]*SshKey, *ResponseMeta, error) { + var keys []*SshKey + + contents, meta, err := g.buildAndExecRequest("GET", u.String(), nil) + if err == nil { + err = json.Unmarshal(contents, &keys) + } + + return keys, meta, err +} + +func (g *Gitlab) UserSshKeys(userId int, o *PaginationOptions) ([]*SshKey, *ResponseMeta, error) { + u := g.ResourceUrlQ(UserSshKeysApiPath, map[string]string{ + ":id": strconv.Itoa(userId), + }, o) + + return g.getSshKeys(u) +} + +func (g *Gitlab) CurrentUserSshKeys(o *PaginationOptions) ([]*SshKey, *ResponseMeta, error) { + u := g.ResourceUrlQ(CurrentUserSshKeysApiPath, nil, o) + + return g.getSshKeys(u) +} + +func (g *Gitlab) CurrentUserSshKey(id string) (*SshKey, *ResponseMeta, error) { + u := g.ResourceUrl(CurrentUserSshKeyApiPath, map[string]string{":id": id}) + + var key *SshKey + + contents, meta, err := g.buildAndExecRequest("GET", u.String(), nil) + if err == nil { + err = json.Unmarshal(contents, &key) + } + + return key, meta, err +} + +func (g *Gitlab) addSshKey(u *url.URL, title, key string) (*ResponseMeta, error) { + var err error + + v := url.Values{} + v.Set("title", title) + v.Set("key", key) + + body := v.Encode() + + _, meta, err := g.buildAndExecRequest("POST", u.String(), []byte(body)) + + return meta, err +} + +func (g *Gitlab) AddUserSshKey(userId, title, key string) (*ResponseMeta, error) { + u := g.ResourceUrl(UserSshKeysApiPath, map[string]string{":id": userId}) + + return g.addSshKey(u, title, key) +} + +func (g *Gitlab) AddCurrentUserSshKey(title, key string) (*ResponseMeta, error) { + u := g.ResourceUrl(CurrentUserSshKeysApiPath, nil) + + return g.addSshKey(u, title, key) + +} + +func (g *Gitlab) deleteSshKey(u *url.URL) (*ResponseMeta, error) { + _, meta, err := g.buildAndExecRequest("DELETE", u.String(), nil) + + return meta, err +} + +func (g *Gitlab) DeleteCurrentUserSshKey(keyId int) (*ResponseMeta, error) { + u := g.ResourceUrl(CurrentUserSshKeyApiPath, map[string]string{ + ":key_id": strconv.Itoa(keyId), + }) + + return g.deleteSshKey(u) +} + +func (g *Gitlab) DeleteUserSshKey(userId, keyId int) (*ResponseMeta, error) { + u := g.ResourceUrl(UserSshKeyApiPath, map[string]string{ + ":id": strconv.Itoa(userId), + ":key_id": strconv.Itoa(keyId), + }) + + return g.deleteSshKey(u) +} diff --git a/gitlab/ssh_keys_test.go b/gitlab/ssh_keys_test.go new file mode 100644 index 0000000..ef8f368 --- /dev/null +++ b/gitlab/ssh_keys_test.go @@ -0,0 +1,37 @@ +package gitlab + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestCurrentUserSshKeys(t *testing.T) { + ts, gitlab := mockServerFromMapping(t, "ssh_keys/current_user_ssh_keys.json") + defer ts.Close() + + keys, meta, err := gitlab.CurrentUserSshKeys(nil) + + assert.NoError(t, err) + + assert.Equal(t, 3, len(keys)) + + assert.IsType(t, new(ResponseMeta), meta) + assert.Equal(t, 1, meta.Page) + assert.Equal(t, 10, meta.PerPage) +} + +func TestUserSshKeys(t *testing.T) { + ts, gitlab := mockServerFromMapping(t, "ssh_keys/user_1_ssh_keys.json") + defer ts.Close() + + keys, meta, err := gitlab.UserSshKeys(1, nil) + + assert.NoError(t, err) + + assert.Equal(t, 3, len(keys)) + + assert.IsType(t, new(ResponseMeta), meta) + assert.Equal(t, 1, meta.Page) + assert.Equal(t, 10, meta.PerPage) +} diff --git a/gitlab/stale_tests/builds_test.go b/gitlab/stale_tests/builds_test.go deleted file mode 100644 index 1f827e2..0000000 --- a/gitlab/stale_tests/builds_test.go +++ /dev/null @@ -1,33 +0,0 @@ -package stale_tests - -import ( - "github.com/stretchr/testify/assert" - "io/ioutil" - "testing" -) - -func TestProjectCommitBuilds(t *testing.T) { - ts, gitlab := Stub("stubs/builds/commit_builds_list.json") - defer ts.Close() - - builds, err := gitlab.ProjectBuilds("3") - - assert.Nil(t, err) - assert.Equal(t, len(builds), 2) - assert.Equal(t, builds[1].User.AvatarUrl, "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon") -} - -func TestProjectArtifact(t *testing.T) { - ts, gitlab := Stub("stubs/builds/content.txt") - defer ts.Close() - - r, err := gitlab.ProjectBuildArtifacts("3", "12") - - assert.Nil(t, err) - - defer r.Close() - - contents, err := ioutil.ReadAll(r) - - assert.Equal(t, string(contents), "a content") -} diff --git a/gitlab/stale_tests/namespaces_test.go b/gitlab/stale_tests/namespaces_test.go deleted file mode 100644 index c8b5469..0000000 --- a/gitlab/stale_tests/namespaces_test.go +++ /dev/null @@ -1,31 +0,0 @@ -package stale_tests - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestNamespaces(t *testing.T) { - ts, gitlab := Stub("stubs/namespaces/all.json") - defer ts.Close() - namespaces, err := gitlab.Namespaces() - - assert.Equal(t, nil, err) - assert.IsType(t, new(nNamespace), namespaces[0]) - assert.Equal(t, 3, len(namespaces)) - assert.Equal(t, 1, namespaces[0].Id) - assert.Equal(t, "group1", namespaces[1].Path) -} - -func TestSearchNamespaces(t *testing.T) { - ts, gitlab := Stub("stubs/namespaces/search.json") - defer ts.Close() - namespaces, err := gitlab.SearchNamespaces("twitter") - - assert.NoError(t, err) - assert.IsType(t, new(nNamespace), namespaces[0]) - assert.Equal(t, 1, len(namespaces)) - assert.Equal(t, 4, namespaces[0].Id) - assert.Equal(t, "twitter", namespaces[0].Path) -} diff --git a/gitlab/stubs/groups/index.json b/gitlab/stubs/groups/index.json deleted file mode 100644 index 3d4ceaa..0000000 --- a/gitlab/stubs/groups/index.json +++ /dev/null @@ -1,30 +0,0 @@ -[ - { - "id": 1, - "name": "Foobar Group", - "path": "foo-bar", - "description": "An interesting group", - "visibility": "public", - "lfs_enabled": true, - "avatar_url": "http://localhost:3000/uploads/group/avatar/1/foo.jpg", - "web_url": "http://localhost:3000/foo-bar", - "request_access_enabled": false, - "full_name": "Foobar Group", - "full_path": "foo-bar", - "parent_id": null - }, - { - "id": 2, - "name": "Another Group", - "path": "another", - "description": "A not so interesting group", - "visibility": "public", - "lfs_enabled": true, - "avatar_url": "http://localhost:3000/uploads/group/avatar/1/bar.jpg", - "web_url": "http://localhost:3000/foo-bar/another", - "request_access_enabled": false, - "full_name": "Another Group", - "full_path": "foo-bar/another", - "parent_id": 1 - } -] diff --git a/gitlab/stubs/merge_requests/index.json b/gitlab/stubs/merge_requests/index.json deleted file mode 100644 index 27adaab..0000000 --- a/gitlab/stubs/merge_requests/index.json +++ /dev/null @@ -1,33 +0,0 @@ -[ - { - "id": 1, - "iid": 1, - "target_branch": "master", - "source_branch": "test1", - "project_id": 3, - "title": "test1", - "state": "opened", - "created_at": "2016-05-20T13:58:19.283Z", - "updated_at": "2016-05-20T13:58:19.283Z", - "upvotes": 0, - "downvotes": 0, - "author": { - "id": 1, - "username": "admin", - "email": "admin@example.com", - "name": "Administrator", - "state": "active", - "created_at": "2012-04-29T08:46:00Z" - }, - "assignee": { - "id": 1, - "username": "admin", - "email": "admin@example.com", - "name": "Administrator", - "state": "active", - "created_at": "2012-04-29T08:46:00Z" - }, - "description":"fixed login page css paddings", - "work_in_progress": false - } -] \ No newline at end of file diff --git a/gitlab/stubs/namespaces/all.json b/gitlab/stubs/namespaces/all.json deleted file mode 100644 index df70108..0000000 --- a/gitlab/stubs/namespaces/all.json +++ /dev/null @@ -1,18 +0,0 @@ -[ - { - "id": 1, - "path": "user1", - "kind": "user" - }, - { - "id": 2, - "path": "group1", - "kind": "group" - }, - { - "id": 3, - "path": "bar", - "kind": "group", - "full_path": "foo/bar" - } -] diff --git a/gitlab/stubs/namespaces/search.json b/gitlab/stubs/namespaces/search.json deleted file mode 100644 index 266681e..0000000 --- a/gitlab/stubs/namespaces/search.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - { - "id": 4, - "path": "twitter", - "kind": "group", - "full_path": "twitter" - } -] diff --git a/gitlab/stubs/projects/index.json b/gitlab/stubs/projects/index.json deleted file mode 100644 index d1660bf..0000000 --- a/gitlab/stubs/projects/index.json +++ /dev/null @@ -1,74 +0,0 @@ -[ - { - "id": 4, - "description": null, - "default_branch": "master", - "public": false, - "visibility_level": 0, - "ssh_url_to_repo": "git@example.com:diaspora/diaspora-client.git", - "http_url_to_repo": "http://example.com/diaspora/diaspora-client.git", - "web_url": "http://example.com/diaspora/diaspora-client", - "owner": { - "id": 3, - "name": "Diaspora", - "created_at": "2013-09-30T13: 46: 02Z" - }, - "name": "Diaspora Client", - "name_with_namespace": "Diaspora / Diaspora Client", - "path": "diaspora-client", - "path_with_namespace": "diaspora/diaspora-client", - "issues_enabled": true, - "merge_requests_enabled": true, - "wall_enabled": false, - "wiki_enabled": true, - "snippets_enabled": false, - "created_at": "2013-09-30T13: 46: 02Z", - "last_activity_at": "2013-09-30T13: 46: 02Z", - "shared_runners_enabled": true, - "namespace": { - "created_at": "2013-09-30T13: 46: 02Z", - "description": "", - "id": 3, - "name": "Diaspora", - "owner_id": 1, - "path": "diaspora", - "updated_at": "2013-09-30T13: 46: 02Z" - } - }, - { - "id": 6, - "description": null, - "default_branch": "master", - "public": false, - "visibility_level": 0, - "ssh_url_to_repo": "git@example.com:brightbox/puppet.git", - "http_url_to_repo": "http://example.com/brightbox/puppet.git", - "web_url": "http://example.com/brightbox/puppet", - "owner": { - "id": 4, - "name": "Brightbox", - "created_at": "2013-09-30T13:46:02Z" - }, - "name": "Puppet", - "name_with_namespace": "Brightbox / Puppet", - "path": "puppet", - "path_with_namespace": "brightbox/puppet", - "issues_enabled": true, - "merge_requests_enabled": true, - "wall_enabled": false, - "wiki_enabled": true, - "snippets_enabled": false, - "created_at": "2013-09-30T13:46:02Z", - "last_activity_at": "2013-09-30T13:46:02Z", - "shared_runners_enabled": false, - "namespace": { - "created_at": "2013-09-30T13:46:02Z", - "description": "", - "id": 4, - "name": "Brightbox", - "owner_id": 1, - "path": "brightbox", - "updated_at": "2013-09-30T13:46:02Z" - } - } -] \ No newline at end of file diff --git a/gitlab/stubs/public_keys/index.json b/gitlab/stubs/public_keys/index.json deleted file mode 100644 index 67a9f47..0000000 --- a/gitlab/stubs/public_keys/index.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - { - "id": 1, - "title": "Public key", - "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=" - }, - { - "id": 3, - "title": "Another Public key", - "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=" - } -] \ No newline at end of file diff --git a/gitlab/stubs/public_keys/show.json b/gitlab/stubs/public_keys/show.json deleted file mode 100644 index ef2868b..0000000 --- a/gitlab/stubs/public_keys/show.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "id": 1, - "title": "Public key", - "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=" -} \ No newline at end of file diff --git a/gitlab/stubs/runners/index.json b/gitlab/stubs/runners/index.json deleted file mode 100644 index b8e5412..0000000 --- a/gitlab/stubs/runners/index.json +++ /dev/null @@ -1,16 +0,0 @@ -[ - { - "active": true, - "description": "test-1-20150125", - "id": 6, - "is_shared": false, - "name": null - }, - { - "active": true, - "description": "test-2-20150125", - "id": 8, - "is_shared": false, - "name": null - } -] diff --git a/gitlab/stubs/users/index.json b/gitlab/stubs/users/index.json deleted file mode 100644 index 5a14aa5..0000000 --- a/gitlab/stubs/users/index.json +++ /dev/null @@ -1,41 +0,0 @@ -[ - { - "id": 1, - "username": "john_smith", - "email": "john@example.com", - "name": "John Smith", - "state": "active", - "created_at": "2012-05-23T08:00:58Z", - "bio": null, - "skype": "", - "linkedin": "", - "twitter": "", - "website_url": "", - "extern_uid": "john.smith", - "provider": "provider_name", - "theme_id": 1, - "color_scheme_id": 2, - "is_admin": false, - "can_create_group": true - }, - { - "id": 2, - "username": "jack_smith", - "email": "jack@example.com", - "name": "Jack Smith", - "state": "blocked", - "created_at": "2012-05-23T08:01:01Z", - "bio": null, - "skype": "", - "linkedin": "", - "twitter": "", - "website_url": "", - "extern_uid": "jack.smith", - "provider": "provider_name", - "theme_id": 1, - "color_scheme_id": 3, - "is_admin": false, - "can_create_group": true, - "can_create_project": true - } -] \ No newline at end of file diff --git a/gitlab/users_test.go b/gitlab/users_test.go index 657c18d..a09203b 100644 --- a/gitlab/users_test.go +++ b/gitlab/users_test.go @@ -6,21 +6,30 @@ import ( ) func TestUsers(t *testing.T) { - ts, gitlab := Stub("stubs/users/index.json") - users, _, err := gitlab.Users(nil) + ts, gitlab := mockServerFromMapping(t, "users/users.json") + defer ts.Close() + + users, meta, err := gitlab.Users(nil) assert.NoError(t, err) + assert.Equal(t, len(users), 2) - defer ts.Close() + + assert.IsType(t, new(ResponseMeta), meta) + assert.Equal(t, 1, meta.Page) + assert.Equal(t, 10, meta.PerPage) } func TestUser(t *testing.T) { - ts, gitlab := Stub("stubs/users/show.json") + ts, gitlab := mockServerFromMapping(t, "users/user_1.json") + defer ts.Close() + user, _, err := gitlab.User("plouc") assert.NoError(t, err) + assert.IsType(t, new(User), user) - assert.Equal(t, user.Id, 6) + assert.Equal(t, user.Id, 1) assert.Equal(t, user.Username, "plouc") assert.Equal(t, user.Name, "Raphaël Benitte") assert.Equal(t, user.Bio, "") @@ -30,9 +39,9 @@ func TestUser(t *testing.T) { assert.Equal(t, user.ThemeId, 2) assert.Equal(t, user.State, "active") assert.Equal(t, user.CreatedAt, "2001-01-01T00:00:00Z") - defer ts.Close() } +/* func TestDeleteUser(t *testing.T) { ts, gitlab := Stub("") _, err := gitlab.RemoveUser("1") @@ -49,3 +58,4 @@ func TestCurrentUser(t *testing.T) { assert.Equal(t, user.Username, "john_smith") defer ts.Close() } +*/ diff --git a/integration/cli_test.go b/integration/cli_test.go index 45bde94..d7b1dc8 100644 --- a/integration/cli_test.go +++ b/integration/cli_test.go @@ -300,6 +300,182 @@ func TestCLI(t *testing.T) { "get_user_yaml", false, }, + + { + "ls ssh keys help", + []string{"ls", "ssh-keys", "-h"}, + configs["default"], + "ls_ssh_keys_help", + false, + }, + { + "ls ssh keys", + []string{"ls", "ssh-keys"}, + configs["default"], + "ls_ssh_keys", + false, + }, + { + "ls ssh keys verbose", + []string{"ls", "ssh-keys", "-v"}, + configs["default"], + "ls_ssh_keys_verbose", + false, + }, + { + "ls ssh keys json", + []string{"ls", "ssh-keys", "-f", "json"}, + configs["default"], + "ls_ssh_keys_json", + false, + }, + { + "ls ssh keys yaml", + []string{"ls", "ssh-keys", "-f", "yaml"}, + configs["default"], + "ls_ssh_keys_yaml", + false, + }, + { + "ls user ssh keys help", + []string{"ls", "user-ssh-keys", "-h"}, + configs["default"], + "ls_user_ssh_keys_help", + false, + }, + { + "ls user ssh keys", + []string{"ls", "user-ssh-keys", "1"}, + configs["default"], + "ls_user_ssh_keys", + false, + }, + { + "ls user ssh keys verbose", + []string{"ls", "user-ssh-keys", "1", "-v"}, + configs["default"], + "ls_user_ssh_keys_verbose", + false, + }, + { + "ls user ssh keys json", + []string{"ls", "user-ssh-keys", "1", "-f", "json"}, + configs["default"], + "ls_user_ssh_keys_json", + false, + }, + { + "ls user ssh keys yaml", + []string{"ls", "user-ssh-keys", "1", "-f", "yaml"}, + configs["default"], + "ls_user_ssh_keys_yaml", + false, + }, + { + "ls merge requests help", + []string{"ls", "merge-requests", "-h"}, + configs["default"], + "ls_merge_requests_help", + false, + }, + { + "ls merge requests", + []string{"ls", "merge-requests"}, + configs["default"], + "ls_merge_requests", + false, + }, + { + "ls merge requests verbose", + []string{"ls", "merge-requests", "-v"}, + configs["default"], + "ls_merge_requests_verbose", + false, + }, + { + "ls merge requests json", + []string{"ls", "merge-requests", "-f", "json"}, + configs["default"], + "ls_merge_requests_json", + false, + }, + { + "ls merge requests yaml", + []string{"ls", "merge-requests", "-f", "yaml"}, + configs["default"], + "ls_merge_requests_yaml", + false, + }, + { + "ls project merge requests help", + []string{"ls", "project-merge-requests", "-h"}, + configs["default"], + "ls_project_merge_requests_help", + false, + }, + { + "ls project merge requests", + []string{"ls", "project-merge-requests", "1"}, + configs["default"], + "ls_project_merge_requests", + false, + }, + { + "ls project merge requests verbose", + []string{"ls", "project-merge-requests", "1", "-v"}, + configs["default"], + "ls_project_merge_requests_verbose", + false, + }, + { + "ls project merge requests json", + []string{"ls", "project-merge-requests", "1", "-f", "json"}, + configs["default"], + "ls_project_merge_requests_json", + false, + }, + { + "ls project merge requests yaml", + []string{"ls", "project-merge-requests", "1", "-f", "yaml"}, + configs["default"], + "ls_project_merge_requests_yaml", + false, + }, + { + "ls group merge requests help", + []string{"ls", "group-merge-requests", "-h"}, + configs["default"], + "ls_group_merge_requests_help", + false, + }, + { + "ls group merge requests", + []string{"ls", "group-merge-requests", "1"}, + configs["default"], + "ls_group_merge_requests", + false, + }, + { + "ls group merge requests verbose", + []string{"ls", "group-merge-requests", "1", "-v"}, + configs["default"], + "ls_group_merge_requests_verbose", + false, + }, + { + "ls group merge requests json", + []string{"ls", "group-merge-requests", "1", "-f", "json"}, + configs["default"], + "ls_group_merge_requests_json", + false, + }, + { + "ls group merge requests yaml", + []string{"ls", "group-merge-requests", "1", "-f", "yaml"}, + configs["default"], + "ls_group_merge_requests_yaml", + false, + }, } ctx := gosnap.NewContext(t, snapshotsDir) diff --git a/integration/snapshots/ls_group_merge_requests.snap b/integration/snapshots/ls_group_merge_requests.snap new file mode 100644 index 0000000..c9eadc5 --- /dev/null +++ b/integration/snapshots/ls_group_merge_requests.snap @@ -0,0 +1,29 @@ +Fetching group 1 merge requests… + +| PROJECT ID | ID | TITLE | SOURCE | TARGET | STATE | ASSIGNEE | WIP | MERGE STATUS | CREATED AT | ++------------+----------+--------------------------------+----------------------------------------------------------------+--------+--------+---------------+-------+------------------+--------------------------+ +| 13083 | 13932943 | WIP: Fix autosave issues for | _acet-fix-mr-autosave | master | opened | fatihacet | true | can_be_merged | 2018-07-11T22:39:55.571Z | +| | | MR discussions | | | | | | | | +| 13083 | 13932747 | add initial smoke tests and | qa-smoke-tests | master | opened | meks | false | can_be_merged | 2018-07-11T22:18:59.366Z | +| | | documentation | | | | | | | | +| 13083 | 13931916 | WIP: Resolve "Remove ghost | 44824-remove-ghost-notification-settings-for-group-and-project | master | opened | jacopo-beschi | true | cannot_be_merged | 2018-07-11T21:06:10.653Z | +| | | notification settings for | | | | | | | | +| | | groups and projects" | | | | | | | | +| 13083 | 13929701 | Fix archived parameter for | fix-project-api-archived | master | opened | | false | can_be_merged | 2018-07-11T19:55:40.907Z | +| | | projects API | | | | | | | | +| 13083 | 13929032 | Remove healthchecks from | an/no-healthcheck-until-brooklyn | master | opened | | false | can_be_merged | 2018-07-11T19:08:21.900Z | +| | | prometheus endpoint | | | | | | | | +| 13083 | 13928405 | Revert "Log push output on | mk/remove-push-output-logging | master | opened | rymai | false | can_be_merged | 2018-07-11T18:44:19.250Z | +| | | exception" because it is no | | | | | | | | +| | | longer needed | | | | | | | | +| 13083 | 13927668 | Resolve "Follow-up from | 48690-follow-up-from-milestone-tests | master | opened | rymai | false | can_be_merged | 2018-07-11T18:17:37.205Z | +| | | "Milestone tests"" | | | | | | | | +| 13083 | 13925429 | Fix MR widget border | fix-mr-widget-border | master | merged | filipa | false | can_be_merged | 2018-07-11T17:08:41.143Z | +| 13083 | 13925353 | Resolve "QA: False failure | 48241-fix-invalid-byte-sequence-in-qa | master | opened | rymai | false | can_be_merged | 2018-07-11T17:02:36.349Z | +| | | on QA test "Push to protected | | | | | | | | +| | | branch when allowed" during | | | | | | | | +| | | staging failover rehearsal" | | | | | | | | +| 13083 | 13924879 | Revert "Merge branch | revert-todos-epic | master | merged | yorickpeterse | false | can_be_merged | 2018-07-11T16:34:45.542Z | +| | | 'ee-5481-epic-todos' into | | | | | | | | +| | | 'master'" | | | | | | | | + diff --git a/integration/snapshots/ls_group_merge_requests_help.snap b/integration/snapshots/ls_group_merge_requests_help.snap new file mode 100644 index 0000000..75f8b19 --- /dev/null +++ b/integration/snapshots/ls_group_merge_requests_help.snap @@ -0,0 +1,22 @@ +List group merge requests + +Usage: + glc ls group-merge-requests GROUP_ID [flags] + +Aliases: + group-merge-requests, gmr + +Flags: + -h, --help help for group-merge-requests + +Global Flags: + -a, --alias string Use resource alias + -c, --config string Path to configuration file (default ".glc.yml") + -i, --interactive enable interactive mode when applicable (eg. creation, pagination) + --no-color disable color output + -o, --output-destination string Output result to file if specified + -f, --output-format string Output format, must be one of 'text', 'json', 'yaml' + -p, --page int Page (default 1) + -l, --per-page int Items per page (default 10) + --silent silent mode + -v, --verbose verbose output diff --git a/integration/snapshots/ls_group_merge_requests_json.snap b/integration/snapshots/ls_group_merge_requests_json.snap new file mode 100644 index 0000000..10f2284 --- /dev/null +++ b/integration/snapshots/ls_group_merge_requests_json.snap @@ -0,0 +1,466 @@ +Fetching group 1 merge requests… +[ + { + "id": 13932943, + "iid": 20569, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20569", + "title": "WIP: Fix autosave issues for MR discussions", + "description": "Fixes multiple autosave issues and ESC confirmations around noteable shared components and new MR discussions.\r\n\r\n### Fixes autosave issue in noteable shared components\r\n![_mr-autosave](/uploads/2997c1e1d745ccd70f8ccf6854e86b56/_mr-autosave.gif)\r\n\r\n### Fixes ESC confirmation and autosave issues in reply a discussion form\r\n![_mr-esc-confirm](/uploads/79f7c7aace864ce02bd680099c715fc2/_mr-esc-confirm.gif)\r\n\r\n### Adds ESC confirmation to new discussion form\r\n![_mr-esc-confirm2](/uploads/a4f3b3d41fb3b15db0e1a88f89264622/_mr-esc-confirm2.gif)\r\n\r\n\r\nFixes https://gitlab.com/gitlab-org/gitlab-ce/issues/48876 and https://gitlab.com/gitlab-org/gitlab-ce/issues/48877", + "state": "opened", + "created_at": "2018-07-11T22:39:55.571Z", + "updated_at": "2018-07-11T23:35:44.014Z", + "source_branch": "_acet-fix-mr-autosave", + "target_branch": "master", + "source_project_id": 13083, + "target_project_id": 13083, + "sha": "da788f233de489315e3155f170700c625af352c4", + "work_in_progress": true, + "merge_status": "can_be_merged", + "force_remove_source_branch": true, + "user_notes_count": 1, + "author": { + "id": 502136, + "username": "fatihacet", + "name": "Fatih Acet", + "state": "active", + "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/502136/avatar.png", + "web_url": "https://gitlab.com/fatihacet" + }, + "assignee": { + "id": 502136, + "username": "fatihacet", + "name": "Fatih Acet", + "state": "active", + "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/502136/avatar.png", + "web_url": "https://gitlab.com/fatihacet" + }, + "labels": [ + "Discussion", + "Pick into 11.1", + "bug", + "frontend", + "mr refactor", + "regression", + "reproduced on GitLab.com" + ], + "time_stats": {}, + "milestone": { + "id": 450583, + "iid": 13, + "group_id": 9970, + "title": "11.1", + "state": "active", + "updated_at": "2018-03-01T19:52:29.776Z", + "created_at": "2018-01-23T21:40:27.318Z", + "due_date": "2018-07-22", + "start_date": "2018-06-08", + "web_url": "https://gitlab.com/groups/gitlab-org/-/milestones/13" + } + }, + { + "id": 13932747, + "iid": 20568, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20568", + "title": "add initial smoke tests and documentation", + "description": "## What does this MR do?\n\nAdds initial smoke test functionality for quick sanity testing from the UI.\n\n## Are there points in the code the reviewer needs to double check?\n\nThere will be a sister MR to this created in the [QA Repository](https://gitlab.com/gitlab-org/gitlab-qa) regarding documentation on *how to run* these smoke tests.\n\nWe can run them by using:\n\n`bin/qa Test::Smoke http://localhost:3000`\n\nI ran the \"smoke suite\" a couple times: here are my findings.\n\n| Time taken |\n|------------|\n| 50.9s |\n| 50.08s |\n| 50.78 |\n\n## Why was this MR needed?\n\nThis MR was created per discussions in https://gitlab.com/gitlab-org/gitlab-qa/issues/288\n\n## Does this MR meet the acceptance criteria?\n\n- [ ] [Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary\n- [x] [Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs)\n- [x] Tests added for this feature/bug\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\n - [ ] Has been reviewed by a Frontend maintainer\n - [ ] Has been reviewed by a Backend maintainer\n- [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\n- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\n- [ ] End-to-end tests pass (`package-and-qa` manual pipeline job)\n\n## What are the relevant issue numbers?\n\n- https://gitlab.com/gitlab-org/gitlab-qa/issues/288\n\n## Notes\n\nWe should of course expand this suite, perhaps adding more `describe` scenarios in our source base to what we believe should be constituted as a \"smoke test.\"\n\n/cc @gl\\-quality @rspeicher @grzesiek @stanhu", + "state": "opened", + "created_at": "2018-07-11T22:18:59.366Z", + "updated_at": "2018-07-11T22:19:01.327Z", + "source_branch": "qa-smoke-tests", + "target_branch": "master", + "source_project_id": 13083, + "target_project_id": 13083, + "sha": "2d06e080106b0d20adeda763bb5bc6beae2c8535", + "merge_status": "can_be_merged", + "author": { + "id": 272636, + "username": "ddavison", + "name": "Dan Davison", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/6e56557ffa1baafe3e73e45bd2dc9524?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/ddavison" + }, + "assignee": { + "id": 2097582, + "username": "meks", + "name": "Mek Stittri", + "state": "active", + "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/2097582/avatar.png", + "web_url": "https://gitlab.com/meks" + }, + "labels": [ + "Discussion", + "QA", + "Quality" + ], + "time_stats": {} + }, + { + "id": 13931916, + "iid": 20567, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20567", + "title": "WIP: Resolve \"Remove ghost notification settings for groups and projects\"", + "description": "## What does this MR do?\n\n## Are there points in the code the reviewer needs to double check?\n\n## Why was this MR needed?\n\n## Screenshots (if relevant)\n\n## Does this MR meet the acceptance criteria?\n\n- [x] [Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary\n- [ ] [Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs)\n- [ ] API support added\n- [x] Tests added for this feature/bug\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\n - [ ] Has been reviewed by a UX Designer\n - [ ] Has been reviewed by a Frontend maintainer\n - [ ] Has been reviewed by a Backend maintainer\n - [ ] Has been reviewed by a Database specialist\n- [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\n- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\n- [x] Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides)\n- [ ] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)\n- [ ] Internationalization required/considered\n- [ ] End-to-end tests pass (`package-and-qa` manual pipeline job)\n\n## What are the relevant issue numbers?\n\n\nCloses #44824", + "state": "opened", + "created_at": "2018-07-11T21:06:10.653Z", + "updated_at": "2018-07-11T21:06:43.081Z", + "source_branch": "44824-remove-ghost-notification-settings-for-group-and-project", + "target_branch": "master", + "source_project_id": 1915107, + "target_project_id": 13083, + "sha": "4cf0900526027785658829666f235349bafe4475", + "work_in_progress": true, + "merge_status": "cannot_be_merged", + "squash": true, + "force_remove_source_branch": true, + "author": { + "id": 331646, + "username": "jacopo-beschi", + "name": "🙈 jacopo beschi 🙉", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/692fb66988ac3863f360e846c1afc4f3?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/jacopo-beschi" + }, + "assignee": { + "id": 331646, + "username": "jacopo-beschi", + "name": "🙈 jacopo beschi 🙉", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/692fb66988ac3863f360e846c1afc4f3?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/jacopo-beschi" + }, + "time_stats": {} + }, + { + "id": 13929701, + "iid": 20566, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20566", + "title": "Fix archived parameter for projects API", + "description": "## What does this MR do?\n\nFixes a regression where the archived parameter is incorrectly applied to the projects finder.\n\n## Are there points in the code the reviewer needs to double check?\n\nIt changes default (but incorrect per spec) API behavior which is in place for 1,5 years.\nCurrently without `archived` parameter only active projects are returned (so filter `archived=false` is incorrectly applied).\nThe current default API behavior matches GUI behavior, however it's not possible to filter archived projects only via API (which is possible via GUI).\n\nThis MR replaces !17244 (from @razer6), which is un-maintained for last 5 months due to contributor inactivity.\nThe code from that MR is refreshed and remaining open comments are implemented.\n\n## Why was this MR needed?\n\nSee discussions in #32301 and !17244\n\n## Does this MR meet the acceptance criteria?\n\n- [x] [Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary\n- [x] [Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs)\n- [x] API support added\n- [x] Tests added for this feature/bug\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\n - [ ] Has been reviewed by a UX Designer\n - [ ] Has been reviewed by a Frontend maintainer\n - [ ] Has been reviewed by a Backend maintainer\n - [ ] Has been reviewed by a Database specialist\n- [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\n- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\n- [x] Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides)\n- [x] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)\n- [x] Internationalization required/considered\n- [ ] End-to-end tests pass (`package-and-qa` manual pipeline job)\n\n## What are the relevant issue numbers?\n\nCloses #32301", + "state": "opened", + "created_at": "2018-07-11T19:55:40.907Z", + "updated_at": "2018-07-11T20:00:23.499Z", + "source_branch": "fix-project-api-archived", + "target_branch": "master", + "source_project_id": 904528, + "target_project_id": 13083, + "sha": "4fd3d6ed3bf663f8d978db62fb1f552c529e2950", + "merge_status": "can_be_merged", + "force_remove_source_branch": true, + "author": { + "id": 1334624, + "username": "petermarko", + "name": "Peter Marko", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/28cbcbcb84533b9f8afc75521bdc457e?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/petermarko" + }, + "time_stats": {} + }, + { + "id": 13929032, + "iid": 20565, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20565", + "title": "Remove healthchecks from prometheus endpoint", + "description": "## What does this MR do?\r\n\r\n- Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/49112\r\n\r\n## Are there points in the code the reviewer needs to double check?\r\n\r\n```shell\r\n# Simulate a Gitaly server under extreme load....\r\n$ lldb -p $(pgrep gitaly) \u0026 \r\n\r\n# Without this fix: Prometheus scrape endpoint times out after ~55s with a 500 error\r\n$ time curl http://localhost:3000/-/metrics\r\nNameError at /-/metrics\r\n=======================\r\n\r\n\u003e uninitialized constant GRPC::GRPC\r\n...\r\nreal\t0m58.135s\r\nuser\t0m0.014s\r\nsys\t0m0.016s\r\n\r\n# With this fix: Prometheus scrape endpoint returns the prometheus metrics successfully, immediately\r\n$ time curl http://localhost:3000/-/metrics\r\nclient_browser_timing_count{event=\"contentComplete\"} 40\r\n# HELP client_browser_timing Multiprocess metric\r\n# TYPE client_browser_timing histogram\r\nclient_browser_timing_bucket{event=\"connect\",le=\"+Inf\"} 40\r\nclient_browser_timing_bucket{event=\"connect\",le=\"0.005\"} 40\r\n...\r\n\r\nreal\t0m0.607s\r\nuser\t0m0.020s\r\nsys\t0m0.027s\r\n\r\n```\r\n\r\n## Why was this MR needed?\r\n\r\nSimilar reasons as https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20552:\r\n\r\n\u003e When any single Gitaly server fails, up to 50% of the web and api fleet workload is saturated by prometheus healthcheck requests, which happen 4 times a minute on each node, with each request currently taking almost a full minute, before failing with a 500 error.\r\n\r\nWith this fix: when any single Gitaly server fails: the prometheus endpoint will return immediately with the correct metrics and a 200 response.\r\n\r\n## Does this MR meet the acceptance criteria?\r\n\r\n- [ ] [Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary\r\n- [ ] [Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs)\r\n- [ ] API support added\r\n- [ ] Tests added for this feature/bug\r\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\r\n - [ ] Has been reviewed by a UX Designer\r\n - [ ] Has been reviewed by a Frontend maintainer\r\n - [ ] Has been reviewed by a Backend maintainer\r\n - [ ] Has been reviewed by a Database specialist\r\n- [ ] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\r\n- [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\r\n- [ ] Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides)\r\n- [ ] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)\r\n- [ ] Internationalization required/considered\r\n- [ ] End-to-end tests pass (`package-and-qa` manual pipeline job)\r\n\r\n## What are the relevant issue numbers?", + "state": "opened", + "created_at": "2018-07-11T19:08:21.900Z", + "updated_at": "2018-07-11T19:11:52.822Z", + "source_branch": "an/no-healthcheck-until-brooklyn", + "target_branch": "master", + "source_project_id": 13083, + "target_project_id": 13083, + "sha": "b4cc74f3b45ed206fdcfb021cbdbc8621807177c", + "merge_status": "can_be_merged", + "squash": true, + "force_remove_source_branch": true, + "user_notes_count": 1, + "author": { + "id": 895869, + "username": "andrewn", + "name": "Andrew Newdigate", + "state": "active", + "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/895869/avatar.png", + "web_url": "https://gitlab.com/andrewn" + }, + "labels": [ + "Gitaly", + "availability", + "performance" + ], + "time_stats": {}, + "milestone": { + "id": 450583, + "iid": 13, + "group_id": 9970, + "title": "11.1", + "state": "active", + "updated_at": "2018-03-01T19:52:29.776Z", + "created_at": "2018-01-23T21:40:27.318Z", + "due_date": "2018-07-22", + "start_date": "2018-06-08", + "web_url": "https://gitlab.com/groups/gitlab-org/-/milestones/13" + } + }, + { + "id": 13928405, + "iid": 20564, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20564", + "title": "Revert \"Log push output on exception\" because it is no longer needed", + "description": "## What does this MR do?\n\nWe have successfully diagnosed https://gitlab.com/gitlab-org/gitlab-ce/issues/48241, so this logging is no longer needed.\n\n## Does this MR meet the acceptance criteria?\n\n- ~~[Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary~~\n- ~~[Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs)~~\n- ~~API support added~~\n- ~~Tests added for this feature/bug~~\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\n - [ ] Has been reviewed by a Backend maintainer\n- ~~Conform by the [merge request performance guides]~~(https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\n- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\n- ~~Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides)~~\n- [x] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)\n- ~~Internationalization required/considered~~\n- [x] End-to-end tests pass (`package-and-qa` manual pipeline job)\n\n## What are the relevant issue numbers?\n\nhttps://gitlab.com/gitlab-org/gitlab-ce/issues/48241", + "state": "opened", + "created_at": "2018-07-11T18:44:19.250Z", + "updated_at": "2018-07-11T21:48:31.133Z", + "source_branch": "mk/remove-push-output-logging", + "target_branch": "master", + "source_project_id": 13083, + "target_project_id": 13083, + "sha": "2555bf5ee35862a9f940d3004e3b9f7bdf196e12", + "merge_status": "can_be_merged", + "squash": true, + "force_remove_source_branch": true, + "user_notes_count": 1, + "author": { + "id": 1144264, + "username": "mkozono", + "name": "Michael Kozono", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/ddaa576b4b6933a6fb7a996088c30f6c?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/mkozono" + }, + "assignee": { + "id": 128633, + "username": "rymai", + "name": "Rémy Coutable", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/263da227929cc0035cb0eba512bcf81a?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/rymai" + }, + "labels": [ + "Quality", + "technical debt" + ], + "time_stats": {} + }, + { + "id": 13927668, + "iid": 20563, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20563", + "title": "Resolve \"Follow-up from \"Milestone tests\"\"", + "description": "## What does this MR do?\n\nThis MR extracts the `has_milestone?` method out of `QA::Page::MergeRequest::Show` and into `QA::Page::Issuable::Sidebar`. \n\n## Does this MR meet the acceptance criteria?\n\n- [x] Tests added for this feature/bug\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\n - [ ] Has been reviewed by a Backend maintainer\n- [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\n- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\n- [ ] End-to-end tests pass (`package-and-qa` manual pipeline job)\n\n## What are the relevant issue numbers?\n\nCloses #48690", + "state": "opened", + "created_at": "2018-07-11T18:17:37.205Z", + "updated_at": "2018-07-11T18:27:01.373Z", + "source_branch": "48690-follow-up-from-milestone-tests", + "target_branch": "master", + "source_project_id": 13083, + "target_project_id": 13083, + "sha": "a825dc229a9b9ecb76dc6b88d7002afe29ff5781", + "merge_status": "can_be_merged", + "force_remove_source_branch": true, + "author": { + "id": 272636, + "username": "ddavison", + "name": "Dan Davison", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/6e56557ffa1baafe3e73e45bd2dc9524?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/ddavison" + }, + "assignee": { + "id": 128633, + "username": "rymai", + "name": "Rémy Coutable", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/263da227929cc0035cb0eba512bcf81a?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/rymai" + }, + "labels": [ + "QA", + "Quality", + "enhancement" + ], + "time_stats": {}, + "milestone": { + "id": 494367, + "iid": 15, + "group_id": 9970, + "title": "11.2", + "state": "active", + "updated_at": "2018-03-27T19:28:34.472Z", + "created_at": "2018-03-27T19:26:05.990Z", + "due_date": "2018-08-22", + "start_date": "2018-07-08", + "web_url": "https://gitlab.com/groups/gitlab-org/-/milestones/15" + } + }, + { + "id": 13925429, + "iid": 20562, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20562", + "title": "Fix MR widget border", + "description": "![Screen_Shot_2018-07-11_at_12.08.08_PM](/uploads/58608375fdec4ae03fa245ef17e8adea/Screen_Shot_2018-07-11_at_12.08.08_PM.png)", + "state": "merged", + "created_at": "2018-07-11T17:08:41.143Z", + "updated_at": "2018-07-11T17:39:06.035Z", + "source_branch": "fix-mr-widget-border", + "target_branch": "master", + "source_project_id": 13083, + "target_project_id": 13083, + "sha": "0cf9af01ce5c6db84aba8d40defc0cb03cb6e75f", + "merge_commit_sha": "a781d0f9b2b89f5a3fa33dc72fcefb485f2078ce", + "merge_status": "can_be_merged", + "merge_when_pipeline_succeeds": true, + "should_remove_source_branch": true, + "force_remove_source_branch": true, + "user_notes_count": 2, + "author": { + "id": 201566, + "username": "annabeldunstone", + "name": "Annabel Gray", + "state": "active", + "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/201566/avatar.png", + "web_url": "https://gitlab.com/annabeldunstone" + }, + "assignee": { + "id": 482476, + "username": "filipa", + "name": "Filipa Lacerda", + "state": "active", + "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/482476/avatar.png", + "web_url": "https://gitlab.com/filipa" + }, + "labels": [ + "Pick into 11.1", + "frontend", + "regression" + ], + "time_stats": {}, + "milestone": { + "id": 450583, + "iid": 13, + "group_id": 9970, + "title": "11.1", + "state": "active", + "updated_at": "2018-03-01T19:52:29.776Z", + "created_at": "2018-01-23T21:40:27.318Z", + "due_date": "2018-07-22", + "start_date": "2018-06-08", + "web_url": "https://gitlab.com/groups/gitlab-org/-/milestones/13" + } + }, + { + "id": 13925353, + "iid": 20561, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20561", + "title": "Resolve \"QA: False failure on QA test \"Push to protected branch when allowed\" during staging failover rehearsal\"", + "description": "## What does this MR do?\n\nThis ensure the external encoding is set to UTF-8 when running QA specs.\n\n## Are there points in the code the reviewer needs to double check?\n\nIf QA passes I guess that's it.\n\n## Does this MR meet the acceptance criteria?\n\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\n - [ ] Has been reviewed by a Backend maintainer\n- [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\n- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\n- [x] Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides)\n- [x] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)\n- [ ] End-to-end tests pass (`package-and-qa` manual pipeline job)\n\n## What are the relevant issue numbers?\n\nCloses #48241", + "state": "opened", + "created_at": "2018-07-11T17:02:36.349Z", + "updated_at": "2018-07-11T17:03:50.347Z", + "source_branch": "48241-fix-invalid-byte-sequence-in-qa", + "target_branch": "master", + "source_project_id": 13083, + "target_project_id": 13083, + "sha": "c9a27a42f0e07799bedfbc49af711dc84449ad17", + "merge_status": "can_be_merged", + "force_remove_source_branch": true, + "user_notes_count": 1, + "author": { + "id": 128633, + "username": "rymai", + "name": "Rémy Coutable", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/263da227929cc0035cb0eba512bcf81a?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/rymai" + }, + "assignee": { + "id": 128633, + "username": "rymai", + "name": "Rémy Coutable", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/263da227929cc0035cb0eba512bcf81a?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/rymai" + }, + "labels": [ + "QA", + "Quality", + "bug" + ], + "time_stats": {}, + "milestone": { + "id": 494367, + "iid": 15, + "group_id": 9970, + "title": "11.2", + "state": "active", + "updated_at": "2018-03-27T19:28:34.472Z", + "created_at": "2018-03-27T19:26:05.990Z", + "due_date": "2018-08-22", + "start_date": "2018-07-08", + "web_url": "https://gitlab.com/groups/gitlab-org/-/milestones/15" + } + }, + { + "id": 13924879, + "iid": 20560, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20560", + "title": "Revert \"Merge branch 'ee-5481-epic-todos' into 'master'\"", + "description": "Revert of https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/19908", + "state": "merged", + "created_at": "2018-07-11T16:34:45.542Z", + "updated_at": "2018-07-11T20:08:18.664Z", + "source_branch": "revert-todos-epic", + "target_branch": "master", + "source_project_id": 13083, + "target_project_id": 13083, + "sha": "8717c7dad9b5a8fa21ec9a652c54718a6b4c2175", + "merge_commit_sha": "9591fdbed7c14712986a8308036787481bbb3bc0", + "merge_status": "can_be_merged", + "merge_when_pipeline_succeeds": true, + "should_remove_source_branch": true, + "user_notes_count": 1, + "author": { + "id": 508743, + "username": "jarka", + "name": "Jarka Kadlecová", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/3931dae84deb01d2881e4909077b8dbe?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/jarka" + }, + "assignee": { + "id": 209240, + "username": "yorickpeterse", + "name": "Yorick Peterse", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/644bcc0c58aa01920c4de4f941afcac9?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/yorickpeterse" + }, + "labels": [ + "Discussion", + "bug" + ], + "time_stats": {}, + "milestone": { + "id": 450583, + "iid": 13, + "group_id": 9970, + "title": "11.1", + "state": "active", + "updated_at": "2018-03-01T19:52:29.776Z", + "created_at": "2018-01-23T21:40:27.318Z", + "due_date": "2018-07-22", + "start_date": "2018-06-08", + "web_url": "https://gitlab.com/groups/gitlab-org/-/milestones/13" + } + } +] \ No newline at end of file diff --git a/integration/snapshots/ls_group_merge_requests_verbose.snap b/integration/snapshots/ls_group_merge_requests_verbose.snap new file mode 100644 index 0000000..6a020d4 --- /dev/null +++ b/integration/snapshots/ls_group_merge_requests_verbose.snap @@ -0,0 +1,44 @@ +Fetching group 1 merge requests… + +| PROJECT ID | ID | TITLE | SOURCE | TARGET | STATE | ASSIGNEE | WIP | MERGE STATUS | CREATED AT | ++------------+----------+--------------------------------+----------------------------------------------------------------+--------+--------+---------------+-------+------------------+--------------------------+ +| 13083 | 13932943 | WIP: Fix autosave issues for | _acet-fix-mr-autosave | master | opened | fatihacet | true | can_be_merged | 2018-07-11T22:39:55.571Z | +| | | MR discussions | | | | | | | | +| 13083 | 13932747 | add initial smoke tests and | qa-smoke-tests | master | opened | meks | false | can_be_merged | 2018-07-11T22:18:59.366Z | +| | | documentation | | | | | | | | +| 13083 | 13931916 | WIP: Resolve "Remove ghost | 44824-remove-ghost-notification-settings-for-group-and-project | master | opened | jacopo-beschi | true | cannot_be_merged | 2018-07-11T21:06:10.653Z | +| | | notification settings for | | | | | | | | +| | | groups and projects" | | | | | | | | +| 13083 | 13929701 | Fix archived parameter for | fix-project-api-archived | master | opened | | false | can_be_merged | 2018-07-11T19:55:40.907Z | +| | | projects API | | | | | | | | +| 13083 | 13929032 | Remove healthchecks from | an/no-healthcheck-until-brooklyn | master | opened | | false | can_be_merged | 2018-07-11T19:08:21.900Z | +| | | prometheus endpoint | | | | | | | | +| 13083 | 13928405 | Revert "Log push output on | mk/remove-push-output-logging | master | opened | rymai | false | can_be_merged | 2018-07-11T18:44:19.250Z | +| | | exception" because it is no | | | | | | | | +| | | longer needed | | | | | | | | +| 13083 | 13927668 | Resolve "Follow-up from | 48690-follow-up-from-milestone-tests | master | opened | rymai | false | can_be_merged | 2018-07-11T18:17:37.205Z | +| | | "Milestone tests"" | | | | | | | | +| 13083 | 13925429 | Fix MR widget border | fix-mr-widget-border | master | merged | filipa | false | can_be_merged | 2018-07-11T17:08:41.143Z | +| 13083 | 13925353 | Resolve "QA: False failure | 48241-fix-invalid-byte-sequence-in-qa | master | opened | rymai | false | can_be_merged | 2018-07-11T17:02:36.349Z | +| | | on QA test "Push to protected | | | | | | | | +| | | branch when allowed" during | | | | | | | | +| | | staging failover rehearsal" | | | | | | | | +| 13083 | 13924879 | Revert "Merge branch | revert-todos-epic | master | merged | yorickpeterse | false | can_be_merged | 2018-07-11T16:34:45.542Z | +| | | 'ee-5481-epic-todos' into | | | | | | | | +| | | 'master'" | | | | | | | | + + +Response meta + + Method GET + Url http://wiremock:8080/api/v4/groups/1/merge_requests?page=1&per_page=10 + StatusCode 200 + Request id + Runtime 0.000000 + Page 1 + Items per page 10 + Previous page 0 + Next page 0 + Total pages 0 + Total 0 + diff --git a/integration/snapshots/ls_group_merge_requests_yaml.snap b/integration/snapshots/ls_group_merge_requests_yaml.snap new file mode 100644 index 0000000..b7f1ff5 --- /dev/null +++ b/integration/snapshots/ls_group_merge_requests_yaml.snap @@ -0,0 +1,613 @@ +Fetching group 1 merge requests… +- id: 13932943 + iid: 20569 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20569 + title: 'WIP: Fix autosave issues for MR discussions' + description: "Fixes multiple autosave issues and ESC confirmations around noteable + shared components and new MR discussions.\r\n\r\n### Fixes autosave issue in noteable + shared components\r\n![_mr-autosave](/uploads/2997c1e1d745ccd70f8ccf6854e86b56/_mr-autosave.gif)\r\n\r\n### + Fixes ESC confirmation and autosave issues in reply a discussion form\r\n![_mr-esc-confirm](/uploads/79f7c7aace864ce02bd680099c715fc2/_mr-esc-confirm.gif)\r\n\r\n### + Adds ESC confirmation to new discussion form\r\n![_mr-esc-confirm2](/uploads/a4f3b3d41fb3b15db0e1a88f89264622/_mr-esc-confirm2.gif)\r\n\r\n\r\nFixes + https://gitlab.com/gitlab-org/gitlab-ce/issues/48876 and https://gitlab.com/gitlab-org/gitlab-ce/issues/48877" + state: opened + created_at: "2018-07-11T22:39:55.571Z" + updated_at: "2018-07-11T23:35:44.014Z" + source_branch: _acet-fix-mr-autosave + target_branch: master + source_project_id: 13083 + target_project_id: 13083 + sha: da788f233de489315e3155f170700c625af352c4 + work_in_progress: true + merge_status: can_be_merged + force_remove_source_branch: true + user_notes_count: 1 + author: + id: 502136 + username: fatihacet + name: Fatih Acet + state: active + avatar_url: https://assets.gitlab-static.net/uploads/-/system/user/avatar/502136/avatar.png + web_url: https://gitlab.com/fatihacet + assignee: + id: 502136 + username: fatihacet + name: Fatih Acet + state: active + avatar_url: https://assets.gitlab-static.net/uploads/-/system/user/avatar/502136/avatar.png + web_url: https://gitlab.com/fatihacet + labels: + - Discussion + - Pick into 11.1 + - bug + - frontend + - mr refactor + - regression + - reproduced on GitLab.com + time_stats: {} + milestone: + id: 450583 + iid: 13 + group_id: 9970 + title: "11.1" + state: active + updated_at: "2018-03-01T19:52:29.776Z" + created_at: "2018-01-23T21:40:27.318Z" + due_date: "2018-07-22" + start_date: "2018-06-08" + web_url: https://gitlab.com/groups/gitlab-org/-/milestones/13 +- id: 13932747 + iid: 20568 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20568 + title: add initial smoke tests and documentation + description: |- + ## What does this MR do? + + Adds initial smoke test functionality for quick sanity testing from the UI. + + ## Are there points in the code the reviewer needs to double check? + + There will be a sister MR to this created in the [QA Repository](https://gitlab.com/gitlab-org/gitlab-qa) regarding documentation on *how to run* these smoke tests. + + We can run them by using: + + `bin/qa Test::Smoke http://localhost:3000` + + I ran the "smoke suite" a couple times: here are my findings. + + | Time taken | + |------------| + | 50.9s | + | 50.08s | + | 50.78 | + + ## Why was this MR needed? + + This MR was created per discussions in https://gitlab.com/gitlab-org/gitlab-qa/issues/288 + + ## Does this MR meet the acceptance criteria? + + - [ ] [Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary + - [x] [Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs) + - [x] Tests added for this feature/bug + - Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html) + - [ ] Has been reviewed by a Frontend maintainer + - [ ] Has been reviewed by a Backend maintainer + - [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html) + - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides) + - [ ] End-to-end tests pass (`package-and-qa` manual pipeline job) + + ## What are the relevant issue numbers? + + - https://gitlab.com/gitlab-org/gitlab-qa/issues/288 + + ## Notes + + We should of course expand this suite, perhaps adding more `describe` scenarios in our source base to what we believe should be constituted as a "smoke test." + + /cc @gl\-quality @rspeicher @grzesiek @stanhu + state: opened + created_at: "2018-07-11T22:18:59.366Z" + updated_at: "2018-07-11T22:19:01.327Z" + source_branch: qa-smoke-tests + target_branch: master + source_project_id: 13083 + target_project_id: 13083 + sha: 2d06e080106b0d20adeda763bb5bc6beae2c8535 + merge_status: can_be_merged + author: + id: 272636 + username: ddavison + name: Dan Davison + state: active + avatar_url: https://secure.gravatar.com/avatar/6e56557ffa1baafe3e73e45bd2dc9524?s=80&d=identicon + web_url: https://gitlab.com/ddavison + assignee: + id: 2097582 + username: meks + name: Mek Stittri + state: active + avatar_url: https://assets.gitlab-static.net/uploads/-/system/user/avatar/2097582/avatar.png + web_url: https://gitlab.com/meks + labels: + - Discussion + - QA + - Quality + time_stats: {} +- id: 13931916 + iid: 20567 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20567 + title: 'WIP: Resolve "Remove ghost notification settings for groups and projects"' + description: |- + ## What does this MR do? + + ## Are there points in the code the reviewer needs to double check? + + ## Why was this MR needed? + + ## Screenshots (if relevant) + + ## Does this MR meet the acceptance criteria? + + - [x] [Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary + - [ ] [Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs) + - [ ] API support added + - [x] Tests added for this feature/bug + - Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html) + - [ ] Has been reviewed by a UX Designer + - [ ] Has been reviewed by a Frontend maintainer + - [ ] Has been reviewed by a Backend maintainer + - [ ] Has been reviewed by a Database specialist + - [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html) + - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides) + - [x] Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides) + - [ ] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) + - [ ] Internationalization required/considered + - [ ] End-to-end tests pass (`package-and-qa` manual pipeline job) + + ## What are the relevant issue numbers? + + + Closes #44824 + state: opened + created_at: "2018-07-11T21:06:10.653Z" + updated_at: "2018-07-11T21:06:43.081Z" + source_branch: 44824-remove-ghost-notification-settings-for-group-and-project + target_branch: master + source_project_id: 1915107 + target_project_id: 13083 + sha: 4cf0900526027785658829666f235349bafe4475 + work_in_progress: true + merge_status: cannot_be_merged + squash: true + force_remove_source_branch: true + author: + id: 331646 + username: jacopo-beschi + name: "\U0001F648 jacopo beschi \U0001F649" + state: active + avatar_url: https://secure.gravatar.com/avatar/692fb66988ac3863f360e846c1afc4f3?s=80&d=identicon + web_url: https://gitlab.com/jacopo-beschi + assignee: + id: 331646 + username: jacopo-beschi + name: "\U0001F648 jacopo beschi \U0001F649" + state: active + avatar_url: https://secure.gravatar.com/avatar/692fb66988ac3863f360e846c1afc4f3?s=80&d=identicon + web_url: https://gitlab.com/jacopo-beschi + time_stats: {} +- id: 13929701 + iid: 20566 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20566 + title: Fix archived parameter for projects API + description: |- + ## What does this MR do? + + Fixes a regression where the archived parameter is incorrectly applied to the projects finder. + + ## Are there points in the code the reviewer needs to double check? + + It changes default (but incorrect per spec) API behavior which is in place for 1,5 years. + Currently without `archived` parameter only active projects are returned (so filter `archived=false` is incorrectly applied). + The current default API behavior matches GUI behavior, however it's not possible to filter archived projects only via API (which is possible via GUI). + + This MR replaces !17244 (from @razer6), which is un-maintained for last 5 months due to contributor inactivity. + The code from that MR is refreshed and remaining open comments are implemented. + + ## Why was this MR needed? + + See discussions in #32301 and !17244 + + ## Does this MR meet the acceptance criteria? + + - [x] [Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary + - [x] [Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs) + - [x] API support added + - [x] Tests added for this feature/bug + - Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html) + - [ ] Has been reviewed by a UX Designer + - [ ] Has been reviewed by a Frontend maintainer + - [ ] Has been reviewed by a Backend maintainer + - [ ] Has been reviewed by a Database specialist + - [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html) + - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides) + - [x] Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides) + - [x] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) + - [x] Internationalization required/considered + - [ ] End-to-end tests pass (`package-and-qa` manual pipeline job) + + ## What are the relevant issue numbers? + + Closes #32301 + state: opened + created_at: "2018-07-11T19:55:40.907Z" + updated_at: "2018-07-11T20:00:23.499Z" + source_branch: fix-project-api-archived + target_branch: master + source_project_id: 904528 + target_project_id: 13083 + sha: 4fd3d6ed3bf663f8d978db62fb1f552c529e2950 + merge_status: can_be_merged + force_remove_source_branch: true + author: + id: 1334624 + username: petermarko + name: Peter Marko + state: active + avatar_url: https://secure.gravatar.com/avatar/28cbcbcb84533b9f8afc75521bdc457e?s=80&d=identicon + web_url: https://gitlab.com/petermarko + time_stats: {} +- id: 13929032 + iid: 20565 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20565 + title: Remove healthchecks from prometheus endpoint + description: "## What does this MR do?\r\n\r\n- Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/49112\r\n\r\n## + Are there points in the code the reviewer needs to double check?\r\n\r\n```shell\r\n# + Simulate a Gitaly server under extreme load....\r\n$ lldb -p $(pgrep gitaly) & + \r\n\r\n# Without this fix: Prometheus scrape endpoint times out after ~55s with + a 500 error\r\n$ time curl http://localhost:3000/-/metrics\r\nNameError at /-/metrics\r\n=======================\r\n\r\n> + uninitialized constant GRPC::GRPC\r\n...\r\nreal\t0m58.135s\r\nuser\t0m0.014s\r\nsys\t0m0.016s\r\n\r\n# + With this fix: Prometheus scrape endpoint returns the prometheus metrics successfully, + immediately\r\n$ time curl http://localhost:3000/-/metrics\r\nclient_browser_timing_count{event=\"contentComplete\"} + 40\r\n# HELP client_browser_timing Multiprocess metric\r\n# TYPE client_browser_timing + histogram\r\nclient_browser_timing_bucket{event=\"connect\",le=\"+Inf\"} 40\r\nclient_browser_timing_bucket{event=\"connect\",le=\"0.005\"} + 40\r\n...\r\n\r\nreal\t0m0.607s\r\nuser\t0m0.020s\r\nsys\t0m0.027s\r\n\r\n```\r\n\r\n## + Why was this MR needed?\r\n\r\nSimilar reasons as https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20552:\r\n\r\n> + When any single Gitaly server fails, up to 50% of the web and api fleet workload + is saturated by prometheus healthcheck requests, which happen 4 times a minute + on each node, with each request currently taking almost a full minute, before + failing with a 500 error.\r\n\r\nWith this fix: when any single Gitaly server + fails: the prometheus endpoint will return immediately with the correct metrics + and a 200 response.\r\n\r\n## Does this MR meet the acceptance criteria?\r\n\r\n- + [ ] [Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, + if necessary\r\n- [ ] [Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs)\r\n- + [ ] API support added\r\n- [ ] Tests added for this feature/bug\r\n- Conform by + the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\r\n + \ - [ ] Has been reviewed by a UX Designer\r\n - [ ] Has been reviewed by a Frontend + maintainer\r\n - [ ] Has been reviewed by a Backend maintainer\r\n - [ ] Has + been reviewed by a Database specialist\r\n- [ ] Conform by the [merge request + performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\r\n- + [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\r\n- + [ ] Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides)\r\n- + [ ] If you have multiple commits, please combine them into a few logically organized + commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)\r\n- + [ ] Internationalization required/considered\r\n- [ ] End-to-end tests pass (`package-and-qa` + manual pipeline job)\r\n\r\n## What are the relevant issue numbers?" + state: opened + created_at: "2018-07-11T19:08:21.900Z" + updated_at: "2018-07-11T19:11:52.822Z" + source_branch: an/no-healthcheck-until-brooklyn + target_branch: master + source_project_id: 13083 + target_project_id: 13083 + sha: b4cc74f3b45ed206fdcfb021cbdbc8621807177c + merge_status: can_be_merged + squash: true + force_remove_source_branch: true + user_notes_count: 1 + author: + id: 895869 + username: andrewn + name: Andrew Newdigate + state: active + avatar_url: https://assets.gitlab-static.net/uploads/-/system/user/avatar/895869/avatar.png + web_url: https://gitlab.com/andrewn + labels: + - Gitaly + - availability + - performance + time_stats: {} + milestone: + id: 450583 + iid: 13 + group_id: 9970 + title: "11.1" + state: active + updated_at: "2018-03-01T19:52:29.776Z" + created_at: "2018-01-23T21:40:27.318Z" + due_date: "2018-07-22" + start_date: "2018-06-08" + web_url: https://gitlab.com/groups/gitlab-org/-/milestones/13 +- id: 13928405 + iid: 20564 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20564 + title: Revert "Log push output on exception" because it is no longer needed + description: |- + ## What does this MR do? + + We have successfully diagnosed https://gitlab.com/gitlab-org/gitlab-ce/issues/48241, so this logging is no longer needed. + + ## Does this MR meet the acceptance criteria? + + - ~~[Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary~~ + - ~~[Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs)~~ + - ~~API support added~~ + - ~~Tests added for this feature/bug~~ + - Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html) + - [ ] Has been reviewed by a Backend maintainer + - ~~Conform by the [merge request performance guides]~~(https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html) + - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides) + - ~~Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides)~~ + - [x] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) + - ~~Internationalization required/considered~~ + - [x] End-to-end tests pass (`package-and-qa` manual pipeline job) + + ## What are the relevant issue numbers? + + https://gitlab.com/gitlab-org/gitlab-ce/issues/48241 + state: opened + created_at: "2018-07-11T18:44:19.250Z" + updated_at: "2018-07-11T21:48:31.133Z" + source_branch: mk/remove-push-output-logging + target_branch: master + source_project_id: 13083 + target_project_id: 13083 + sha: 2555bf5ee35862a9f940d3004e3b9f7bdf196e12 + merge_status: can_be_merged + squash: true + force_remove_source_branch: true + user_notes_count: 1 + author: + id: 1144264 + username: mkozono + name: Michael Kozono + state: active + avatar_url: https://secure.gravatar.com/avatar/ddaa576b4b6933a6fb7a996088c30f6c?s=80&d=identicon + web_url: https://gitlab.com/mkozono + assignee: + id: 128633 + username: rymai + name: Rémy Coutable + state: active + avatar_url: https://secure.gravatar.com/avatar/263da227929cc0035cb0eba512bcf81a?s=80&d=identicon + web_url: https://gitlab.com/rymai + labels: + - Quality + - technical debt + time_stats: {} +- id: 13927668 + iid: 20563 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20563 + title: Resolve "Follow-up from "Milestone tests"" + description: "## What does this MR do?\n\nThis MR extracts the `has_milestone?` + method out of `QA::Page::MergeRequest::Show` and into `QA::Page::Issuable::Sidebar`. + \n\n## Does this MR meet the acceptance criteria?\n\n- [x] Tests added for this + feature/bug\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\n + \ - [ ] Has been reviewed by a Backend maintainer\n- [x] Conform by the [merge + request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\n- + [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\n- + [ ] End-to-end tests pass (`package-and-qa` manual pipeline job)\n\n## What are + the relevant issue numbers?\n\nCloses #48690" + state: opened + created_at: "2018-07-11T18:17:37.205Z" + updated_at: "2018-07-11T18:27:01.373Z" + source_branch: 48690-follow-up-from-milestone-tests + target_branch: master + source_project_id: 13083 + target_project_id: 13083 + sha: a825dc229a9b9ecb76dc6b88d7002afe29ff5781 + merge_status: can_be_merged + force_remove_source_branch: true + author: + id: 272636 + username: ddavison + name: Dan Davison + state: active + avatar_url: https://secure.gravatar.com/avatar/6e56557ffa1baafe3e73e45bd2dc9524?s=80&d=identicon + web_url: https://gitlab.com/ddavison + assignee: + id: 128633 + username: rymai + name: Rémy Coutable + state: active + avatar_url: https://secure.gravatar.com/avatar/263da227929cc0035cb0eba512bcf81a?s=80&d=identicon + web_url: https://gitlab.com/rymai + labels: + - QA + - Quality + - enhancement + time_stats: {} + milestone: + id: 494367 + iid: 15 + group_id: 9970 + title: "11.2" + state: active + updated_at: "2018-03-27T19:28:34.472Z" + created_at: "2018-03-27T19:26:05.990Z" + due_date: "2018-08-22" + start_date: "2018-07-08" + web_url: https://gitlab.com/groups/gitlab-org/-/milestones/15 +- id: 13925429 + iid: 20562 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20562 + title: Fix MR widget border + description: '![Screen_Shot_2018-07-11_at_12.08.08_PM](/uploads/58608375fdec4ae03fa245ef17e8adea/Screen_Shot_2018-07-11_at_12.08.08_PM.png)' + state: merged + created_at: "2018-07-11T17:08:41.143Z" + updated_at: "2018-07-11T17:39:06.035Z" + source_branch: fix-mr-widget-border + target_branch: master + source_project_id: 13083 + target_project_id: 13083 + sha: 0cf9af01ce5c6db84aba8d40defc0cb03cb6e75f + merge_commit_sha: a781d0f9b2b89f5a3fa33dc72fcefb485f2078ce + merge_status: can_be_merged + merge_when_pipeline_succeeds: true + should_remove_source_branch: true + force_remove_source_branch: true + user_notes_count: 2 + author: + id: 201566 + username: annabeldunstone + name: Annabel Gray + state: active + avatar_url: https://assets.gitlab-static.net/uploads/-/system/user/avatar/201566/avatar.png + web_url: https://gitlab.com/annabeldunstone + assignee: + id: 482476 + username: filipa + name: Filipa Lacerda + state: active + avatar_url: https://assets.gitlab-static.net/uploads/-/system/user/avatar/482476/avatar.png + web_url: https://gitlab.com/filipa + labels: + - Pick into 11.1 + - frontend + - regression + time_stats: {} + milestone: + id: 450583 + iid: 13 + group_id: 9970 + title: "11.1" + state: active + updated_at: "2018-03-01T19:52:29.776Z" + created_at: "2018-01-23T21:40:27.318Z" + due_date: "2018-07-22" + start_date: "2018-06-08" + web_url: https://gitlab.com/groups/gitlab-org/-/milestones/13 +- id: 13925353 + iid: 20561 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20561 + title: 'Resolve "QA: False failure on QA test "Push to protected branch when allowed" + during staging failover rehearsal"' + description: |- + ## What does this MR do? + + This ensure the external encoding is set to UTF-8 when running QA specs. + + ## Are there points in the code the reviewer needs to double check? + + If QA passes I guess that's it. + + ## Does this MR meet the acceptance criteria? + + - Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html) + - [ ] Has been reviewed by a Backend maintainer + - [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html) + - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides) + - [x] Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides) + - [x] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) + - [ ] End-to-end tests pass (`package-and-qa` manual pipeline job) + + ## What are the relevant issue numbers? + + Closes #48241 + state: opened + created_at: "2018-07-11T17:02:36.349Z" + updated_at: "2018-07-11T17:03:50.347Z" + source_branch: 48241-fix-invalid-byte-sequence-in-qa + target_branch: master + source_project_id: 13083 + target_project_id: 13083 + sha: c9a27a42f0e07799bedfbc49af711dc84449ad17 + merge_status: can_be_merged + force_remove_source_branch: true + user_notes_count: 1 + author: + id: 128633 + username: rymai + name: Rémy Coutable + state: active + avatar_url: https://secure.gravatar.com/avatar/263da227929cc0035cb0eba512bcf81a?s=80&d=identicon + web_url: https://gitlab.com/rymai + assignee: + id: 128633 + username: rymai + name: Rémy Coutable + state: active + avatar_url: https://secure.gravatar.com/avatar/263da227929cc0035cb0eba512bcf81a?s=80&d=identicon + web_url: https://gitlab.com/rymai + labels: + - QA + - Quality + - bug + time_stats: {} + milestone: + id: 494367 + iid: 15 + group_id: 9970 + title: "11.2" + state: active + updated_at: "2018-03-27T19:28:34.472Z" + created_at: "2018-03-27T19:26:05.990Z" + due_date: "2018-08-22" + start_date: "2018-07-08" + web_url: https://gitlab.com/groups/gitlab-org/-/milestones/15 +- id: 13924879 + iid: 20560 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20560 + title: Revert "Merge branch 'ee-5481-epic-todos' into 'master'" + description: Revert of https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/19908 + state: merged + created_at: "2018-07-11T16:34:45.542Z" + updated_at: "2018-07-11T20:08:18.664Z" + source_branch: revert-todos-epic + target_branch: master + source_project_id: 13083 + target_project_id: 13083 + sha: 8717c7dad9b5a8fa21ec9a652c54718a6b4c2175 + merge_commit_sha: 9591fdbed7c14712986a8308036787481bbb3bc0 + merge_status: can_be_merged + merge_when_pipeline_succeeds: true + should_remove_source_branch: true + user_notes_count: 1 + author: + id: 508743 + username: jarka + name: Jarka Kadlecová + state: active + avatar_url: https://secure.gravatar.com/avatar/3931dae84deb01d2881e4909077b8dbe?s=80&d=identicon + web_url: https://gitlab.com/jarka + assignee: + id: 209240 + username: yorickpeterse + name: Yorick Peterse + state: active + avatar_url: https://secure.gravatar.com/avatar/644bcc0c58aa01920c4de4f941afcac9?s=80&d=identicon + web_url: https://gitlab.com/yorickpeterse + labels: + - Discussion + - bug + time_stats: {} + milestone: + id: 450583 + iid: 13 + group_id: 9970 + title: "11.1" + state: active + updated_at: "2018-03-01T19:52:29.776Z" + created_at: "2018-01-23T21:40:27.318Z" + due_date: "2018-07-22" + start_date: "2018-06-08" + web_url: https://gitlab.com/groups/gitlab-org/-/milestones/13 diff --git a/integration/snapshots/ls_groups_verbose.snap b/integration/snapshots/ls_groups_verbose.snap index 6e7476d..2258bfd 100644 --- a/integration/snapshots/ls_groups_verbose.snap +++ b/integration/snapshots/ls_groups_verbose.snap @@ -13,8 +13,8 @@ Response meta StatusCode 200 Request id Runtime 0.000000 - Page 0 - Items per page 0 + Page 1 + Items per page 10 Previous page 0 Next page 0 Total pages 0 diff --git a/integration/snapshots/ls_help.snap b/integration/snapshots/ls_help.snap index 0baaa80..3a535fb 100644 --- a/integration/snapshots/ls_help.snap +++ b/integration/snapshots/ls_help.snap @@ -22,6 +22,8 @@ Available Commands: project-vars Get list of a project's variables projects List projects runners List runners + ssh-keys List current user ssh keys + user-ssh-keys List specific user ssh keys users List users Flags: diff --git a/integration/snapshots/ls_merge_requests.snap b/integration/snapshots/ls_merge_requests.snap new file mode 100644 index 0000000..b95918f --- /dev/null +++ b/integration/snapshots/ls_merge_requests.snap @@ -0,0 +1,29 @@ +Fetching merge requests… + +| PROJECT ID | ID | TITLE | SOURCE | TARGET | STATE | ASSIGNEE | WIP | MERGE STATUS | CREATED AT | ++------------+----------+--------------------------------+----------------------------------------------------------------+--------+--------+---------------+-------+------------------+--------------------------+ +| 13083 | 13932943 | WIP: Fix autosave issues for | _acet-fix-mr-autosave | master | opened | fatihacet | true | can_be_merged | 2018-07-11T22:39:55.571Z | +| | | MR discussions | | | | | | | | +| 13083 | 13932747 | add initial smoke tests and | qa-smoke-tests | master | opened | meks | false | can_be_merged | 2018-07-11T22:18:59.366Z | +| | | documentation | | | | | | | | +| 13083 | 13931916 | WIP: Resolve "Remove ghost | 44824-remove-ghost-notification-settings-for-group-and-project | master | opened | jacopo-beschi | true | cannot_be_merged | 2018-07-11T21:06:10.653Z | +| | | notification settings for | | | | | | | | +| | | groups and projects" | | | | | | | | +| 13083 | 13929701 | Fix archived parameter for | fix-project-api-archived | master | opened | | false | can_be_merged | 2018-07-11T19:55:40.907Z | +| | | projects API | | | | | | | | +| 13083 | 13929032 | Remove healthchecks from | an/no-healthcheck-until-brooklyn | master | opened | | false | can_be_merged | 2018-07-11T19:08:21.900Z | +| | | prometheus endpoint | | | | | | | | +| 13083 | 13928405 | Revert "Log push output on | mk/remove-push-output-logging | master | opened | rymai | false | can_be_merged | 2018-07-11T18:44:19.250Z | +| | | exception" because it is no | | | | | | | | +| | | longer needed | | | | | | | | +| 13083 | 13927668 | Resolve "Follow-up from | 48690-follow-up-from-milestone-tests | master | opened | rymai | false | can_be_merged | 2018-07-11T18:17:37.205Z | +| | | "Milestone tests"" | | | | | | | | +| 13083 | 13925429 | Fix MR widget border | fix-mr-widget-border | master | merged | filipa | false | can_be_merged | 2018-07-11T17:08:41.143Z | +| 13083 | 13925353 | Resolve "QA: False failure | 48241-fix-invalid-byte-sequence-in-qa | master | opened | rymai | false | can_be_merged | 2018-07-11T17:02:36.349Z | +| | | on QA test "Push to protected | | | | | | | | +| | | branch when allowed" during | | | | | | | | +| | | staging failover rehearsal" | | | | | | | | +| 13083 | 13924879 | Revert "Merge branch | revert-todos-epic | master | merged | yorickpeterse | false | can_be_merged | 2018-07-11T16:34:45.542Z | +| | | 'ee-5481-epic-todos' into | | | | | | | | +| | | 'master'" | | | | | | | | + diff --git a/integration/snapshots/ls_merge_requests_help.snap b/integration/snapshots/ls_merge_requests_help.snap new file mode 100644 index 0000000..2884de5 --- /dev/null +++ b/integration/snapshots/ls_merge_requests_help.snap @@ -0,0 +1,22 @@ +List merge requests + +Usage: + glc ls merge-requests [flags] + +Aliases: + merge-requests, mr + +Flags: + -h, --help help for merge-requests + +Global Flags: + -a, --alias string Use resource alias + -c, --config string Path to configuration file (default ".glc.yml") + -i, --interactive enable interactive mode when applicable (eg. creation, pagination) + --no-color disable color output + -o, --output-destination string Output result to file if specified + -f, --output-format string Output format, must be one of 'text', 'json', 'yaml' + -p, --page int Page (default 1) + -l, --per-page int Items per page (default 10) + --silent silent mode + -v, --verbose verbose output diff --git a/integration/snapshots/ls_merge_requests_json.snap b/integration/snapshots/ls_merge_requests_json.snap new file mode 100644 index 0000000..84c4cf7 --- /dev/null +++ b/integration/snapshots/ls_merge_requests_json.snap @@ -0,0 +1,466 @@ +Fetching merge requests… +[ + { + "id": 13932943, + "iid": 20569, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20569", + "title": "WIP: Fix autosave issues for MR discussions", + "description": "Fixes multiple autosave issues and ESC confirmations around noteable shared components and new MR discussions.\r\n\r\n### Fixes autosave issue in noteable shared components\r\n![_mr-autosave](/uploads/2997c1e1d745ccd70f8ccf6854e86b56/_mr-autosave.gif)\r\n\r\n### Fixes ESC confirmation and autosave issues in reply a discussion form\r\n![_mr-esc-confirm](/uploads/79f7c7aace864ce02bd680099c715fc2/_mr-esc-confirm.gif)\r\n\r\n### Adds ESC confirmation to new discussion form\r\n![_mr-esc-confirm2](/uploads/a4f3b3d41fb3b15db0e1a88f89264622/_mr-esc-confirm2.gif)\r\n\r\n\r\nFixes https://gitlab.com/gitlab-org/gitlab-ce/issues/48876 and https://gitlab.com/gitlab-org/gitlab-ce/issues/48877", + "state": "opened", + "created_at": "2018-07-11T22:39:55.571Z", + "updated_at": "2018-07-11T23:35:44.014Z", + "source_branch": "_acet-fix-mr-autosave", + "target_branch": "master", + "source_project_id": 13083, + "target_project_id": 13083, + "sha": "da788f233de489315e3155f170700c625af352c4", + "work_in_progress": true, + "merge_status": "can_be_merged", + "force_remove_source_branch": true, + "user_notes_count": 1, + "author": { + "id": 502136, + "username": "fatihacet", + "name": "Fatih Acet", + "state": "active", + "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/502136/avatar.png", + "web_url": "https://gitlab.com/fatihacet" + }, + "assignee": { + "id": 502136, + "username": "fatihacet", + "name": "Fatih Acet", + "state": "active", + "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/502136/avatar.png", + "web_url": "https://gitlab.com/fatihacet" + }, + "labels": [ + "Discussion", + "Pick into 11.1", + "bug", + "frontend", + "mr refactor", + "regression", + "reproduced on GitLab.com" + ], + "time_stats": {}, + "milestone": { + "id": 450583, + "iid": 13, + "group_id": 9970, + "title": "11.1", + "state": "active", + "updated_at": "2018-03-01T19:52:29.776Z", + "created_at": "2018-01-23T21:40:27.318Z", + "due_date": "2018-07-22", + "start_date": "2018-06-08", + "web_url": "https://gitlab.com/groups/gitlab-org/-/milestones/13" + } + }, + { + "id": 13932747, + "iid": 20568, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20568", + "title": "add initial smoke tests and documentation", + "description": "## What does this MR do?\n\nAdds initial smoke test functionality for quick sanity testing from the UI.\n\n## Are there points in the code the reviewer needs to double check?\n\nThere will be a sister MR to this created in the [QA Repository](https://gitlab.com/gitlab-org/gitlab-qa) regarding documentation on *how to run* these smoke tests.\n\nWe can run them by using:\n\n`bin/qa Test::Smoke http://localhost:3000`\n\nI ran the \"smoke suite\" a couple times: here are my findings.\n\n| Time taken |\n|------------|\n| 50.9s |\n| 50.08s |\n| 50.78 |\n\n## Why was this MR needed?\n\nThis MR was created per discussions in https://gitlab.com/gitlab-org/gitlab-qa/issues/288\n\n## Does this MR meet the acceptance criteria?\n\n- [ ] [Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary\n- [x] [Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs)\n- [x] Tests added for this feature/bug\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\n - [ ] Has been reviewed by a Frontend maintainer\n - [ ] Has been reviewed by a Backend maintainer\n- [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\n- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\n- [ ] End-to-end tests pass (`package-and-qa` manual pipeline job)\n\n## What are the relevant issue numbers?\n\n- https://gitlab.com/gitlab-org/gitlab-qa/issues/288\n\n## Notes\n\nWe should of course expand this suite, perhaps adding more `describe` scenarios in our source base to what we believe should be constituted as a \"smoke test.\"\n\n/cc @gl\\-quality @rspeicher @grzesiek @stanhu", + "state": "opened", + "created_at": "2018-07-11T22:18:59.366Z", + "updated_at": "2018-07-11T22:19:01.327Z", + "source_branch": "qa-smoke-tests", + "target_branch": "master", + "source_project_id": 13083, + "target_project_id": 13083, + "sha": "2d06e080106b0d20adeda763bb5bc6beae2c8535", + "merge_status": "can_be_merged", + "author": { + "id": 272636, + "username": "ddavison", + "name": "Dan Davison", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/6e56557ffa1baafe3e73e45bd2dc9524?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/ddavison" + }, + "assignee": { + "id": 2097582, + "username": "meks", + "name": "Mek Stittri", + "state": "active", + "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/2097582/avatar.png", + "web_url": "https://gitlab.com/meks" + }, + "labels": [ + "Discussion", + "QA", + "Quality" + ], + "time_stats": {} + }, + { + "id": 13931916, + "iid": 20567, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20567", + "title": "WIP: Resolve \"Remove ghost notification settings for groups and projects\"", + "description": "## What does this MR do?\n\n## Are there points in the code the reviewer needs to double check?\n\n## Why was this MR needed?\n\n## Screenshots (if relevant)\n\n## Does this MR meet the acceptance criteria?\n\n- [x] [Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary\n- [ ] [Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs)\n- [ ] API support added\n- [x] Tests added for this feature/bug\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\n - [ ] Has been reviewed by a UX Designer\n - [ ] Has been reviewed by a Frontend maintainer\n - [ ] Has been reviewed by a Backend maintainer\n - [ ] Has been reviewed by a Database specialist\n- [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\n- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\n- [x] Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides)\n- [ ] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)\n- [ ] Internationalization required/considered\n- [ ] End-to-end tests pass (`package-and-qa` manual pipeline job)\n\n## What are the relevant issue numbers?\n\n\nCloses #44824", + "state": "opened", + "created_at": "2018-07-11T21:06:10.653Z", + "updated_at": "2018-07-11T21:06:43.081Z", + "source_branch": "44824-remove-ghost-notification-settings-for-group-and-project", + "target_branch": "master", + "source_project_id": 1915107, + "target_project_id": 13083, + "sha": "4cf0900526027785658829666f235349bafe4475", + "work_in_progress": true, + "merge_status": "cannot_be_merged", + "squash": true, + "force_remove_source_branch": true, + "author": { + "id": 331646, + "username": "jacopo-beschi", + "name": "🙈 jacopo beschi 🙉", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/692fb66988ac3863f360e846c1afc4f3?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/jacopo-beschi" + }, + "assignee": { + "id": 331646, + "username": "jacopo-beschi", + "name": "🙈 jacopo beschi 🙉", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/692fb66988ac3863f360e846c1afc4f3?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/jacopo-beschi" + }, + "time_stats": {} + }, + { + "id": 13929701, + "iid": 20566, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20566", + "title": "Fix archived parameter for projects API", + "description": "## What does this MR do?\n\nFixes a regression where the archived parameter is incorrectly applied to the projects finder.\n\n## Are there points in the code the reviewer needs to double check?\n\nIt changes default (but incorrect per spec) API behavior which is in place for 1,5 years.\nCurrently without `archived` parameter only active projects are returned (so filter `archived=false` is incorrectly applied).\nThe current default API behavior matches GUI behavior, however it's not possible to filter archived projects only via API (which is possible via GUI).\n\nThis MR replaces !17244 (from @razer6), which is un-maintained for last 5 months due to contributor inactivity.\nThe code from that MR is refreshed and remaining open comments are implemented.\n\n## Why was this MR needed?\n\nSee discussions in #32301 and !17244\n\n## Does this MR meet the acceptance criteria?\n\n- [x] [Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary\n- [x] [Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs)\n- [x] API support added\n- [x] Tests added for this feature/bug\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\n - [ ] Has been reviewed by a UX Designer\n - [ ] Has been reviewed by a Frontend maintainer\n - [ ] Has been reviewed by a Backend maintainer\n - [ ] Has been reviewed by a Database specialist\n- [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\n- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\n- [x] Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides)\n- [x] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)\n- [x] Internationalization required/considered\n- [ ] End-to-end tests pass (`package-and-qa` manual pipeline job)\n\n## What are the relevant issue numbers?\n\nCloses #32301", + "state": "opened", + "created_at": "2018-07-11T19:55:40.907Z", + "updated_at": "2018-07-11T20:00:23.499Z", + "source_branch": "fix-project-api-archived", + "target_branch": "master", + "source_project_id": 904528, + "target_project_id": 13083, + "sha": "4fd3d6ed3bf663f8d978db62fb1f552c529e2950", + "merge_status": "can_be_merged", + "force_remove_source_branch": true, + "author": { + "id": 1334624, + "username": "petermarko", + "name": "Peter Marko", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/28cbcbcb84533b9f8afc75521bdc457e?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/petermarko" + }, + "time_stats": {} + }, + { + "id": 13929032, + "iid": 20565, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20565", + "title": "Remove healthchecks from prometheus endpoint", + "description": "## What does this MR do?\r\n\r\n- Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/49112\r\n\r\n## Are there points in the code the reviewer needs to double check?\r\n\r\n```shell\r\n# Simulate a Gitaly server under extreme load....\r\n$ lldb -p $(pgrep gitaly) \u0026 \r\n\r\n# Without this fix: Prometheus scrape endpoint times out after ~55s with a 500 error\r\n$ time curl http://localhost:3000/-/metrics\r\nNameError at /-/metrics\r\n=======================\r\n\r\n\u003e uninitialized constant GRPC::GRPC\r\n...\r\nreal\t0m58.135s\r\nuser\t0m0.014s\r\nsys\t0m0.016s\r\n\r\n# With this fix: Prometheus scrape endpoint returns the prometheus metrics successfully, immediately\r\n$ time curl http://localhost:3000/-/metrics\r\nclient_browser_timing_count{event=\"contentComplete\"} 40\r\n# HELP client_browser_timing Multiprocess metric\r\n# TYPE client_browser_timing histogram\r\nclient_browser_timing_bucket{event=\"connect\",le=\"+Inf\"} 40\r\nclient_browser_timing_bucket{event=\"connect\",le=\"0.005\"} 40\r\n...\r\n\r\nreal\t0m0.607s\r\nuser\t0m0.020s\r\nsys\t0m0.027s\r\n\r\n```\r\n\r\n## Why was this MR needed?\r\n\r\nSimilar reasons as https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20552:\r\n\r\n\u003e When any single Gitaly server fails, up to 50% of the web and api fleet workload is saturated by prometheus healthcheck requests, which happen 4 times a minute on each node, with each request currently taking almost a full minute, before failing with a 500 error.\r\n\r\nWith this fix: when any single Gitaly server fails: the prometheus endpoint will return immediately with the correct metrics and a 200 response.\r\n\r\n## Does this MR meet the acceptance criteria?\r\n\r\n- [ ] [Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary\r\n- [ ] [Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs)\r\n- [ ] API support added\r\n- [ ] Tests added for this feature/bug\r\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\r\n - [ ] Has been reviewed by a UX Designer\r\n - [ ] Has been reviewed by a Frontend maintainer\r\n - [ ] Has been reviewed by a Backend maintainer\r\n - [ ] Has been reviewed by a Database specialist\r\n- [ ] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\r\n- [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\r\n- [ ] Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides)\r\n- [ ] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)\r\n- [ ] Internationalization required/considered\r\n- [ ] End-to-end tests pass (`package-and-qa` manual pipeline job)\r\n\r\n## What are the relevant issue numbers?", + "state": "opened", + "created_at": "2018-07-11T19:08:21.900Z", + "updated_at": "2018-07-11T19:11:52.822Z", + "source_branch": "an/no-healthcheck-until-brooklyn", + "target_branch": "master", + "source_project_id": 13083, + "target_project_id": 13083, + "sha": "b4cc74f3b45ed206fdcfb021cbdbc8621807177c", + "merge_status": "can_be_merged", + "squash": true, + "force_remove_source_branch": true, + "user_notes_count": 1, + "author": { + "id": 895869, + "username": "andrewn", + "name": "Andrew Newdigate", + "state": "active", + "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/895869/avatar.png", + "web_url": "https://gitlab.com/andrewn" + }, + "labels": [ + "Gitaly", + "availability", + "performance" + ], + "time_stats": {}, + "milestone": { + "id": 450583, + "iid": 13, + "group_id": 9970, + "title": "11.1", + "state": "active", + "updated_at": "2018-03-01T19:52:29.776Z", + "created_at": "2018-01-23T21:40:27.318Z", + "due_date": "2018-07-22", + "start_date": "2018-06-08", + "web_url": "https://gitlab.com/groups/gitlab-org/-/milestones/13" + } + }, + { + "id": 13928405, + "iid": 20564, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20564", + "title": "Revert \"Log push output on exception\" because it is no longer needed", + "description": "## What does this MR do?\n\nWe have successfully diagnosed https://gitlab.com/gitlab-org/gitlab-ce/issues/48241, so this logging is no longer needed.\n\n## Does this MR meet the acceptance criteria?\n\n- ~~[Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary~~\n- ~~[Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs)~~\n- ~~API support added~~\n- ~~Tests added for this feature/bug~~\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\n - [ ] Has been reviewed by a Backend maintainer\n- ~~Conform by the [merge request performance guides]~~(https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\n- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\n- ~~Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides)~~\n- [x] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)\n- ~~Internationalization required/considered~~\n- [x] End-to-end tests pass (`package-and-qa` manual pipeline job)\n\n## What are the relevant issue numbers?\n\nhttps://gitlab.com/gitlab-org/gitlab-ce/issues/48241", + "state": "opened", + "created_at": "2018-07-11T18:44:19.250Z", + "updated_at": "2018-07-11T21:48:31.133Z", + "source_branch": "mk/remove-push-output-logging", + "target_branch": "master", + "source_project_id": 13083, + "target_project_id": 13083, + "sha": "2555bf5ee35862a9f940d3004e3b9f7bdf196e12", + "merge_status": "can_be_merged", + "squash": true, + "force_remove_source_branch": true, + "user_notes_count": 1, + "author": { + "id": 1144264, + "username": "mkozono", + "name": "Michael Kozono", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/ddaa576b4b6933a6fb7a996088c30f6c?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/mkozono" + }, + "assignee": { + "id": 128633, + "username": "rymai", + "name": "Rémy Coutable", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/263da227929cc0035cb0eba512bcf81a?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/rymai" + }, + "labels": [ + "Quality", + "technical debt" + ], + "time_stats": {} + }, + { + "id": 13927668, + "iid": 20563, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20563", + "title": "Resolve \"Follow-up from \"Milestone tests\"\"", + "description": "## What does this MR do?\n\nThis MR extracts the `has_milestone?` method out of `QA::Page::MergeRequest::Show` and into `QA::Page::Issuable::Sidebar`. \n\n## Does this MR meet the acceptance criteria?\n\n- [x] Tests added for this feature/bug\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\n - [ ] Has been reviewed by a Backend maintainer\n- [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\n- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\n- [ ] End-to-end tests pass (`package-and-qa` manual pipeline job)\n\n## What are the relevant issue numbers?\n\nCloses #48690", + "state": "opened", + "created_at": "2018-07-11T18:17:37.205Z", + "updated_at": "2018-07-11T18:27:01.373Z", + "source_branch": "48690-follow-up-from-milestone-tests", + "target_branch": "master", + "source_project_id": 13083, + "target_project_id": 13083, + "sha": "a825dc229a9b9ecb76dc6b88d7002afe29ff5781", + "merge_status": "can_be_merged", + "force_remove_source_branch": true, + "author": { + "id": 272636, + "username": "ddavison", + "name": "Dan Davison", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/6e56557ffa1baafe3e73e45bd2dc9524?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/ddavison" + }, + "assignee": { + "id": 128633, + "username": "rymai", + "name": "Rémy Coutable", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/263da227929cc0035cb0eba512bcf81a?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/rymai" + }, + "labels": [ + "QA", + "Quality", + "enhancement" + ], + "time_stats": {}, + "milestone": { + "id": 494367, + "iid": 15, + "group_id": 9970, + "title": "11.2", + "state": "active", + "updated_at": "2018-03-27T19:28:34.472Z", + "created_at": "2018-03-27T19:26:05.990Z", + "due_date": "2018-08-22", + "start_date": "2018-07-08", + "web_url": "https://gitlab.com/groups/gitlab-org/-/milestones/15" + } + }, + { + "id": 13925429, + "iid": 20562, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20562", + "title": "Fix MR widget border", + "description": "![Screen_Shot_2018-07-11_at_12.08.08_PM](/uploads/58608375fdec4ae03fa245ef17e8adea/Screen_Shot_2018-07-11_at_12.08.08_PM.png)", + "state": "merged", + "created_at": "2018-07-11T17:08:41.143Z", + "updated_at": "2018-07-11T17:39:06.035Z", + "source_branch": "fix-mr-widget-border", + "target_branch": "master", + "source_project_id": 13083, + "target_project_id": 13083, + "sha": "0cf9af01ce5c6db84aba8d40defc0cb03cb6e75f", + "merge_commit_sha": "a781d0f9b2b89f5a3fa33dc72fcefb485f2078ce", + "merge_status": "can_be_merged", + "merge_when_pipeline_succeeds": true, + "should_remove_source_branch": true, + "force_remove_source_branch": true, + "user_notes_count": 2, + "author": { + "id": 201566, + "username": "annabeldunstone", + "name": "Annabel Gray", + "state": "active", + "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/201566/avatar.png", + "web_url": "https://gitlab.com/annabeldunstone" + }, + "assignee": { + "id": 482476, + "username": "filipa", + "name": "Filipa Lacerda", + "state": "active", + "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/482476/avatar.png", + "web_url": "https://gitlab.com/filipa" + }, + "labels": [ + "Pick into 11.1", + "frontend", + "regression" + ], + "time_stats": {}, + "milestone": { + "id": 450583, + "iid": 13, + "group_id": 9970, + "title": "11.1", + "state": "active", + "updated_at": "2018-03-01T19:52:29.776Z", + "created_at": "2018-01-23T21:40:27.318Z", + "due_date": "2018-07-22", + "start_date": "2018-06-08", + "web_url": "https://gitlab.com/groups/gitlab-org/-/milestones/13" + } + }, + { + "id": 13925353, + "iid": 20561, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20561", + "title": "Resolve \"QA: False failure on QA test \"Push to protected branch when allowed\" during staging failover rehearsal\"", + "description": "## What does this MR do?\n\nThis ensure the external encoding is set to UTF-8 when running QA specs.\n\n## Are there points in the code the reviewer needs to double check?\n\nIf QA passes I guess that's it.\n\n## Does this MR meet the acceptance criteria?\n\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\n - [ ] Has been reviewed by a Backend maintainer\n- [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\n- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\n- [x] Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides)\n- [x] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)\n- [ ] End-to-end tests pass (`package-and-qa` manual pipeline job)\n\n## What are the relevant issue numbers?\n\nCloses #48241", + "state": "opened", + "created_at": "2018-07-11T17:02:36.349Z", + "updated_at": "2018-07-11T17:03:50.347Z", + "source_branch": "48241-fix-invalid-byte-sequence-in-qa", + "target_branch": "master", + "source_project_id": 13083, + "target_project_id": 13083, + "sha": "c9a27a42f0e07799bedfbc49af711dc84449ad17", + "merge_status": "can_be_merged", + "force_remove_source_branch": true, + "user_notes_count": 1, + "author": { + "id": 128633, + "username": "rymai", + "name": "Rémy Coutable", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/263da227929cc0035cb0eba512bcf81a?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/rymai" + }, + "assignee": { + "id": 128633, + "username": "rymai", + "name": "Rémy Coutable", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/263da227929cc0035cb0eba512bcf81a?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/rymai" + }, + "labels": [ + "QA", + "Quality", + "bug" + ], + "time_stats": {}, + "milestone": { + "id": 494367, + "iid": 15, + "group_id": 9970, + "title": "11.2", + "state": "active", + "updated_at": "2018-03-27T19:28:34.472Z", + "created_at": "2018-03-27T19:26:05.990Z", + "due_date": "2018-08-22", + "start_date": "2018-07-08", + "web_url": "https://gitlab.com/groups/gitlab-org/-/milestones/15" + } + }, + { + "id": 13924879, + "iid": 20560, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20560", + "title": "Revert \"Merge branch 'ee-5481-epic-todos' into 'master'\"", + "description": "Revert of https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/19908", + "state": "merged", + "created_at": "2018-07-11T16:34:45.542Z", + "updated_at": "2018-07-11T20:08:18.664Z", + "source_branch": "revert-todos-epic", + "target_branch": "master", + "source_project_id": 13083, + "target_project_id": 13083, + "sha": "8717c7dad9b5a8fa21ec9a652c54718a6b4c2175", + "merge_commit_sha": "9591fdbed7c14712986a8308036787481bbb3bc0", + "merge_status": "can_be_merged", + "merge_when_pipeline_succeeds": true, + "should_remove_source_branch": true, + "user_notes_count": 1, + "author": { + "id": 508743, + "username": "jarka", + "name": "Jarka Kadlecová", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/3931dae84deb01d2881e4909077b8dbe?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/jarka" + }, + "assignee": { + "id": 209240, + "username": "yorickpeterse", + "name": "Yorick Peterse", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/644bcc0c58aa01920c4de4f941afcac9?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/yorickpeterse" + }, + "labels": [ + "Discussion", + "bug" + ], + "time_stats": {}, + "milestone": { + "id": 450583, + "iid": 13, + "group_id": 9970, + "title": "11.1", + "state": "active", + "updated_at": "2018-03-01T19:52:29.776Z", + "created_at": "2018-01-23T21:40:27.318Z", + "due_date": "2018-07-22", + "start_date": "2018-06-08", + "web_url": "https://gitlab.com/groups/gitlab-org/-/milestones/13" + } + } +] \ No newline at end of file diff --git a/integration/snapshots/ls_merge_requests_verbose.snap b/integration/snapshots/ls_merge_requests_verbose.snap new file mode 100644 index 0000000..a736543 --- /dev/null +++ b/integration/snapshots/ls_merge_requests_verbose.snap @@ -0,0 +1,44 @@ +Fetching merge requests… + +| PROJECT ID | ID | TITLE | SOURCE | TARGET | STATE | ASSIGNEE | WIP | MERGE STATUS | CREATED AT | ++------------+----------+--------------------------------+----------------------------------------------------------------+--------+--------+---------------+-------+------------------+--------------------------+ +| 13083 | 13932943 | WIP: Fix autosave issues for | _acet-fix-mr-autosave | master | opened | fatihacet | true | can_be_merged | 2018-07-11T22:39:55.571Z | +| | | MR discussions | | | | | | | | +| 13083 | 13932747 | add initial smoke tests and | qa-smoke-tests | master | opened | meks | false | can_be_merged | 2018-07-11T22:18:59.366Z | +| | | documentation | | | | | | | | +| 13083 | 13931916 | WIP: Resolve "Remove ghost | 44824-remove-ghost-notification-settings-for-group-and-project | master | opened | jacopo-beschi | true | cannot_be_merged | 2018-07-11T21:06:10.653Z | +| | | notification settings for | | | | | | | | +| | | groups and projects" | | | | | | | | +| 13083 | 13929701 | Fix archived parameter for | fix-project-api-archived | master | opened | | false | can_be_merged | 2018-07-11T19:55:40.907Z | +| | | projects API | | | | | | | | +| 13083 | 13929032 | Remove healthchecks from | an/no-healthcheck-until-brooklyn | master | opened | | false | can_be_merged | 2018-07-11T19:08:21.900Z | +| | | prometheus endpoint | | | | | | | | +| 13083 | 13928405 | Revert "Log push output on | mk/remove-push-output-logging | master | opened | rymai | false | can_be_merged | 2018-07-11T18:44:19.250Z | +| | | exception" because it is no | | | | | | | | +| | | longer needed | | | | | | | | +| 13083 | 13927668 | Resolve "Follow-up from | 48690-follow-up-from-milestone-tests | master | opened | rymai | false | can_be_merged | 2018-07-11T18:17:37.205Z | +| | | "Milestone tests"" | | | | | | | | +| 13083 | 13925429 | Fix MR widget border | fix-mr-widget-border | master | merged | filipa | false | can_be_merged | 2018-07-11T17:08:41.143Z | +| 13083 | 13925353 | Resolve "QA: False failure | 48241-fix-invalid-byte-sequence-in-qa | master | opened | rymai | false | can_be_merged | 2018-07-11T17:02:36.349Z | +| | | on QA test "Push to protected | | | | | | | | +| | | branch when allowed" during | | | | | | | | +| | | staging failover rehearsal" | | | | | | | | +| 13083 | 13924879 | Revert "Merge branch | revert-todos-epic | master | merged | yorickpeterse | false | can_be_merged | 2018-07-11T16:34:45.542Z | +| | | 'ee-5481-epic-todos' into | | | | | | | | +| | | 'master'" | | | | | | | | + + +Response meta + + Method GET + Url http://wiremock:8080/api/v4/merge_requests?page=1&per_page=10 + StatusCode 200 + Request id + Runtime 0.000000 + Page 1 + Items per page 10 + Previous page 0 + Next page 0 + Total pages 0 + Total 0 + diff --git a/integration/snapshots/ls_merge_requests_yaml.snap b/integration/snapshots/ls_merge_requests_yaml.snap new file mode 100644 index 0000000..8474545 --- /dev/null +++ b/integration/snapshots/ls_merge_requests_yaml.snap @@ -0,0 +1,613 @@ +Fetching merge requests… +- id: 13932943 + iid: 20569 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20569 + title: 'WIP: Fix autosave issues for MR discussions' + description: "Fixes multiple autosave issues and ESC confirmations around noteable + shared components and new MR discussions.\r\n\r\n### Fixes autosave issue in noteable + shared components\r\n![_mr-autosave](/uploads/2997c1e1d745ccd70f8ccf6854e86b56/_mr-autosave.gif)\r\n\r\n### + Fixes ESC confirmation and autosave issues in reply a discussion form\r\n![_mr-esc-confirm](/uploads/79f7c7aace864ce02bd680099c715fc2/_mr-esc-confirm.gif)\r\n\r\n### + Adds ESC confirmation to new discussion form\r\n![_mr-esc-confirm2](/uploads/a4f3b3d41fb3b15db0e1a88f89264622/_mr-esc-confirm2.gif)\r\n\r\n\r\nFixes + https://gitlab.com/gitlab-org/gitlab-ce/issues/48876 and https://gitlab.com/gitlab-org/gitlab-ce/issues/48877" + state: opened + created_at: "2018-07-11T22:39:55.571Z" + updated_at: "2018-07-11T23:35:44.014Z" + source_branch: _acet-fix-mr-autosave + target_branch: master + source_project_id: 13083 + target_project_id: 13083 + sha: da788f233de489315e3155f170700c625af352c4 + work_in_progress: true + merge_status: can_be_merged + force_remove_source_branch: true + user_notes_count: 1 + author: + id: 502136 + username: fatihacet + name: Fatih Acet + state: active + avatar_url: https://assets.gitlab-static.net/uploads/-/system/user/avatar/502136/avatar.png + web_url: https://gitlab.com/fatihacet + assignee: + id: 502136 + username: fatihacet + name: Fatih Acet + state: active + avatar_url: https://assets.gitlab-static.net/uploads/-/system/user/avatar/502136/avatar.png + web_url: https://gitlab.com/fatihacet + labels: + - Discussion + - Pick into 11.1 + - bug + - frontend + - mr refactor + - regression + - reproduced on GitLab.com + time_stats: {} + milestone: + id: 450583 + iid: 13 + group_id: 9970 + title: "11.1" + state: active + updated_at: "2018-03-01T19:52:29.776Z" + created_at: "2018-01-23T21:40:27.318Z" + due_date: "2018-07-22" + start_date: "2018-06-08" + web_url: https://gitlab.com/groups/gitlab-org/-/milestones/13 +- id: 13932747 + iid: 20568 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20568 + title: add initial smoke tests and documentation + description: |- + ## What does this MR do? + + Adds initial smoke test functionality for quick sanity testing from the UI. + + ## Are there points in the code the reviewer needs to double check? + + There will be a sister MR to this created in the [QA Repository](https://gitlab.com/gitlab-org/gitlab-qa) regarding documentation on *how to run* these smoke tests. + + We can run them by using: + + `bin/qa Test::Smoke http://localhost:3000` + + I ran the "smoke suite" a couple times: here are my findings. + + | Time taken | + |------------| + | 50.9s | + | 50.08s | + | 50.78 | + + ## Why was this MR needed? + + This MR was created per discussions in https://gitlab.com/gitlab-org/gitlab-qa/issues/288 + + ## Does this MR meet the acceptance criteria? + + - [ ] [Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary + - [x] [Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs) + - [x] Tests added for this feature/bug + - Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html) + - [ ] Has been reviewed by a Frontend maintainer + - [ ] Has been reviewed by a Backend maintainer + - [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html) + - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides) + - [ ] End-to-end tests pass (`package-and-qa` manual pipeline job) + + ## What are the relevant issue numbers? + + - https://gitlab.com/gitlab-org/gitlab-qa/issues/288 + + ## Notes + + We should of course expand this suite, perhaps adding more `describe` scenarios in our source base to what we believe should be constituted as a "smoke test." + + /cc @gl\-quality @rspeicher @grzesiek @stanhu + state: opened + created_at: "2018-07-11T22:18:59.366Z" + updated_at: "2018-07-11T22:19:01.327Z" + source_branch: qa-smoke-tests + target_branch: master + source_project_id: 13083 + target_project_id: 13083 + sha: 2d06e080106b0d20adeda763bb5bc6beae2c8535 + merge_status: can_be_merged + author: + id: 272636 + username: ddavison + name: Dan Davison + state: active + avatar_url: https://secure.gravatar.com/avatar/6e56557ffa1baafe3e73e45bd2dc9524?s=80&d=identicon + web_url: https://gitlab.com/ddavison + assignee: + id: 2097582 + username: meks + name: Mek Stittri + state: active + avatar_url: https://assets.gitlab-static.net/uploads/-/system/user/avatar/2097582/avatar.png + web_url: https://gitlab.com/meks + labels: + - Discussion + - QA + - Quality + time_stats: {} +- id: 13931916 + iid: 20567 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20567 + title: 'WIP: Resolve "Remove ghost notification settings for groups and projects"' + description: |- + ## What does this MR do? + + ## Are there points in the code the reviewer needs to double check? + + ## Why was this MR needed? + + ## Screenshots (if relevant) + + ## Does this MR meet the acceptance criteria? + + - [x] [Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary + - [ ] [Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs) + - [ ] API support added + - [x] Tests added for this feature/bug + - Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html) + - [ ] Has been reviewed by a UX Designer + - [ ] Has been reviewed by a Frontend maintainer + - [ ] Has been reviewed by a Backend maintainer + - [ ] Has been reviewed by a Database specialist + - [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html) + - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides) + - [x] Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides) + - [ ] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) + - [ ] Internationalization required/considered + - [ ] End-to-end tests pass (`package-and-qa` manual pipeline job) + + ## What are the relevant issue numbers? + + + Closes #44824 + state: opened + created_at: "2018-07-11T21:06:10.653Z" + updated_at: "2018-07-11T21:06:43.081Z" + source_branch: 44824-remove-ghost-notification-settings-for-group-and-project + target_branch: master + source_project_id: 1915107 + target_project_id: 13083 + sha: 4cf0900526027785658829666f235349bafe4475 + work_in_progress: true + merge_status: cannot_be_merged + squash: true + force_remove_source_branch: true + author: + id: 331646 + username: jacopo-beschi + name: "\U0001F648 jacopo beschi \U0001F649" + state: active + avatar_url: https://secure.gravatar.com/avatar/692fb66988ac3863f360e846c1afc4f3?s=80&d=identicon + web_url: https://gitlab.com/jacopo-beschi + assignee: + id: 331646 + username: jacopo-beschi + name: "\U0001F648 jacopo beschi \U0001F649" + state: active + avatar_url: https://secure.gravatar.com/avatar/692fb66988ac3863f360e846c1afc4f3?s=80&d=identicon + web_url: https://gitlab.com/jacopo-beschi + time_stats: {} +- id: 13929701 + iid: 20566 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20566 + title: Fix archived parameter for projects API + description: |- + ## What does this MR do? + + Fixes a regression where the archived parameter is incorrectly applied to the projects finder. + + ## Are there points in the code the reviewer needs to double check? + + It changes default (but incorrect per spec) API behavior which is in place for 1,5 years. + Currently without `archived` parameter only active projects are returned (so filter `archived=false` is incorrectly applied). + The current default API behavior matches GUI behavior, however it's not possible to filter archived projects only via API (which is possible via GUI). + + This MR replaces !17244 (from @razer6), which is un-maintained for last 5 months due to contributor inactivity. + The code from that MR is refreshed and remaining open comments are implemented. + + ## Why was this MR needed? + + See discussions in #32301 and !17244 + + ## Does this MR meet the acceptance criteria? + + - [x] [Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary + - [x] [Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs) + - [x] API support added + - [x] Tests added for this feature/bug + - Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html) + - [ ] Has been reviewed by a UX Designer + - [ ] Has been reviewed by a Frontend maintainer + - [ ] Has been reviewed by a Backend maintainer + - [ ] Has been reviewed by a Database specialist + - [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html) + - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides) + - [x] Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides) + - [x] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) + - [x] Internationalization required/considered + - [ ] End-to-end tests pass (`package-and-qa` manual pipeline job) + + ## What are the relevant issue numbers? + + Closes #32301 + state: opened + created_at: "2018-07-11T19:55:40.907Z" + updated_at: "2018-07-11T20:00:23.499Z" + source_branch: fix-project-api-archived + target_branch: master + source_project_id: 904528 + target_project_id: 13083 + sha: 4fd3d6ed3bf663f8d978db62fb1f552c529e2950 + merge_status: can_be_merged + force_remove_source_branch: true + author: + id: 1334624 + username: petermarko + name: Peter Marko + state: active + avatar_url: https://secure.gravatar.com/avatar/28cbcbcb84533b9f8afc75521bdc457e?s=80&d=identicon + web_url: https://gitlab.com/petermarko + time_stats: {} +- id: 13929032 + iid: 20565 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20565 + title: Remove healthchecks from prometheus endpoint + description: "## What does this MR do?\r\n\r\n- Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/49112\r\n\r\n## + Are there points in the code the reviewer needs to double check?\r\n\r\n```shell\r\n# + Simulate a Gitaly server under extreme load....\r\n$ lldb -p $(pgrep gitaly) & + \r\n\r\n# Without this fix: Prometheus scrape endpoint times out after ~55s with + a 500 error\r\n$ time curl http://localhost:3000/-/metrics\r\nNameError at /-/metrics\r\n=======================\r\n\r\n> + uninitialized constant GRPC::GRPC\r\n...\r\nreal\t0m58.135s\r\nuser\t0m0.014s\r\nsys\t0m0.016s\r\n\r\n# + With this fix: Prometheus scrape endpoint returns the prometheus metrics successfully, + immediately\r\n$ time curl http://localhost:3000/-/metrics\r\nclient_browser_timing_count{event=\"contentComplete\"} + 40\r\n# HELP client_browser_timing Multiprocess metric\r\n# TYPE client_browser_timing + histogram\r\nclient_browser_timing_bucket{event=\"connect\",le=\"+Inf\"} 40\r\nclient_browser_timing_bucket{event=\"connect\",le=\"0.005\"} + 40\r\n...\r\n\r\nreal\t0m0.607s\r\nuser\t0m0.020s\r\nsys\t0m0.027s\r\n\r\n```\r\n\r\n## + Why was this MR needed?\r\n\r\nSimilar reasons as https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20552:\r\n\r\n> + When any single Gitaly server fails, up to 50% of the web and api fleet workload + is saturated by prometheus healthcheck requests, which happen 4 times a minute + on each node, with each request currently taking almost a full minute, before + failing with a 500 error.\r\n\r\nWith this fix: when any single Gitaly server + fails: the prometheus endpoint will return immediately with the correct metrics + and a 200 response.\r\n\r\n## Does this MR meet the acceptance criteria?\r\n\r\n- + [ ] [Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, + if necessary\r\n- [ ] [Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs)\r\n- + [ ] API support added\r\n- [ ] Tests added for this feature/bug\r\n- Conform by + the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\r\n + \ - [ ] Has been reviewed by a UX Designer\r\n - [ ] Has been reviewed by a Frontend + maintainer\r\n - [ ] Has been reviewed by a Backend maintainer\r\n - [ ] Has + been reviewed by a Database specialist\r\n- [ ] Conform by the [merge request + performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\r\n- + [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\r\n- + [ ] Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides)\r\n- + [ ] If you have multiple commits, please combine them into a few logically organized + commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)\r\n- + [ ] Internationalization required/considered\r\n- [ ] End-to-end tests pass (`package-and-qa` + manual pipeline job)\r\n\r\n## What are the relevant issue numbers?" + state: opened + created_at: "2018-07-11T19:08:21.900Z" + updated_at: "2018-07-11T19:11:52.822Z" + source_branch: an/no-healthcheck-until-brooklyn + target_branch: master + source_project_id: 13083 + target_project_id: 13083 + sha: b4cc74f3b45ed206fdcfb021cbdbc8621807177c + merge_status: can_be_merged + squash: true + force_remove_source_branch: true + user_notes_count: 1 + author: + id: 895869 + username: andrewn + name: Andrew Newdigate + state: active + avatar_url: https://assets.gitlab-static.net/uploads/-/system/user/avatar/895869/avatar.png + web_url: https://gitlab.com/andrewn + labels: + - Gitaly + - availability + - performance + time_stats: {} + milestone: + id: 450583 + iid: 13 + group_id: 9970 + title: "11.1" + state: active + updated_at: "2018-03-01T19:52:29.776Z" + created_at: "2018-01-23T21:40:27.318Z" + due_date: "2018-07-22" + start_date: "2018-06-08" + web_url: https://gitlab.com/groups/gitlab-org/-/milestones/13 +- id: 13928405 + iid: 20564 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20564 + title: Revert "Log push output on exception" because it is no longer needed + description: |- + ## What does this MR do? + + We have successfully diagnosed https://gitlab.com/gitlab-org/gitlab-ce/issues/48241, so this logging is no longer needed. + + ## Does this MR meet the acceptance criteria? + + - ~~[Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary~~ + - ~~[Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs)~~ + - ~~API support added~~ + - ~~Tests added for this feature/bug~~ + - Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html) + - [ ] Has been reviewed by a Backend maintainer + - ~~Conform by the [merge request performance guides]~~(https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html) + - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides) + - ~~Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides)~~ + - [x] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) + - ~~Internationalization required/considered~~ + - [x] End-to-end tests pass (`package-and-qa` manual pipeline job) + + ## What are the relevant issue numbers? + + https://gitlab.com/gitlab-org/gitlab-ce/issues/48241 + state: opened + created_at: "2018-07-11T18:44:19.250Z" + updated_at: "2018-07-11T21:48:31.133Z" + source_branch: mk/remove-push-output-logging + target_branch: master + source_project_id: 13083 + target_project_id: 13083 + sha: 2555bf5ee35862a9f940d3004e3b9f7bdf196e12 + merge_status: can_be_merged + squash: true + force_remove_source_branch: true + user_notes_count: 1 + author: + id: 1144264 + username: mkozono + name: Michael Kozono + state: active + avatar_url: https://secure.gravatar.com/avatar/ddaa576b4b6933a6fb7a996088c30f6c?s=80&d=identicon + web_url: https://gitlab.com/mkozono + assignee: + id: 128633 + username: rymai + name: Rémy Coutable + state: active + avatar_url: https://secure.gravatar.com/avatar/263da227929cc0035cb0eba512bcf81a?s=80&d=identicon + web_url: https://gitlab.com/rymai + labels: + - Quality + - technical debt + time_stats: {} +- id: 13927668 + iid: 20563 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20563 + title: Resolve "Follow-up from "Milestone tests"" + description: "## What does this MR do?\n\nThis MR extracts the `has_milestone?` + method out of `QA::Page::MergeRequest::Show` and into `QA::Page::Issuable::Sidebar`. + \n\n## Does this MR meet the acceptance criteria?\n\n- [x] Tests added for this + feature/bug\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\n + \ - [ ] Has been reviewed by a Backend maintainer\n- [x] Conform by the [merge + request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\n- + [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\n- + [ ] End-to-end tests pass (`package-and-qa` manual pipeline job)\n\n## What are + the relevant issue numbers?\n\nCloses #48690" + state: opened + created_at: "2018-07-11T18:17:37.205Z" + updated_at: "2018-07-11T18:27:01.373Z" + source_branch: 48690-follow-up-from-milestone-tests + target_branch: master + source_project_id: 13083 + target_project_id: 13083 + sha: a825dc229a9b9ecb76dc6b88d7002afe29ff5781 + merge_status: can_be_merged + force_remove_source_branch: true + author: + id: 272636 + username: ddavison + name: Dan Davison + state: active + avatar_url: https://secure.gravatar.com/avatar/6e56557ffa1baafe3e73e45bd2dc9524?s=80&d=identicon + web_url: https://gitlab.com/ddavison + assignee: + id: 128633 + username: rymai + name: Rémy Coutable + state: active + avatar_url: https://secure.gravatar.com/avatar/263da227929cc0035cb0eba512bcf81a?s=80&d=identicon + web_url: https://gitlab.com/rymai + labels: + - QA + - Quality + - enhancement + time_stats: {} + milestone: + id: 494367 + iid: 15 + group_id: 9970 + title: "11.2" + state: active + updated_at: "2018-03-27T19:28:34.472Z" + created_at: "2018-03-27T19:26:05.990Z" + due_date: "2018-08-22" + start_date: "2018-07-08" + web_url: https://gitlab.com/groups/gitlab-org/-/milestones/15 +- id: 13925429 + iid: 20562 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20562 + title: Fix MR widget border + description: '![Screen_Shot_2018-07-11_at_12.08.08_PM](/uploads/58608375fdec4ae03fa245ef17e8adea/Screen_Shot_2018-07-11_at_12.08.08_PM.png)' + state: merged + created_at: "2018-07-11T17:08:41.143Z" + updated_at: "2018-07-11T17:39:06.035Z" + source_branch: fix-mr-widget-border + target_branch: master + source_project_id: 13083 + target_project_id: 13083 + sha: 0cf9af01ce5c6db84aba8d40defc0cb03cb6e75f + merge_commit_sha: a781d0f9b2b89f5a3fa33dc72fcefb485f2078ce + merge_status: can_be_merged + merge_when_pipeline_succeeds: true + should_remove_source_branch: true + force_remove_source_branch: true + user_notes_count: 2 + author: + id: 201566 + username: annabeldunstone + name: Annabel Gray + state: active + avatar_url: https://assets.gitlab-static.net/uploads/-/system/user/avatar/201566/avatar.png + web_url: https://gitlab.com/annabeldunstone + assignee: + id: 482476 + username: filipa + name: Filipa Lacerda + state: active + avatar_url: https://assets.gitlab-static.net/uploads/-/system/user/avatar/482476/avatar.png + web_url: https://gitlab.com/filipa + labels: + - Pick into 11.1 + - frontend + - regression + time_stats: {} + milestone: + id: 450583 + iid: 13 + group_id: 9970 + title: "11.1" + state: active + updated_at: "2018-03-01T19:52:29.776Z" + created_at: "2018-01-23T21:40:27.318Z" + due_date: "2018-07-22" + start_date: "2018-06-08" + web_url: https://gitlab.com/groups/gitlab-org/-/milestones/13 +- id: 13925353 + iid: 20561 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20561 + title: 'Resolve "QA: False failure on QA test "Push to protected branch when allowed" + during staging failover rehearsal"' + description: |- + ## What does this MR do? + + This ensure the external encoding is set to UTF-8 when running QA specs. + + ## Are there points in the code the reviewer needs to double check? + + If QA passes I guess that's it. + + ## Does this MR meet the acceptance criteria? + + - Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html) + - [ ] Has been reviewed by a Backend maintainer + - [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html) + - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides) + - [x] Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides) + - [x] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) + - [ ] End-to-end tests pass (`package-and-qa` manual pipeline job) + + ## What are the relevant issue numbers? + + Closes #48241 + state: opened + created_at: "2018-07-11T17:02:36.349Z" + updated_at: "2018-07-11T17:03:50.347Z" + source_branch: 48241-fix-invalid-byte-sequence-in-qa + target_branch: master + source_project_id: 13083 + target_project_id: 13083 + sha: c9a27a42f0e07799bedfbc49af711dc84449ad17 + merge_status: can_be_merged + force_remove_source_branch: true + user_notes_count: 1 + author: + id: 128633 + username: rymai + name: Rémy Coutable + state: active + avatar_url: https://secure.gravatar.com/avatar/263da227929cc0035cb0eba512bcf81a?s=80&d=identicon + web_url: https://gitlab.com/rymai + assignee: + id: 128633 + username: rymai + name: Rémy Coutable + state: active + avatar_url: https://secure.gravatar.com/avatar/263da227929cc0035cb0eba512bcf81a?s=80&d=identicon + web_url: https://gitlab.com/rymai + labels: + - QA + - Quality + - bug + time_stats: {} + milestone: + id: 494367 + iid: 15 + group_id: 9970 + title: "11.2" + state: active + updated_at: "2018-03-27T19:28:34.472Z" + created_at: "2018-03-27T19:26:05.990Z" + due_date: "2018-08-22" + start_date: "2018-07-08" + web_url: https://gitlab.com/groups/gitlab-org/-/milestones/15 +- id: 13924879 + iid: 20560 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20560 + title: Revert "Merge branch 'ee-5481-epic-todos' into 'master'" + description: Revert of https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/19908 + state: merged + created_at: "2018-07-11T16:34:45.542Z" + updated_at: "2018-07-11T20:08:18.664Z" + source_branch: revert-todos-epic + target_branch: master + source_project_id: 13083 + target_project_id: 13083 + sha: 8717c7dad9b5a8fa21ec9a652c54718a6b4c2175 + merge_commit_sha: 9591fdbed7c14712986a8308036787481bbb3bc0 + merge_status: can_be_merged + merge_when_pipeline_succeeds: true + should_remove_source_branch: true + user_notes_count: 1 + author: + id: 508743 + username: jarka + name: Jarka Kadlecová + state: active + avatar_url: https://secure.gravatar.com/avatar/3931dae84deb01d2881e4909077b8dbe?s=80&d=identicon + web_url: https://gitlab.com/jarka + assignee: + id: 209240 + username: yorickpeterse + name: Yorick Peterse + state: active + avatar_url: https://secure.gravatar.com/avatar/644bcc0c58aa01920c4de4f941afcac9?s=80&d=identicon + web_url: https://gitlab.com/yorickpeterse + labels: + - Discussion + - bug + time_stats: {} + milestone: + id: 450583 + iid: 13 + group_id: 9970 + title: "11.1" + state: active + updated_at: "2018-03-01T19:52:29.776Z" + created_at: "2018-01-23T21:40:27.318Z" + due_date: "2018-07-22" + start_date: "2018-06-08" + web_url: https://gitlab.com/groups/gitlab-org/-/milestones/13 diff --git a/integration/snapshots/ls_namespaces_verbose.snap b/integration/snapshots/ls_namespaces_verbose.snap index ad08ed0..2b7f0dd 100644 --- a/integration/snapshots/ls_namespaces_verbose.snap +++ b/integration/snapshots/ls_namespaces_verbose.snap @@ -14,8 +14,8 @@ Response meta StatusCode 200 Request id Runtime 0.000000 - Page 0 - Items per page 0 + Page 1 + Items per page 10 Previous page 0 Next page 0 Total pages 0 diff --git a/integration/snapshots/ls_project_merge_requests.snap b/integration/snapshots/ls_project_merge_requests.snap new file mode 100644 index 0000000..8748b0f --- /dev/null +++ b/integration/snapshots/ls_project_merge_requests.snap @@ -0,0 +1,29 @@ +Fetching project 1 merge requests… + +| PROJECT ID | ID | TITLE | SOURCE | TARGET | STATE | ASSIGNEE | WIP | MERGE STATUS | CREATED AT | ++------------+----------+--------------------------------+----------------------------------------------------------------+--------+--------+---------------+-------+------------------+--------------------------+ +| 13083 | 13932943 | WIP: Fix autosave issues for | _acet-fix-mr-autosave | master | opened | fatihacet | true | can_be_merged | 2018-07-11T22:39:55.571Z | +| | | MR discussions | | | | | | | | +| 13083 | 13932747 | add initial smoke tests and | qa-smoke-tests | master | opened | meks | false | can_be_merged | 2018-07-11T22:18:59.366Z | +| | | documentation | | | | | | | | +| 13083 | 13931916 | WIP: Resolve "Remove ghost | 44824-remove-ghost-notification-settings-for-group-and-project | master | opened | jacopo-beschi | true | cannot_be_merged | 2018-07-11T21:06:10.653Z | +| | | notification settings for | | | | | | | | +| | | groups and projects" | | | | | | | | +| 13083 | 13929701 | Fix archived parameter for | fix-project-api-archived | master | opened | | false | can_be_merged | 2018-07-11T19:55:40.907Z | +| | | projects API | | | | | | | | +| 13083 | 13929032 | Remove healthchecks from | an/no-healthcheck-until-brooklyn | master | opened | | false | can_be_merged | 2018-07-11T19:08:21.900Z | +| | | prometheus endpoint | | | | | | | | +| 13083 | 13928405 | Revert "Log push output on | mk/remove-push-output-logging | master | opened | rymai | false | can_be_merged | 2018-07-11T18:44:19.250Z | +| | | exception" because it is no | | | | | | | | +| | | longer needed | | | | | | | | +| 13083 | 13927668 | Resolve "Follow-up from | 48690-follow-up-from-milestone-tests | master | opened | rymai | false | can_be_merged | 2018-07-11T18:17:37.205Z | +| | | "Milestone tests"" | | | | | | | | +| 13083 | 13925429 | Fix MR widget border | fix-mr-widget-border | master | merged | filipa | false | can_be_merged | 2018-07-11T17:08:41.143Z | +| 13083 | 13925353 | Resolve "QA: False failure | 48241-fix-invalid-byte-sequence-in-qa | master | opened | rymai | false | can_be_merged | 2018-07-11T17:02:36.349Z | +| | | on QA test "Push to protected | | | | | | | | +| | | branch when allowed" during | | | | | | | | +| | | staging failover rehearsal" | | | | | | | | +| 13083 | 13924879 | Revert "Merge branch | revert-todos-epic | master | merged | yorickpeterse | false | can_be_merged | 2018-07-11T16:34:45.542Z | +| | | 'ee-5481-epic-todos' into | | | | | | | | +| | | 'master'" | | | | | | | | + diff --git a/integration/snapshots/ls_project_merge_requests_help.snap b/integration/snapshots/ls_project_merge_requests_help.snap new file mode 100644 index 0000000..b1e6a16 --- /dev/null +++ b/integration/snapshots/ls_project_merge_requests_help.snap @@ -0,0 +1,22 @@ +List project merge requests + +Usage: + glc ls project-merge-requests PROJECT_ID [flags] + +Aliases: + project-merge-requests, pmr + +Flags: + -h, --help help for project-merge-requests + +Global Flags: + -a, --alias string Use resource alias + -c, --config string Path to configuration file (default ".glc.yml") + -i, --interactive enable interactive mode when applicable (eg. creation, pagination) + --no-color disable color output + -o, --output-destination string Output result to file if specified + -f, --output-format string Output format, must be one of 'text', 'json', 'yaml' + -p, --page int Page (default 1) + -l, --per-page int Items per page (default 10) + --silent silent mode + -v, --verbose verbose output diff --git a/integration/snapshots/ls_project_merge_requests_json.snap b/integration/snapshots/ls_project_merge_requests_json.snap new file mode 100644 index 0000000..5069352 --- /dev/null +++ b/integration/snapshots/ls_project_merge_requests_json.snap @@ -0,0 +1,466 @@ +Fetching project 1 merge requests… +[ + { + "id": 13932943, + "iid": 20569, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20569", + "title": "WIP: Fix autosave issues for MR discussions", + "description": "Fixes multiple autosave issues and ESC confirmations around noteable shared components and new MR discussions.\r\n\r\n### Fixes autosave issue in noteable shared components\r\n![_mr-autosave](/uploads/2997c1e1d745ccd70f8ccf6854e86b56/_mr-autosave.gif)\r\n\r\n### Fixes ESC confirmation and autosave issues in reply a discussion form\r\n![_mr-esc-confirm](/uploads/79f7c7aace864ce02bd680099c715fc2/_mr-esc-confirm.gif)\r\n\r\n### Adds ESC confirmation to new discussion form\r\n![_mr-esc-confirm2](/uploads/a4f3b3d41fb3b15db0e1a88f89264622/_mr-esc-confirm2.gif)\r\n\r\n\r\nFixes https://gitlab.com/gitlab-org/gitlab-ce/issues/48876 and https://gitlab.com/gitlab-org/gitlab-ce/issues/48877", + "state": "opened", + "created_at": "2018-07-11T22:39:55.571Z", + "updated_at": "2018-07-11T23:35:44.014Z", + "source_branch": "_acet-fix-mr-autosave", + "target_branch": "master", + "source_project_id": 13083, + "target_project_id": 13083, + "sha": "da788f233de489315e3155f170700c625af352c4", + "work_in_progress": true, + "merge_status": "can_be_merged", + "force_remove_source_branch": true, + "user_notes_count": 1, + "author": { + "id": 502136, + "username": "fatihacet", + "name": "Fatih Acet", + "state": "active", + "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/502136/avatar.png", + "web_url": "https://gitlab.com/fatihacet" + }, + "assignee": { + "id": 502136, + "username": "fatihacet", + "name": "Fatih Acet", + "state": "active", + "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/502136/avatar.png", + "web_url": "https://gitlab.com/fatihacet" + }, + "labels": [ + "Discussion", + "Pick into 11.1", + "bug", + "frontend", + "mr refactor", + "regression", + "reproduced on GitLab.com" + ], + "time_stats": {}, + "milestone": { + "id": 450583, + "iid": 13, + "group_id": 9970, + "title": "11.1", + "state": "active", + "updated_at": "2018-03-01T19:52:29.776Z", + "created_at": "2018-01-23T21:40:27.318Z", + "due_date": "2018-07-22", + "start_date": "2018-06-08", + "web_url": "https://gitlab.com/groups/gitlab-org/-/milestones/13" + } + }, + { + "id": 13932747, + "iid": 20568, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20568", + "title": "add initial smoke tests and documentation", + "description": "## What does this MR do?\n\nAdds initial smoke test functionality for quick sanity testing from the UI.\n\n## Are there points in the code the reviewer needs to double check?\n\nThere will be a sister MR to this created in the [QA Repository](https://gitlab.com/gitlab-org/gitlab-qa) regarding documentation on *how to run* these smoke tests.\n\nWe can run them by using:\n\n`bin/qa Test::Smoke http://localhost:3000`\n\nI ran the \"smoke suite\" a couple times: here are my findings.\n\n| Time taken |\n|------------|\n| 50.9s |\n| 50.08s |\n| 50.78 |\n\n## Why was this MR needed?\n\nThis MR was created per discussions in https://gitlab.com/gitlab-org/gitlab-qa/issues/288\n\n## Does this MR meet the acceptance criteria?\n\n- [ ] [Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary\n- [x] [Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs)\n- [x] Tests added for this feature/bug\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\n - [ ] Has been reviewed by a Frontend maintainer\n - [ ] Has been reviewed by a Backend maintainer\n- [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\n- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\n- [ ] End-to-end tests pass (`package-and-qa` manual pipeline job)\n\n## What are the relevant issue numbers?\n\n- https://gitlab.com/gitlab-org/gitlab-qa/issues/288\n\n## Notes\n\nWe should of course expand this suite, perhaps adding more `describe` scenarios in our source base to what we believe should be constituted as a \"smoke test.\"\n\n/cc @gl\\-quality @rspeicher @grzesiek @stanhu", + "state": "opened", + "created_at": "2018-07-11T22:18:59.366Z", + "updated_at": "2018-07-11T22:19:01.327Z", + "source_branch": "qa-smoke-tests", + "target_branch": "master", + "source_project_id": 13083, + "target_project_id": 13083, + "sha": "2d06e080106b0d20adeda763bb5bc6beae2c8535", + "merge_status": "can_be_merged", + "author": { + "id": 272636, + "username": "ddavison", + "name": "Dan Davison", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/6e56557ffa1baafe3e73e45bd2dc9524?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/ddavison" + }, + "assignee": { + "id": 2097582, + "username": "meks", + "name": "Mek Stittri", + "state": "active", + "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/2097582/avatar.png", + "web_url": "https://gitlab.com/meks" + }, + "labels": [ + "Discussion", + "QA", + "Quality" + ], + "time_stats": {} + }, + { + "id": 13931916, + "iid": 20567, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20567", + "title": "WIP: Resolve \"Remove ghost notification settings for groups and projects\"", + "description": "## What does this MR do?\n\n## Are there points in the code the reviewer needs to double check?\n\n## Why was this MR needed?\n\n## Screenshots (if relevant)\n\n## Does this MR meet the acceptance criteria?\n\n- [x] [Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary\n- [ ] [Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs)\n- [ ] API support added\n- [x] Tests added for this feature/bug\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\n - [ ] Has been reviewed by a UX Designer\n - [ ] Has been reviewed by a Frontend maintainer\n - [ ] Has been reviewed by a Backend maintainer\n - [ ] Has been reviewed by a Database specialist\n- [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\n- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\n- [x] Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides)\n- [ ] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)\n- [ ] Internationalization required/considered\n- [ ] End-to-end tests pass (`package-and-qa` manual pipeline job)\n\n## What are the relevant issue numbers?\n\n\nCloses #44824", + "state": "opened", + "created_at": "2018-07-11T21:06:10.653Z", + "updated_at": "2018-07-11T21:06:43.081Z", + "source_branch": "44824-remove-ghost-notification-settings-for-group-and-project", + "target_branch": "master", + "source_project_id": 1915107, + "target_project_id": 13083, + "sha": "4cf0900526027785658829666f235349bafe4475", + "work_in_progress": true, + "merge_status": "cannot_be_merged", + "squash": true, + "force_remove_source_branch": true, + "author": { + "id": 331646, + "username": "jacopo-beschi", + "name": "🙈 jacopo beschi 🙉", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/692fb66988ac3863f360e846c1afc4f3?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/jacopo-beschi" + }, + "assignee": { + "id": 331646, + "username": "jacopo-beschi", + "name": "🙈 jacopo beschi 🙉", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/692fb66988ac3863f360e846c1afc4f3?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/jacopo-beschi" + }, + "time_stats": {} + }, + { + "id": 13929701, + "iid": 20566, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20566", + "title": "Fix archived parameter for projects API", + "description": "## What does this MR do?\n\nFixes a regression where the archived parameter is incorrectly applied to the projects finder.\n\n## Are there points in the code the reviewer needs to double check?\n\nIt changes default (but incorrect per spec) API behavior which is in place for 1,5 years.\nCurrently without `archived` parameter only active projects are returned (so filter `archived=false` is incorrectly applied).\nThe current default API behavior matches GUI behavior, however it's not possible to filter archived projects only via API (which is possible via GUI).\n\nThis MR replaces !17244 (from @razer6), which is un-maintained for last 5 months due to contributor inactivity.\nThe code from that MR is refreshed and remaining open comments are implemented.\n\n## Why was this MR needed?\n\nSee discussions in #32301 and !17244\n\n## Does this MR meet the acceptance criteria?\n\n- [x] [Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary\n- [x] [Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs)\n- [x] API support added\n- [x] Tests added for this feature/bug\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\n - [ ] Has been reviewed by a UX Designer\n - [ ] Has been reviewed by a Frontend maintainer\n - [ ] Has been reviewed by a Backend maintainer\n - [ ] Has been reviewed by a Database specialist\n- [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\n- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\n- [x] Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides)\n- [x] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)\n- [x] Internationalization required/considered\n- [ ] End-to-end tests pass (`package-and-qa` manual pipeline job)\n\n## What are the relevant issue numbers?\n\nCloses #32301", + "state": "opened", + "created_at": "2018-07-11T19:55:40.907Z", + "updated_at": "2018-07-11T20:00:23.499Z", + "source_branch": "fix-project-api-archived", + "target_branch": "master", + "source_project_id": 904528, + "target_project_id": 13083, + "sha": "4fd3d6ed3bf663f8d978db62fb1f552c529e2950", + "merge_status": "can_be_merged", + "force_remove_source_branch": true, + "author": { + "id": 1334624, + "username": "petermarko", + "name": "Peter Marko", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/28cbcbcb84533b9f8afc75521bdc457e?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/petermarko" + }, + "time_stats": {} + }, + { + "id": 13929032, + "iid": 20565, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20565", + "title": "Remove healthchecks from prometheus endpoint", + "description": "## What does this MR do?\r\n\r\n- Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/49112\r\n\r\n## Are there points in the code the reviewer needs to double check?\r\n\r\n```shell\r\n# Simulate a Gitaly server under extreme load....\r\n$ lldb -p $(pgrep gitaly) \u0026 \r\n\r\n# Without this fix: Prometheus scrape endpoint times out after ~55s with a 500 error\r\n$ time curl http://localhost:3000/-/metrics\r\nNameError at /-/metrics\r\n=======================\r\n\r\n\u003e uninitialized constant GRPC::GRPC\r\n...\r\nreal\t0m58.135s\r\nuser\t0m0.014s\r\nsys\t0m0.016s\r\n\r\n# With this fix: Prometheus scrape endpoint returns the prometheus metrics successfully, immediately\r\n$ time curl http://localhost:3000/-/metrics\r\nclient_browser_timing_count{event=\"contentComplete\"} 40\r\n# HELP client_browser_timing Multiprocess metric\r\n# TYPE client_browser_timing histogram\r\nclient_browser_timing_bucket{event=\"connect\",le=\"+Inf\"} 40\r\nclient_browser_timing_bucket{event=\"connect\",le=\"0.005\"} 40\r\n...\r\n\r\nreal\t0m0.607s\r\nuser\t0m0.020s\r\nsys\t0m0.027s\r\n\r\n```\r\n\r\n## Why was this MR needed?\r\n\r\nSimilar reasons as https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20552:\r\n\r\n\u003e When any single Gitaly server fails, up to 50% of the web and api fleet workload is saturated by prometheus healthcheck requests, which happen 4 times a minute on each node, with each request currently taking almost a full minute, before failing with a 500 error.\r\n\r\nWith this fix: when any single Gitaly server fails: the prometheus endpoint will return immediately with the correct metrics and a 200 response.\r\n\r\n## Does this MR meet the acceptance criteria?\r\n\r\n- [ ] [Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary\r\n- [ ] [Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs)\r\n- [ ] API support added\r\n- [ ] Tests added for this feature/bug\r\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\r\n - [ ] Has been reviewed by a UX Designer\r\n - [ ] Has been reviewed by a Frontend maintainer\r\n - [ ] Has been reviewed by a Backend maintainer\r\n - [ ] Has been reviewed by a Database specialist\r\n- [ ] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\r\n- [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\r\n- [ ] Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides)\r\n- [ ] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)\r\n- [ ] Internationalization required/considered\r\n- [ ] End-to-end tests pass (`package-and-qa` manual pipeline job)\r\n\r\n## What are the relevant issue numbers?", + "state": "opened", + "created_at": "2018-07-11T19:08:21.900Z", + "updated_at": "2018-07-11T19:11:52.822Z", + "source_branch": "an/no-healthcheck-until-brooklyn", + "target_branch": "master", + "source_project_id": 13083, + "target_project_id": 13083, + "sha": "b4cc74f3b45ed206fdcfb021cbdbc8621807177c", + "merge_status": "can_be_merged", + "squash": true, + "force_remove_source_branch": true, + "user_notes_count": 1, + "author": { + "id": 895869, + "username": "andrewn", + "name": "Andrew Newdigate", + "state": "active", + "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/895869/avatar.png", + "web_url": "https://gitlab.com/andrewn" + }, + "labels": [ + "Gitaly", + "availability", + "performance" + ], + "time_stats": {}, + "milestone": { + "id": 450583, + "iid": 13, + "group_id": 9970, + "title": "11.1", + "state": "active", + "updated_at": "2018-03-01T19:52:29.776Z", + "created_at": "2018-01-23T21:40:27.318Z", + "due_date": "2018-07-22", + "start_date": "2018-06-08", + "web_url": "https://gitlab.com/groups/gitlab-org/-/milestones/13" + } + }, + { + "id": 13928405, + "iid": 20564, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20564", + "title": "Revert \"Log push output on exception\" because it is no longer needed", + "description": "## What does this MR do?\n\nWe have successfully diagnosed https://gitlab.com/gitlab-org/gitlab-ce/issues/48241, so this logging is no longer needed.\n\n## Does this MR meet the acceptance criteria?\n\n- ~~[Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary~~\n- ~~[Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs)~~\n- ~~API support added~~\n- ~~Tests added for this feature/bug~~\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\n - [ ] Has been reviewed by a Backend maintainer\n- ~~Conform by the [merge request performance guides]~~(https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\n- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\n- ~~Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides)~~\n- [x] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)\n- ~~Internationalization required/considered~~\n- [x] End-to-end tests pass (`package-and-qa` manual pipeline job)\n\n## What are the relevant issue numbers?\n\nhttps://gitlab.com/gitlab-org/gitlab-ce/issues/48241", + "state": "opened", + "created_at": "2018-07-11T18:44:19.250Z", + "updated_at": "2018-07-11T21:48:31.133Z", + "source_branch": "mk/remove-push-output-logging", + "target_branch": "master", + "source_project_id": 13083, + "target_project_id": 13083, + "sha": "2555bf5ee35862a9f940d3004e3b9f7bdf196e12", + "merge_status": "can_be_merged", + "squash": true, + "force_remove_source_branch": true, + "user_notes_count": 1, + "author": { + "id": 1144264, + "username": "mkozono", + "name": "Michael Kozono", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/ddaa576b4b6933a6fb7a996088c30f6c?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/mkozono" + }, + "assignee": { + "id": 128633, + "username": "rymai", + "name": "Rémy Coutable", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/263da227929cc0035cb0eba512bcf81a?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/rymai" + }, + "labels": [ + "Quality", + "technical debt" + ], + "time_stats": {} + }, + { + "id": 13927668, + "iid": 20563, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20563", + "title": "Resolve \"Follow-up from \"Milestone tests\"\"", + "description": "## What does this MR do?\n\nThis MR extracts the `has_milestone?` method out of `QA::Page::MergeRequest::Show` and into `QA::Page::Issuable::Sidebar`. \n\n## Does this MR meet the acceptance criteria?\n\n- [x] Tests added for this feature/bug\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\n - [ ] Has been reviewed by a Backend maintainer\n- [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\n- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\n- [ ] End-to-end tests pass (`package-and-qa` manual pipeline job)\n\n## What are the relevant issue numbers?\n\nCloses #48690", + "state": "opened", + "created_at": "2018-07-11T18:17:37.205Z", + "updated_at": "2018-07-11T18:27:01.373Z", + "source_branch": "48690-follow-up-from-milestone-tests", + "target_branch": "master", + "source_project_id": 13083, + "target_project_id": 13083, + "sha": "a825dc229a9b9ecb76dc6b88d7002afe29ff5781", + "merge_status": "can_be_merged", + "force_remove_source_branch": true, + "author": { + "id": 272636, + "username": "ddavison", + "name": "Dan Davison", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/6e56557ffa1baafe3e73e45bd2dc9524?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/ddavison" + }, + "assignee": { + "id": 128633, + "username": "rymai", + "name": "Rémy Coutable", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/263da227929cc0035cb0eba512bcf81a?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/rymai" + }, + "labels": [ + "QA", + "Quality", + "enhancement" + ], + "time_stats": {}, + "milestone": { + "id": 494367, + "iid": 15, + "group_id": 9970, + "title": "11.2", + "state": "active", + "updated_at": "2018-03-27T19:28:34.472Z", + "created_at": "2018-03-27T19:26:05.990Z", + "due_date": "2018-08-22", + "start_date": "2018-07-08", + "web_url": "https://gitlab.com/groups/gitlab-org/-/milestones/15" + } + }, + { + "id": 13925429, + "iid": 20562, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20562", + "title": "Fix MR widget border", + "description": "![Screen_Shot_2018-07-11_at_12.08.08_PM](/uploads/58608375fdec4ae03fa245ef17e8adea/Screen_Shot_2018-07-11_at_12.08.08_PM.png)", + "state": "merged", + "created_at": "2018-07-11T17:08:41.143Z", + "updated_at": "2018-07-11T17:39:06.035Z", + "source_branch": "fix-mr-widget-border", + "target_branch": "master", + "source_project_id": 13083, + "target_project_id": 13083, + "sha": "0cf9af01ce5c6db84aba8d40defc0cb03cb6e75f", + "merge_commit_sha": "a781d0f9b2b89f5a3fa33dc72fcefb485f2078ce", + "merge_status": "can_be_merged", + "merge_when_pipeline_succeeds": true, + "should_remove_source_branch": true, + "force_remove_source_branch": true, + "user_notes_count": 2, + "author": { + "id": 201566, + "username": "annabeldunstone", + "name": "Annabel Gray", + "state": "active", + "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/201566/avatar.png", + "web_url": "https://gitlab.com/annabeldunstone" + }, + "assignee": { + "id": 482476, + "username": "filipa", + "name": "Filipa Lacerda", + "state": "active", + "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/482476/avatar.png", + "web_url": "https://gitlab.com/filipa" + }, + "labels": [ + "Pick into 11.1", + "frontend", + "regression" + ], + "time_stats": {}, + "milestone": { + "id": 450583, + "iid": 13, + "group_id": 9970, + "title": "11.1", + "state": "active", + "updated_at": "2018-03-01T19:52:29.776Z", + "created_at": "2018-01-23T21:40:27.318Z", + "due_date": "2018-07-22", + "start_date": "2018-06-08", + "web_url": "https://gitlab.com/groups/gitlab-org/-/milestones/13" + } + }, + { + "id": 13925353, + "iid": 20561, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20561", + "title": "Resolve \"QA: False failure on QA test \"Push to protected branch when allowed\" during staging failover rehearsal\"", + "description": "## What does this MR do?\n\nThis ensure the external encoding is set to UTF-8 when running QA specs.\n\n## Are there points in the code the reviewer needs to double check?\n\nIf QA passes I guess that's it.\n\n## Does this MR meet the acceptance criteria?\n\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\n - [ ] Has been reviewed by a Backend maintainer\n- [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\n- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\n- [x] Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides)\n- [x] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)\n- [ ] End-to-end tests pass (`package-and-qa` manual pipeline job)\n\n## What are the relevant issue numbers?\n\nCloses #48241", + "state": "opened", + "created_at": "2018-07-11T17:02:36.349Z", + "updated_at": "2018-07-11T17:03:50.347Z", + "source_branch": "48241-fix-invalid-byte-sequence-in-qa", + "target_branch": "master", + "source_project_id": 13083, + "target_project_id": 13083, + "sha": "c9a27a42f0e07799bedfbc49af711dc84449ad17", + "merge_status": "can_be_merged", + "force_remove_source_branch": true, + "user_notes_count": 1, + "author": { + "id": 128633, + "username": "rymai", + "name": "Rémy Coutable", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/263da227929cc0035cb0eba512bcf81a?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/rymai" + }, + "assignee": { + "id": 128633, + "username": "rymai", + "name": "Rémy Coutable", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/263da227929cc0035cb0eba512bcf81a?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/rymai" + }, + "labels": [ + "QA", + "Quality", + "bug" + ], + "time_stats": {}, + "milestone": { + "id": 494367, + "iid": 15, + "group_id": 9970, + "title": "11.2", + "state": "active", + "updated_at": "2018-03-27T19:28:34.472Z", + "created_at": "2018-03-27T19:26:05.990Z", + "due_date": "2018-08-22", + "start_date": "2018-07-08", + "web_url": "https://gitlab.com/groups/gitlab-org/-/milestones/15" + } + }, + { + "id": 13924879, + "iid": 20560, + "project_id": 13083, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20560", + "title": "Revert \"Merge branch 'ee-5481-epic-todos' into 'master'\"", + "description": "Revert of https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/19908", + "state": "merged", + "created_at": "2018-07-11T16:34:45.542Z", + "updated_at": "2018-07-11T20:08:18.664Z", + "source_branch": "revert-todos-epic", + "target_branch": "master", + "source_project_id": 13083, + "target_project_id": 13083, + "sha": "8717c7dad9b5a8fa21ec9a652c54718a6b4c2175", + "merge_commit_sha": "9591fdbed7c14712986a8308036787481bbb3bc0", + "merge_status": "can_be_merged", + "merge_when_pipeline_succeeds": true, + "should_remove_source_branch": true, + "user_notes_count": 1, + "author": { + "id": 508743, + "username": "jarka", + "name": "Jarka Kadlecová", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/3931dae84deb01d2881e4909077b8dbe?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/jarka" + }, + "assignee": { + "id": 209240, + "username": "yorickpeterse", + "name": "Yorick Peterse", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/644bcc0c58aa01920c4de4f941afcac9?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/yorickpeterse" + }, + "labels": [ + "Discussion", + "bug" + ], + "time_stats": {}, + "milestone": { + "id": 450583, + "iid": 13, + "group_id": 9970, + "title": "11.1", + "state": "active", + "updated_at": "2018-03-01T19:52:29.776Z", + "created_at": "2018-01-23T21:40:27.318Z", + "due_date": "2018-07-22", + "start_date": "2018-06-08", + "web_url": "https://gitlab.com/groups/gitlab-org/-/milestones/13" + } + } +] \ No newline at end of file diff --git a/integration/snapshots/ls_project_merge_requests_verbose.snap b/integration/snapshots/ls_project_merge_requests_verbose.snap new file mode 100644 index 0000000..d8eae95 --- /dev/null +++ b/integration/snapshots/ls_project_merge_requests_verbose.snap @@ -0,0 +1,44 @@ +Fetching project 1 merge requests… + +| PROJECT ID | ID | TITLE | SOURCE | TARGET | STATE | ASSIGNEE | WIP | MERGE STATUS | CREATED AT | ++------------+----------+--------------------------------+----------------------------------------------------------------+--------+--------+---------------+-------+------------------+--------------------------+ +| 13083 | 13932943 | WIP: Fix autosave issues for | _acet-fix-mr-autosave | master | opened | fatihacet | true | can_be_merged | 2018-07-11T22:39:55.571Z | +| | | MR discussions | | | | | | | | +| 13083 | 13932747 | add initial smoke tests and | qa-smoke-tests | master | opened | meks | false | can_be_merged | 2018-07-11T22:18:59.366Z | +| | | documentation | | | | | | | | +| 13083 | 13931916 | WIP: Resolve "Remove ghost | 44824-remove-ghost-notification-settings-for-group-and-project | master | opened | jacopo-beschi | true | cannot_be_merged | 2018-07-11T21:06:10.653Z | +| | | notification settings for | | | | | | | | +| | | groups and projects" | | | | | | | | +| 13083 | 13929701 | Fix archived parameter for | fix-project-api-archived | master | opened | | false | can_be_merged | 2018-07-11T19:55:40.907Z | +| | | projects API | | | | | | | | +| 13083 | 13929032 | Remove healthchecks from | an/no-healthcheck-until-brooklyn | master | opened | | false | can_be_merged | 2018-07-11T19:08:21.900Z | +| | | prometheus endpoint | | | | | | | | +| 13083 | 13928405 | Revert "Log push output on | mk/remove-push-output-logging | master | opened | rymai | false | can_be_merged | 2018-07-11T18:44:19.250Z | +| | | exception" because it is no | | | | | | | | +| | | longer needed | | | | | | | | +| 13083 | 13927668 | Resolve "Follow-up from | 48690-follow-up-from-milestone-tests | master | opened | rymai | false | can_be_merged | 2018-07-11T18:17:37.205Z | +| | | "Milestone tests"" | | | | | | | | +| 13083 | 13925429 | Fix MR widget border | fix-mr-widget-border | master | merged | filipa | false | can_be_merged | 2018-07-11T17:08:41.143Z | +| 13083 | 13925353 | Resolve "QA: False failure | 48241-fix-invalid-byte-sequence-in-qa | master | opened | rymai | false | can_be_merged | 2018-07-11T17:02:36.349Z | +| | | on QA test "Push to protected | | | | | | | | +| | | branch when allowed" during | | | | | | | | +| | | staging failover rehearsal" | | | | | | | | +| 13083 | 13924879 | Revert "Merge branch | revert-todos-epic | master | merged | yorickpeterse | false | can_be_merged | 2018-07-11T16:34:45.542Z | +| | | 'ee-5481-epic-todos' into | | | | | | | | +| | | 'master'" | | | | | | | | + + +Response meta + + Method GET + Url http://wiremock:8080/api/v4/projects/1/merge_requests?page=1&per_page=10 + StatusCode 200 + Request id + Runtime 0.000000 + Page 1 + Items per page 10 + Previous page 0 + Next page 0 + Total pages 0 + Total 0 + diff --git a/integration/snapshots/ls_project_merge_requests_yaml.snap b/integration/snapshots/ls_project_merge_requests_yaml.snap new file mode 100644 index 0000000..64d1242 --- /dev/null +++ b/integration/snapshots/ls_project_merge_requests_yaml.snap @@ -0,0 +1,613 @@ +Fetching project 1 merge requests… +- id: 13932943 + iid: 20569 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20569 + title: 'WIP: Fix autosave issues for MR discussions' + description: "Fixes multiple autosave issues and ESC confirmations around noteable + shared components and new MR discussions.\r\n\r\n### Fixes autosave issue in noteable + shared components\r\n![_mr-autosave](/uploads/2997c1e1d745ccd70f8ccf6854e86b56/_mr-autosave.gif)\r\n\r\n### + Fixes ESC confirmation and autosave issues in reply a discussion form\r\n![_mr-esc-confirm](/uploads/79f7c7aace864ce02bd680099c715fc2/_mr-esc-confirm.gif)\r\n\r\n### + Adds ESC confirmation to new discussion form\r\n![_mr-esc-confirm2](/uploads/a4f3b3d41fb3b15db0e1a88f89264622/_mr-esc-confirm2.gif)\r\n\r\n\r\nFixes + https://gitlab.com/gitlab-org/gitlab-ce/issues/48876 and https://gitlab.com/gitlab-org/gitlab-ce/issues/48877" + state: opened + created_at: "2018-07-11T22:39:55.571Z" + updated_at: "2018-07-11T23:35:44.014Z" + source_branch: _acet-fix-mr-autosave + target_branch: master + source_project_id: 13083 + target_project_id: 13083 + sha: da788f233de489315e3155f170700c625af352c4 + work_in_progress: true + merge_status: can_be_merged + force_remove_source_branch: true + user_notes_count: 1 + author: + id: 502136 + username: fatihacet + name: Fatih Acet + state: active + avatar_url: https://assets.gitlab-static.net/uploads/-/system/user/avatar/502136/avatar.png + web_url: https://gitlab.com/fatihacet + assignee: + id: 502136 + username: fatihacet + name: Fatih Acet + state: active + avatar_url: https://assets.gitlab-static.net/uploads/-/system/user/avatar/502136/avatar.png + web_url: https://gitlab.com/fatihacet + labels: + - Discussion + - Pick into 11.1 + - bug + - frontend + - mr refactor + - regression + - reproduced on GitLab.com + time_stats: {} + milestone: + id: 450583 + iid: 13 + group_id: 9970 + title: "11.1" + state: active + updated_at: "2018-03-01T19:52:29.776Z" + created_at: "2018-01-23T21:40:27.318Z" + due_date: "2018-07-22" + start_date: "2018-06-08" + web_url: https://gitlab.com/groups/gitlab-org/-/milestones/13 +- id: 13932747 + iid: 20568 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20568 + title: add initial smoke tests and documentation + description: |- + ## What does this MR do? + + Adds initial smoke test functionality for quick sanity testing from the UI. + + ## Are there points in the code the reviewer needs to double check? + + There will be a sister MR to this created in the [QA Repository](https://gitlab.com/gitlab-org/gitlab-qa) regarding documentation on *how to run* these smoke tests. + + We can run them by using: + + `bin/qa Test::Smoke http://localhost:3000` + + I ran the "smoke suite" a couple times: here are my findings. + + | Time taken | + |------------| + | 50.9s | + | 50.08s | + | 50.78 | + + ## Why was this MR needed? + + This MR was created per discussions in https://gitlab.com/gitlab-org/gitlab-qa/issues/288 + + ## Does this MR meet the acceptance criteria? + + - [ ] [Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary + - [x] [Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs) + - [x] Tests added for this feature/bug + - Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html) + - [ ] Has been reviewed by a Frontend maintainer + - [ ] Has been reviewed by a Backend maintainer + - [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html) + - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides) + - [ ] End-to-end tests pass (`package-and-qa` manual pipeline job) + + ## What are the relevant issue numbers? + + - https://gitlab.com/gitlab-org/gitlab-qa/issues/288 + + ## Notes + + We should of course expand this suite, perhaps adding more `describe` scenarios in our source base to what we believe should be constituted as a "smoke test." + + /cc @gl\-quality @rspeicher @grzesiek @stanhu + state: opened + created_at: "2018-07-11T22:18:59.366Z" + updated_at: "2018-07-11T22:19:01.327Z" + source_branch: qa-smoke-tests + target_branch: master + source_project_id: 13083 + target_project_id: 13083 + sha: 2d06e080106b0d20adeda763bb5bc6beae2c8535 + merge_status: can_be_merged + author: + id: 272636 + username: ddavison + name: Dan Davison + state: active + avatar_url: https://secure.gravatar.com/avatar/6e56557ffa1baafe3e73e45bd2dc9524?s=80&d=identicon + web_url: https://gitlab.com/ddavison + assignee: + id: 2097582 + username: meks + name: Mek Stittri + state: active + avatar_url: https://assets.gitlab-static.net/uploads/-/system/user/avatar/2097582/avatar.png + web_url: https://gitlab.com/meks + labels: + - Discussion + - QA + - Quality + time_stats: {} +- id: 13931916 + iid: 20567 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20567 + title: 'WIP: Resolve "Remove ghost notification settings for groups and projects"' + description: |- + ## What does this MR do? + + ## Are there points in the code the reviewer needs to double check? + + ## Why was this MR needed? + + ## Screenshots (if relevant) + + ## Does this MR meet the acceptance criteria? + + - [x] [Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary + - [ ] [Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs) + - [ ] API support added + - [x] Tests added for this feature/bug + - Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html) + - [ ] Has been reviewed by a UX Designer + - [ ] Has been reviewed by a Frontend maintainer + - [ ] Has been reviewed by a Backend maintainer + - [ ] Has been reviewed by a Database specialist + - [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html) + - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides) + - [x] Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides) + - [ ] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) + - [ ] Internationalization required/considered + - [ ] End-to-end tests pass (`package-and-qa` manual pipeline job) + + ## What are the relevant issue numbers? + + + Closes #44824 + state: opened + created_at: "2018-07-11T21:06:10.653Z" + updated_at: "2018-07-11T21:06:43.081Z" + source_branch: 44824-remove-ghost-notification-settings-for-group-and-project + target_branch: master + source_project_id: 1915107 + target_project_id: 13083 + sha: 4cf0900526027785658829666f235349bafe4475 + work_in_progress: true + merge_status: cannot_be_merged + squash: true + force_remove_source_branch: true + author: + id: 331646 + username: jacopo-beschi + name: "\U0001F648 jacopo beschi \U0001F649" + state: active + avatar_url: https://secure.gravatar.com/avatar/692fb66988ac3863f360e846c1afc4f3?s=80&d=identicon + web_url: https://gitlab.com/jacopo-beschi + assignee: + id: 331646 + username: jacopo-beschi + name: "\U0001F648 jacopo beschi \U0001F649" + state: active + avatar_url: https://secure.gravatar.com/avatar/692fb66988ac3863f360e846c1afc4f3?s=80&d=identicon + web_url: https://gitlab.com/jacopo-beschi + time_stats: {} +- id: 13929701 + iid: 20566 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20566 + title: Fix archived parameter for projects API + description: |- + ## What does this MR do? + + Fixes a regression where the archived parameter is incorrectly applied to the projects finder. + + ## Are there points in the code the reviewer needs to double check? + + It changes default (but incorrect per spec) API behavior which is in place for 1,5 years. + Currently without `archived` parameter only active projects are returned (so filter `archived=false` is incorrectly applied). + The current default API behavior matches GUI behavior, however it's not possible to filter archived projects only via API (which is possible via GUI). + + This MR replaces !17244 (from @razer6), which is un-maintained for last 5 months due to contributor inactivity. + The code from that MR is refreshed and remaining open comments are implemented. + + ## Why was this MR needed? + + See discussions in #32301 and !17244 + + ## Does this MR meet the acceptance criteria? + + - [x] [Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary + - [x] [Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs) + - [x] API support added + - [x] Tests added for this feature/bug + - Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html) + - [ ] Has been reviewed by a UX Designer + - [ ] Has been reviewed by a Frontend maintainer + - [ ] Has been reviewed by a Backend maintainer + - [ ] Has been reviewed by a Database specialist + - [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html) + - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides) + - [x] Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides) + - [x] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) + - [x] Internationalization required/considered + - [ ] End-to-end tests pass (`package-and-qa` manual pipeline job) + + ## What are the relevant issue numbers? + + Closes #32301 + state: opened + created_at: "2018-07-11T19:55:40.907Z" + updated_at: "2018-07-11T20:00:23.499Z" + source_branch: fix-project-api-archived + target_branch: master + source_project_id: 904528 + target_project_id: 13083 + sha: 4fd3d6ed3bf663f8d978db62fb1f552c529e2950 + merge_status: can_be_merged + force_remove_source_branch: true + author: + id: 1334624 + username: petermarko + name: Peter Marko + state: active + avatar_url: https://secure.gravatar.com/avatar/28cbcbcb84533b9f8afc75521bdc457e?s=80&d=identicon + web_url: https://gitlab.com/petermarko + time_stats: {} +- id: 13929032 + iid: 20565 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20565 + title: Remove healthchecks from prometheus endpoint + description: "## What does this MR do?\r\n\r\n- Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/49112\r\n\r\n## + Are there points in the code the reviewer needs to double check?\r\n\r\n```shell\r\n# + Simulate a Gitaly server under extreme load....\r\n$ lldb -p $(pgrep gitaly) & + \r\n\r\n# Without this fix: Prometheus scrape endpoint times out after ~55s with + a 500 error\r\n$ time curl http://localhost:3000/-/metrics\r\nNameError at /-/metrics\r\n=======================\r\n\r\n> + uninitialized constant GRPC::GRPC\r\n...\r\nreal\t0m58.135s\r\nuser\t0m0.014s\r\nsys\t0m0.016s\r\n\r\n# + With this fix: Prometheus scrape endpoint returns the prometheus metrics successfully, + immediately\r\n$ time curl http://localhost:3000/-/metrics\r\nclient_browser_timing_count{event=\"contentComplete\"} + 40\r\n# HELP client_browser_timing Multiprocess metric\r\n# TYPE client_browser_timing + histogram\r\nclient_browser_timing_bucket{event=\"connect\",le=\"+Inf\"} 40\r\nclient_browser_timing_bucket{event=\"connect\",le=\"0.005\"} + 40\r\n...\r\n\r\nreal\t0m0.607s\r\nuser\t0m0.020s\r\nsys\t0m0.027s\r\n\r\n```\r\n\r\n## + Why was this MR needed?\r\n\r\nSimilar reasons as https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20552:\r\n\r\n> + When any single Gitaly server fails, up to 50% of the web and api fleet workload + is saturated by prometheus healthcheck requests, which happen 4 times a minute + on each node, with each request currently taking almost a full minute, before + failing with a 500 error.\r\n\r\nWith this fix: when any single Gitaly server + fails: the prometheus endpoint will return immediately with the correct metrics + and a 200 response.\r\n\r\n## Does this MR meet the acceptance criteria?\r\n\r\n- + [ ] [Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, + if necessary\r\n- [ ] [Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs)\r\n- + [ ] API support added\r\n- [ ] Tests added for this feature/bug\r\n- Conform by + the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\r\n + \ - [ ] Has been reviewed by a UX Designer\r\n - [ ] Has been reviewed by a Frontend + maintainer\r\n - [ ] Has been reviewed by a Backend maintainer\r\n - [ ] Has + been reviewed by a Database specialist\r\n- [ ] Conform by the [merge request + performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\r\n- + [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\r\n- + [ ] Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides)\r\n- + [ ] If you have multiple commits, please combine them into a few logically organized + commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)\r\n- + [ ] Internationalization required/considered\r\n- [ ] End-to-end tests pass (`package-and-qa` + manual pipeline job)\r\n\r\n## What are the relevant issue numbers?" + state: opened + created_at: "2018-07-11T19:08:21.900Z" + updated_at: "2018-07-11T19:11:52.822Z" + source_branch: an/no-healthcheck-until-brooklyn + target_branch: master + source_project_id: 13083 + target_project_id: 13083 + sha: b4cc74f3b45ed206fdcfb021cbdbc8621807177c + merge_status: can_be_merged + squash: true + force_remove_source_branch: true + user_notes_count: 1 + author: + id: 895869 + username: andrewn + name: Andrew Newdigate + state: active + avatar_url: https://assets.gitlab-static.net/uploads/-/system/user/avatar/895869/avatar.png + web_url: https://gitlab.com/andrewn + labels: + - Gitaly + - availability + - performance + time_stats: {} + milestone: + id: 450583 + iid: 13 + group_id: 9970 + title: "11.1" + state: active + updated_at: "2018-03-01T19:52:29.776Z" + created_at: "2018-01-23T21:40:27.318Z" + due_date: "2018-07-22" + start_date: "2018-06-08" + web_url: https://gitlab.com/groups/gitlab-org/-/milestones/13 +- id: 13928405 + iid: 20564 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20564 + title: Revert "Log push output on exception" because it is no longer needed + description: |- + ## What does this MR do? + + We have successfully diagnosed https://gitlab.com/gitlab-org/gitlab-ce/issues/48241, so this logging is no longer needed. + + ## Does this MR meet the acceptance criteria? + + - ~~[Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary~~ + - ~~[Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs)~~ + - ~~API support added~~ + - ~~Tests added for this feature/bug~~ + - Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html) + - [ ] Has been reviewed by a Backend maintainer + - ~~Conform by the [merge request performance guides]~~(https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html) + - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides) + - ~~Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides)~~ + - [x] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) + - ~~Internationalization required/considered~~ + - [x] End-to-end tests pass (`package-and-qa` manual pipeline job) + + ## What are the relevant issue numbers? + + https://gitlab.com/gitlab-org/gitlab-ce/issues/48241 + state: opened + created_at: "2018-07-11T18:44:19.250Z" + updated_at: "2018-07-11T21:48:31.133Z" + source_branch: mk/remove-push-output-logging + target_branch: master + source_project_id: 13083 + target_project_id: 13083 + sha: 2555bf5ee35862a9f940d3004e3b9f7bdf196e12 + merge_status: can_be_merged + squash: true + force_remove_source_branch: true + user_notes_count: 1 + author: + id: 1144264 + username: mkozono + name: Michael Kozono + state: active + avatar_url: https://secure.gravatar.com/avatar/ddaa576b4b6933a6fb7a996088c30f6c?s=80&d=identicon + web_url: https://gitlab.com/mkozono + assignee: + id: 128633 + username: rymai + name: Rémy Coutable + state: active + avatar_url: https://secure.gravatar.com/avatar/263da227929cc0035cb0eba512bcf81a?s=80&d=identicon + web_url: https://gitlab.com/rymai + labels: + - Quality + - technical debt + time_stats: {} +- id: 13927668 + iid: 20563 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20563 + title: Resolve "Follow-up from "Milestone tests"" + description: "## What does this MR do?\n\nThis MR extracts the `has_milestone?` + method out of `QA::Page::MergeRequest::Show` and into `QA::Page::Issuable::Sidebar`. + \n\n## Does this MR meet the acceptance criteria?\n\n- [x] Tests added for this + feature/bug\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\n + \ - [ ] Has been reviewed by a Backend maintainer\n- [x] Conform by the [merge + request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\n- + [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\n- + [ ] End-to-end tests pass (`package-and-qa` manual pipeline job)\n\n## What are + the relevant issue numbers?\n\nCloses #48690" + state: opened + created_at: "2018-07-11T18:17:37.205Z" + updated_at: "2018-07-11T18:27:01.373Z" + source_branch: 48690-follow-up-from-milestone-tests + target_branch: master + source_project_id: 13083 + target_project_id: 13083 + sha: a825dc229a9b9ecb76dc6b88d7002afe29ff5781 + merge_status: can_be_merged + force_remove_source_branch: true + author: + id: 272636 + username: ddavison + name: Dan Davison + state: active + avatar_url: https://secure.gravatar.com/avatar/6e56557ffa1baafe3e73e45bd2dc9524?s=80&d=identicon + web_url: https://gitlab.com/ddavison + assignee: + id: 128633 + username: rymai + name: Rémy Coutable + state: active + avatar_url: https://secure.gravatar.com/avatar/263da227929cc0035cb0eba512bcf81a?s=80&d=identicon + web_url: https://gitlab.com/rymai + labels: + - QA + - Quality + - enhancement + time_stats: {} + milestone: + id: 494367 + iid: 15 + group_id: 9970 + title: "11.2" + state: active + updated_at: "2018-03-27T19:28:34.472Z" + created_at: "2018-03-27T19:26:05.990Z" + due_date: "2018-08-22" + start_date: "2018-07-08" + web_url: https://gitlab.com/groups/gitlab-org/-/milestones/15 +- id: 13925429 + iid: 20562 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20562 + title: Fix MR widget border + description: '![Screen_Shot_2018-07-11_at_12.08.08_PM](/uploads/58608375fdec4ae03fa245ef17e8adea/Screen_Shot_2018-07-11_at_12.08.08_PM.png)' + state: merged + created_at: "2018-07-11T17:08:41.143Z" + updated_at: "2018-07-11T17:39:06.035Z" + source_branch: fix-mr-widget-border + target_branch: master + source_project_id: 13083 + target_project_id: 13083 + sha: 0cf9af01ce5c6db84aba8d40defc0cb03cb6e75f + merge_commit_sha: a781d0f9b2b89f5a3fa33dc72fcefb485f2078ce + merge_status: can_be_merged + merge_when_pipeline_succeeds: true + should_remove_source_branch: true + force_remove_source_branch: true + user_notes_count: 2 + author: + id: 201566 + username: annabeldunstone + name: Annabel Gray + state: active + avatar_url: https://assets.gitlab-static.net/uploads/-/system/user/avatar/201566/avatar.png + web_url: https://gitlab.com/annabeldunstone + assignee: + id: 482476 + username: filipa + name: Filipa Lacerda + state: active + avatar_url: https://assets.gitlab-static.net/uploads/-/system/user/avatar/482476/avatar.png + web_url: https://gitlab.com/filipa + labels: + - Pick into 11.1 + - frontend + - regression + time_stats: {} + milestone: + id: 450583 + iid: 13 + group_id: 9970 + title: "11.1" + state: active + updated_at: "2018-03-01T19:52:29.776Z" + created_at: "2018-01-23T21:40:27.318Z" + due_date: "2018-07-22" + start_date: "2018-06-08" + web_url: https://gitlab.com/groups/gitlab-org/-/milestones/13 +- id: 13925353 + iid: 20561 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20561 + title: 'Resolve "QA: False failure on QA test "Push to protected branch when allowed" + during staging failover rehearsal"' + description: |- + ## What does this MR do? + + This ensure the external encoding is set to UTF-8 when running QA specs. + + ## Are there points in the code the reviewer needs to double check? + + If QA passes I guess that's it. + + ## Does this MR meet the acceptance criteria? + + - Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html) + - [ ] Has been reviewed by a Backend maintainer + - [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html) + - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides) + - [x] Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides) + - [x] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) + - [ ] End-to-end tests pass (`package-and-qa` manual pipeline job) + + ## What are the relevant issue numbers? + + Closes #48241 + state: opened + created_at: "2018-07-11T17:02:36.349Z" + updated_at: "2018-07-11T17:03:50.347Z" + source_branch: 48241-fix-invalid-byte-sequence-in-qa + target_branch: master + source_project_id: 13083 + target_project_id: 13083 + sha: c9a27a42f0e07799bedfbc49af711dc84449ad17 + merge_status: can_be_merged + force_remove_source_branch: true + user_notes_count: 1 + author: + id: 128633 + username: rymai + name: Rémy Coutable + state: active + avatar_url: https://secure.gravatar.com/avatar/263da227929cc0035cb0eba512bcf81a?s=80&d=identicon + web_url: https://gitlab.com/rymai + assignee: + id: 128633 + username: rymai + name: Rémy Coutable + state: active + avatar_url: https://secure.gravatar.com/avatar/263da227929cc0035cb0eba512bcf81a?s=80&d=identicon + web_url: https://gitlab.com/rymai + labels: + - QA + - Quality + - bug + time_stats: {} + milestone: + id: 494367 + iid: 15 + group_id: 9970 + title: "11.2" + state: active + updated_at: "2018-03-27T19:28:34.472Z" + created_at: "2018-03-27T19:26:05.990Z" + due_date: "2018-08-22" + start_date: "2018-07-08" + web_url: https://gitlab.com/groups/gitlab-org/-/milestones/15 +- id: 13924879 + iid: 20560 + project_id: 13083 + web_url: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20560 + title: Revert "Merge branch 'ee-5481-epic-todos' into 'master'" + description: Revert of https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/19908 + state: merged + created_at: "2018-07-11T16:34:45.542Z" + updated_at: "2018-07-11T20:08:18.664Z" + source_branch: revert-todos-epic + target_branch: master + source_project_id: 13083 + target_project_id: 13083 + sha: 8717c7dad9b5a8fa21ec9a652c54718a6b4c2175 + merge_commit_sha: 9591fdbed7c14712986a8308036787481bbb3bc0 + merge_status: can_be_merged + merge_when_pipeline_succeeds: true + should_remove_source_branch: true + user_notes_count: 1 + author: + id: 508743 + username: jarka + name: Jarka Kadlecová + state: active + avatar_url: https://secure.gravatar.com/avatar/3931dae84deb01d2881e4909077b8dbe?s=80&d=identicon + web_url: https://gitlab.com/jarka + assignee: + id: 209240 + username: yorickpeterse + name: Yorick Peterse + state: active + avatar_url: https://secure.gravatar.com/avatar/644bcc0c58aa01920c4de4f941afcac9?s=80&d=identicon + web_url: https://gitlab.com/yorickpeterse + labels: + - Discussion + - bug + time_stats: {} + milestone: + id: 450583 + iid: 13 + group_id: 9970 + title: "11.1" + state: active + updated_at: "2018-03-01T19:52:29.776Z" + created_at: "2018-01-23T21:40:27.318Z" + due_date: "2018-07-22" + start_date: "2018-06-08" + web_url: https://gitlab.com/groups/gitlab-org/-/milestones/13 diff --git a/integration/snapshots/ls_projects_json.snap b/integration/snapshots/ls_projects_json.snap index e01e6cf..9a3eef2 100644 --- a/integration/snapshots/ls_projects_json.snap +++ b/integration/snapshots/ls_projects_json.snap @@ -10,14 +10,13 @@ Fetching projects… "default_branch": "master", "owner": { "id": 3, - "username": "", "name": "Diaspora", + "username": "", "state": "", "avatar_url": "", "web_url": "", - "created_at": "2013-09-30T13: 46: 02Z", - "expires_at": "", - "access_level": 0 + "access_level": 0, + "expires_at": "" }, "public": false, "visibility": "", @@ -59,14 +58,13 @@ Fetching projects… "default_branch": "master", "owner": { "id": 4, - "username": "", "name": "Brightbox", + "username": "", "state": "", "avatar_url": "", "web_url": "", - "created_at": "2013-09-30T13:46:02Z", - "expires_at": "", - "access_level": 0 + "access_level": 0, + "expires_at": "" }, "public": false, "visibility": "", diff --git a/integration/snapshots/ls_projects_verbose.snap b/integration/snapshots/ls_projects_verbose.snap index 1b134d7..bb9b164 100644 --- a/integration/snapshots/ls_projects_verbose.snap +++ b/integration/snapshots/ls_projects_verbose.snap @@ -13,8 +13,8 @@ Response meta StatusCode 200 Request id Runtime 0.000000 - Page 0 - Items per page 0 + Page 1 + Items per page 10 Previous page 0 Next page 0 Total pages 0 diff --git a/integration/snapshots/ls_projects_yaml.snap b/integration/snapshots/ls_projects_yaml.snap index 35fd126..f4283b6 100644 --- a/integration/snapshots/ls_projects_yaml.snap +++ b/integration/snapshots/ls_projects_yaml.snap @@ -9,14 +9,13 @@ Fetching projects… defaultbranch: master owner: id: 3 - username: "" name: Diaspora + username: "" state: "" avatarurl: "" weburl: "" - createdat: '2013-09-30T13: 46: 02Z' - expiresat: "" accesslevel: 0 + expiresat: "" public: false visibility: "" issuesenabled: true @@ -63,14 +62,13 @@ Fetching projects… defaultbranch: master owner: id: 4 - username: "" name: Brightbox + username: "" state: "" avatarurl: "" weburl: "" - createdat: "2013-09-30T13:46:02Z" - expiresat: "" accesslevel: 0 + expiresat: "" public: false visibility: "" issuesenabled: true diff --git a/integration/snapshots/ls_runners_verbose.snap b/integration/snapshots/ls_runners_verbose.snap index fe35d62..e08c2d5 100644 --- a/integration/snapshots/ls_runners_verbose.snap +++ b/integration/snapshots/ls_runners_verbose.snap @@ -13,8 +13,8 @@ Response meta StatusCode 200 Request id Runtime 0.000000 - Page 0 - Items per page 0 + Page 1 + Items per page 10 Previous page 0 Next page 0 Total pages 0 diff --git a/integration/snapshots/ls_ssh_keys.snap b/integration/snapshots/ls_ssh_keys.snap new file mode 100644 index 0000000..c65d33a --- /dev/null +++ b/integration/snapshots/ls_ssh_keys.snap @@ -0,0 +1,8 @@ +Fetching current user ssh keys… + +| ID | TITLE | KEY | CREATED AT | ++----+--------------------+-------------------+--------------------------+ +| 1 | Public key | ssh-rsa AAAAB3Nz… | 2014-08-01T14:47:39.080Z | +| 2 | Whatever key | ssh-rsa AAAAB3Nz… | 2014-08-01T14:47:39.080Z | +| 3 | Another Public key | ssh-rsa AAAAB3Nz… | 2014-08-01T14:47:39.080Z | + diff --git a/integration/snapshots/ls_ssh_keys_help.snap b/integration/snapshots/ls_ssh_keys_help.snap new file mode 100644 index 0000000..4b49799 --- /dev/null +++ b/integration/snapshots/ls_ssh_keys_help.snap @@ -0,0 +1,22 @@ +List current user ssh keys + +Usage: + glc ls ssh-keys [flags] + +Aliases: + ssh-keys, sk + +Flags: + -h, --help help for ssh-keys + +Global Flags: + -a, --alias string Use resource alias + -c, --config string Path to configuration file (default ".glc.yml") + -i, --interactive enable interactive mode when applicable (eg. creation, pagination) + --no-color disable color output + -o, --output-destination string Output result to file if specified + -f, --output-format string Output format, must be one of 'text', 'json', 'yaml' + -p, --page int Page (default 1) + -l, --per-page int Items per page (default 10) + --silent silent mode + -v, --verbose verbose output diff --git a/integration/snapshots/ls_ssh_keys_json.snap b/integration/snapshots/ls_ssh_keys_json.snap new file mode 100644 index 0000000..eac3ce7 --- /dev/null +++ b/integration/snapshots/ls_ssh_keys_json.snap @@ -0,0 +1,21 @@ +Fetching current user ssh keys… +[ + { + "id": 1, + "title": "Public key", + "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=", + "created_at": "2014-08-01T14:47:39.080Z" + }, + { + "id": 2, + "title": "Whatever key", + "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=", + "created_at": "2014-08-01T14:47:39.080Z" + }, + { + "id": 3, + "title": "Another Public key", + "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=", + "created_at": "2014-08-01T14:47:39.080Z" + } +] \ No newline at end of file diff --git a/integration/snapshots/ls_ssh_keys_verbose.snap b/integration/snapshots/ls_ssh_keys_verbose.snap new file mode 100644 index 0000000..e886229 --- /dev/null +++ b/integration/snapshots/ls_ssh_keys_verbose.snap @@ -0,0 +1,23 @@ +Fetching current user ssh keys… + +| ID | TITLE | KEY | CREATED AT | ++----+--------------------+-------------------+--------------------------+ +| 1 | Public key | ssh-rsa AAAAB3Nz… | 2014-08-01T14:47:39.080Z | +| 2 | Whatever key | ssh-rsa AAAAB3Nz… | 2014-08-01T14:47:39.080Z | +| 3 | Another Public key | ssh-rsa AAAAB3Nz… | 2014-08-01T14:47:39.080Z | + + +Response meta + + Method GET + Url http://wiremock:8080/api/v4/user/keys?page=1&per_page=10 + StatusCode 200 + Request id + Runtime 0.000000 + Page 1 + Items per page 10 + Previous page 0 + Next page 0 + Total pages 0 + Total 0 + diff --git a/integration/snapshots/ls_ssh_keys_yaml.snap b/integration/snapshots/ls_ssh_keys_yaml.snap new file mode 100644 index 0000000..967e298 --- /dev/null +++ b/integration/snapshots/ls_ssh_keys_yaml.snap @@ -0,0 +1,13 @@ +Fetching current user ssh keys… +- id: 1 + title: Public key + key: ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0= + created_at: "2014-08-01T14:47:39.080Z" +- id: 2 + title: Whatever key + key: ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0= + created_at: "2014-08-01T14:47:39.080Z" +- id: 3 + title: Another Public key + key: ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0= + created_at: "2014-08-01T14:47:39.080Z" diff --git a/integration/snapshots/ls_user_ssh_keys.snap b/integration/snapshots/ls_user_ssh_keys.snap new file mode 100644 index 0000000..4a0ceed --- /dev/null +++ b/integration/snapshots/ls_user_ssh_keys.snap @@ -0,0 +1,8 @@ +Fetching user 1 ssh keys… + +| ID | TITLE | KEY | CREATED AT | ++----+--------------------+-------------------+--------------------------+ +| 1 | Public key | ssh-rsa AAAAB3Nz… | 2014-08-01T14:47:39.080Z | +| 2 | Whatever key | ssh-rsa AAAAB3Nz… | 2014-08-01T14:47:39.080Z | +| 3 | Another Public key | ssh-rsa AAAAB3Nz… | 2014-08-01T14:47:39.080Z | + diff --git a/integration/snapshots/ls_user_ssh_keys_help.snap b/integration/snapshots/ls_user_ssh_keys_help.snap new file mode 100644 index 0000000..dc5fda9 --- /dev/null +++ b/integration/snapshots/ls_user_ssh_keys_help.snap @@ -0,0 +1,22 @@ +List specific user ssh keys + +Usage: + glc ls user-ssh-keys USER_ID [flags] + +Aliases: + user-ssh-keys, usk + +Flags: + -h, --help help for user-ssh-keys + +Global Flags: + -a, --alias string Use resource alias + -c, --config string Path to configuration file (default ".glc.yml") + -i, --interactive enable interactive mode when applicable (eg. creation, pagination) + --no-color disable color output + -o, --output-destination string Output result to file if specified + -f, --output-format string Output format, must be one of 'text', 'json', 'yaml' + -p, --page int Page (default 1) + -l, --per-page int Items per page (default 10) + --silent silent mode + -v, --verbose verbose output diff --git a/integration/snapshots/ls_user_ssh_keys_json.snap b/integration/snapshots/ls_user_ssh_keys_json.snap new file mode 100644 index 0000000..a2f791b --- /dev/null +++ b/integration/snapshots/ls_user_ssh_keys_json.snap @@ -0,0 +1,21 @@ +Fetching user 1 ssh keys… +[ + { + "id": 1, + "title": "Public key", + "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=", + "created_at": "2014-08-01T14:47:39.080Z" + }, + { + "id": 2, + "title": "Whatever key", + "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=", + "created_at": "2014-08-01T14:47:39.080Z" + }, + { + "id": 3, + "title": "Another Public key", + "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=", + "created_at": "2014-08-01T14:47:39.080Z" + } +] \ No newline at end of file diff --git a/integration/snapshots/ls_user_ssh_keys_verbose.snap b/integration/snapshots/ls_user_ssh_keys_verbose.snap new file mode 100644 index 0000000..09a24be --- /dev/null +++ b/integration/snapshots/ls_user_ssh_keys_verbose.snap @@ -0,0 +1,23 @@ +Fetching user 1 ssh keys… + +| ID | TITLE | KEY | CREATED AT | ++----+--------------------+-------------------+--------------------------+ +| 1 | Public key | ssh-rsa AAAAB3Nz… | 2014-08-01T14:47:39.080Z | +| 2 | Whatever key | ssh-rsa AAAAB3Nz… | 2014-08-01T14:47:39.080Z | +| 3 | Another Public key | ssh-rsa AAAAB3Nz… | 2014-08-01T14:47:39.080Z | + + +Response meta + + Method GET + Url http://wiremock:8080/api/v4/user/keys?page=1&per_page=10 + StatusCode 200 + Request id + Runtime 0.000000 + Page 1 + Items per page 10 + Previous page 0 + Next page 0 + Total pages 0 + Total 0 + diff --git a/integration/snapshots/ls_user_ssh_keys_yaml.snap b/integration/snapshots/ls_user_ssh_keys_yaml.snap new file mode 100644 index 0000000..3ea0981 --- /dev/null +++ b/integration/snapshots/ls_user_ssh_keys_yaml.snap @@ -0,0 +1,13 @@ +Fetching user 1 ssh keys… +- id: 1 + title: Public key + key: ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0= + created_at: "2014-08-01T14:47:39.080Z" +- id: 2 + title: Whatever key + key: ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0= + created_at: "2014-08-01T14:47:39.080Z" +- id: 3 + title: Another Public key + key: ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0= + created_at: "2014-08-01T14:47:39.080Z" diff --git a/integration/snapshots/ls_users_verbose.snap b/integration/snapshots/ls_users_verbose.snap index a1ba3fb..e645f57 100644 --- a/integration/snapshots/ls_users_verbose.snap +++ b/integration/snapshots/ls_users_verbose.snap @@ -13,8 +13,8 @@ Response meta StatusCode 200 Request id Runtime 0.000000 - Page 0 - Items per page 0 + Page 1 + Items per page 10 Previous page 0 Next page 0 Total pages 0 diff --git a/mocks/__files/badges/badge_1.json b/mocks/__files/badges/badge_1.json new file mode 100644 index 0000000..fd04623 --- /dev/null +++ b/mocks/__files/badges/badge_1.json @@ -0,0 +1,8 @@ +{ + "link_url": "https://gitlab.com/%{project_path}/commits/%{default_branch}", + "image_url": "https://gitlab.com/%{project_path}/badges/%{default_branch}/pipeline.svg", + "rendered_link_url": "https://gitlab.com/gitlab-org/gitlab-ce/commits/master", + "rendered_image_url": "https://gitlab.com/gitlab-org/gitlab-ce/badges/master/pipeline.svg", + "id": 1, + "kind": "project" +} \ No newline at end of file diff --git a/mocks/__files/badges/badges.json b/mocks/__files/badges/badges.json new file mode 100644 index 0000000..8ba040d --- /dev/null +++ b/mocks/__files/badges/badges.json @@ -0,0 +1,42 @@ +[ + { + "link_url": "https://gitlab.com/%{project_path}/commits/%{default_branch}", + "image_url": "https://gitlab.com/%{project_path}/badges/%{default_branch}/pipeline.svg", + "rendered_link_url": "https://gitlab.com/gitlab-org/gitlab-ce/commits/master", + "rendered_image_url": "https://gitlab.com/gitlab-org/gitlab-ce/badges/master/pipeline.svg", + "id": 3661, + "kind": "project" + }, + { + "link_url": "https://gitlab.com/%{project_path}/commits/%{default_branch}", + "image_url": "https://gitlab.com/%{project_path}/badges/%{default_branch}/coverage.svg", + "rendered_link_url": "https://gitlab.com/gitlab-org/gitlab-ce/commits/master", + "rendered_image_url": "https://gitlab.com/gitlab-org/gitlab-ce/badges/master/coverage.svg", + "id": 3662, + "kind": "project" + }, + { + "link_url": "https://bestpractices.coreinfrastructure.org/projects/42", + "image_url": "https://bestpractices.coreinfrastructure.org/projects/42/badge", + "rendered_link_url": "https://bestpractices.coreinfrastructure.org/projects/42", + "rendered_image_url": "https://bestpractices.coreinfrastructure.org/projects/42/badge", + "id": 3671, + "kind": "project" + }, + { + "link_url": "https://codeclimate.com/github/gitlabhq/gitlabhq", + "image_url": "https://codeclimate.com/github/gitlabhq/gitlabhq.svg", + "rendered_link_url": "https://codeclimate.com/github/gitlabhq/gitlabhq", + "rendered_image_url": "https://codeclimate.com/github/gitlabhq/gitlabhq.svg", + "id": 3672, + "kind": "project" + }, + { + "link_url": "https://gitter.im/gitlabhq/gitlabhq?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge", + "image_url": "https://badges.gitter.im/gitlabhq/gitlabhq.svg", + "rendered_link_url": "https://gitter.im/gitlabhq/gitlabhq?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge", + "rendered_image_url": "https://badges.gitter.im/gitlabhq/gitlabhq.svg", + "id": 3673, + "kind": "project" + } +] \ No newline at end of file diff --git a/mocks/__files/branches/branches.json b/mocks/__files/branches/branches.json new file mode 100644 index 0000000..045e077 --- /dev/null +++ b/mocks/__files/branches/branches.json @@ -0,0 +1,222 @@ +[ + { + "name": "10-0-stable", + "commit": { + "id": "f2f2c8d0f05485e7235120c575b9307bb7f1e421", + "short_id": "f2f2c8d0", + "title": "Merge branch 'sh-bump-redis-actionpack' into 'master'", + "created_at": "2018-01-04T01:40:10.000+00:00", + "parent_ids": null, + "message": "Merge branch 'sh-bump-redis-actionpack' into 'master'", + "author_name": "Robert Speicher", + "author_email": "robert@gitlab.com", + "authored_date": "2017-12-06T19:23:29.000+00:00", + "committer_name": "Stan Hu", + "committer_email": "stanhu@gmail.com", + "committed_date": "2018-01-04T01:40:10.000+00:00" + }, + "merged": false, + "protected": true, + "developers_can_push": false, + "developers_can_merge": false, + "can_push": false + }, + { + "name": "10-1-stable", + "commit": { + "id": "d3016d86a9c0855d94e2da53b9512974a7795b8f", + "short_id": "d3016d86", + "title": "Update VERSION to 10.1.7", + "created_at": "2018-01-18T16:42:09.000+00:00", + "parent_ids": null, + "message": "Update VERSION to 10.1.7", + "author_name": "Oswaldo Ferreira", + "author_email": "oswaldo@gitlab.com", + "authored_date": "2018-01-18T16:42:09.000+00:00", + "committer_name": "Oswaldo Ferreira", + "committer_email": "oswaldo@gitlab.com", + "committed_date": "2018-01-18T16:42:09.000+00:00" + }, + "merged": false, + "protected": true, + "developers_can_push": false, + "developers_can_merge": false, + "can_push": false + }, + { + "name": "10-2-stable", + "commit": { + "id": "2e75ed127fe8a960b96e4c17a132924e320676dd", + "short_id": "2e75ed12", + "title": "Merge branch '42591-update-nokogiri' into 'master'", + "created_at": "2018-02-07T22:18:36.000+00:00", + "parent_ids": null, + "message": "Merge branch '42591-update-nokogiri' into 'master'", + "author_name": "Stan Hu", + "author_email": "stanhu@gmail.com", + "authored_date": "2018-01-30T19:00:47.000+00:00", + "committer_name": "Stan Hu", + "committer_email": "stanhu@gmail.com", + "committed_date": "2018-02-07T22:18:36.000+00:00" + }, + "merged": false, + "protected": true, + "developers_can_push": false, + "developers_can_merge": false, + "can_push": false + }, + { + "name": "10-3-stable", + "commit": { + "id": "368dbae6ba32e51816e80ad8d57912c4d88f7ca1", + "short_id": "368dbae6", + "title": "Update VERSION to 10.3.9", + "created_at": "2018-03-16T19:06:34.000+00:00", + "parent_ids": null, + "message": "Update VERSION to 10.3.9", + "author_name": "Mark Fletcher", + "author_email": "mark@gitlab.com", + "authored_date": "2018-03-16T19:06:34.000+00:00", + "committer_name": "Mark Fletcher", + "committer_email": "mark@gitlab.com", + "committed_date": "2018-03-16T19:06:34.000+00:00" + }, + "merged": false, + "protected": true, + "developers_can_push": false, + "developers_can_merge": false, + "can_push": false + }, + { + "name": "10-4-stable", + "commit": { + "id": "a14b075544931174f614efa67685766331f80e29", + "short_id": "a14b0755", + "title": "Update VERSION to 10.4.7", + "created_at": "2018-04-03T16:46:50.000+00:00", + "parent_ids": null, + "message": "Update VERSION to 10.4.7", + "author_name": "Filipa Lacerda", + "author_email": "filipa@gitlab.com", + "authored_date": "2018-04-03T16:46:50.000+00:00", + "committer_name": "Filipa Lacerda", + "committer_email": "filipa@gitlab.com", + "committed_date": "2018-04-03T16:46:50.000+00:00" + }, + "merged": false, + "protected": true, + "developers_can_push": false, + "developers_can_merge": false, + "can_push": false + }, + { + "name": "10-5-stable", + "commit": { + "id": "40e125820c96326e0aadd9457466b6be97142399", + "short_id": "40e12582", + "title": "Update VERSION to 10.5.8", + "created_at": "2018-04-24T19:42:34.000+00:00", + "parent_ids": null, + "message": "Update VERSION to 10.5.8", + "author_name": "Mayra Cabrera", + "author_email": "mcabrera@gitlab.com", + "authored_date": "2018-04-24T19:42:34.000+00:00", + "committer_name": "Mayra Cabrera", + "committer_email": "mcabrera@gitlab.com", + "committed_date": "2018-04-24T19:42:34.000+00:00" + }, + "merged": false, + "protected": true, + "developers_can_push": false, + "developers_can_merge": false, + "can_push": false + }, + { + "name": "10-6-stable", + "commit": { + "id": "16f9faa876df1edc1fa2a6519afa5fcebbdc1fc1", + "short_id": "16f9faa8", + "title": "Update VERSION to 10.6.6", + "created_at": "2018-05-28T11:07:40.000+00:00", + "parent_ids": null, + "message": "Update VERSION to 10.6.6", + "author_name": "Filipa Lacerda", + "author_email": "filipa@gitlab.com", + "authored_date": "2018-05-28T11:07:40.000+00:00", + "committer_name": "Filipa Lacerda", + "committer_email": "filipa@gitlab.com", + "committed_date": "2018-05-28T11:07:40.000+00:00" + }, + "merged": false, + "protected": true, + "developers_can_push": false, + "developers_can_merge": false, + "can_push": false + }, + { + "name": "10-7-grpc-1.11", + "commit": { + "id": "294731f7ee8b36a8a6f94e5f9c7870f38a9293b8", + "short_id": "294731f7", + "title": "Use grpc 1.11.0", + "created_at": "2018-05-18T16:45:36.000+00:00", + "parent_ids": null, + "message": "Use grpc 1.11.0", + "author_name": "Jacob Vosmaer", + "author_email": "jacob@gitlab.com", + "authored_date": "2018-05-17T15:43:39.000+00:00", + "committer_name": "Stan Hu", + "committer_email": "stanhu@gmail.com", + "committed_date": "2018-05-18T16:45:36.000+00:00" + }, + "merged": false, + "protected": false, + "developers_can_push": false, + "developers_can_merge": false, + "can_push": false + }, + { + "name": "10-7-stable", + "commit": { + "id": "970c032ea86d9fe8421a60a4118839a971285217", + "short_id": "970c032e", + "title": "Update VERSION to 10.7.6", + "created_at": "2018-06-21T16:11:20.000+00:00", + "parent_ids": null, + "message": "Update VERSION to 10.7.6", + "author_name": "Alessio Caiazza", + "author_email": "acaiazza@gitlab.com", + "authored_date": "2018-06-21T16:11:20.000+00:00", + "committer_name": "Alessio Caiazza", + "committer_email": "acaiazza@gitlab.com", + "committed_date": "2018-06-21T16:11:20.000+00:00" + }, + "merged": false, + "protected": true, + "developers_can_push": false, + "developers_can_merge": false, + "can_push": false + }, + { + "name": "10-7-stable-patch-1-fix-18443", + "commit": { + "id": "1950eecac0406173debcb8589746bd76de2b2406", + "short_id": "1950eeca", + "title": "Merge branch 'sh-fix-web-ide-typo-docs' into 'master'", + "created_at": "2018-04-20T09:03:20.000+00:00", + "parent_ids": null, + "message": "Merge branch 'sh-fix-web-ide-typo-docs' into 'master'", + "author_name": "Rémy Coutable", + "author_email": "remy@rymai.me", + "authored_date": "2018-04-18T08:26:46.000+00:00", + "committer_name": "Filipa Lacerda", + "committer_email": "filipa@gitlab.com", + "committed_date": "2018-04-20T09:03:20.000+00:00" + }, + "merged": false, + "protected": false, + "developers_can_push": false, + "developers_can_merge": false, + "can_push": false + } +] \ No newline at end of file diff --git a/mocks/__files/members/members.json b/mocks/__files/members/members.json new file mode 100644 index 0000000..7cc9a39 --- /dev/null +++ b/mocks/__files/members/members.json @@ -0,0 +1,102 @@ +[ + { + "id": 5497, + "name": "🚄 Job van der Voort 🚀", + "username": "JobV", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/07e1e9ffdda52d8c519ac5c49929d7dc?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/JobV", + "access_level": 30, + "expires_at": null + }, + { + "id": 58926, + "name": "Haydn Mackay", + "username": "Haydn", + "state": "active", + "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/58926/H_head_shot2.png", + "web_url": "https://gitlab.com/Haydn", + "access_level": 30, + "expires_at": null + }, + { + "id": 268956, + "name": "Matthew Wilkinson", + "username": "matthew.wilkinson", + "state": "active", + "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/268956/prime.jpg", + "web_url": "https://gitlab.com/matthew.wilkinson", + "access_level": 10, + "expires_at": null + }, + { + "id": 370493, + "name": "Luke Babb", + "username": "luke", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/5290ebc0843bd3b1df1c7c1620e63295?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/luke", + "access_level": 30, + "expires_at": null + }, + { + "id": 128633, + "name": "Rémy Coutable", + "username": "rymai", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/263da227929cc0035cb0eba512bcf81a?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/rymai", + "access_level": 40, + "expires_at": null + }, + { + "id": 273486, + "name": "James Lopez", + "username": "jameslopez", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/3731e7dd4f2b4fa8ae184c0a7519dd58?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/jameslopez", + "access_level": 40, + "expires_at": null + }, + { + "id": 402401, + "name": "Bot", + "username": "jobbot", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/aaa6738f1ebf25404010884af511b0e7?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/jobbot", + "access_level": 20, + "expires_at": null + }, + { + "id": 300478, + "name": "Jacob Schatz", + "username": "jschatz1", + "state": "active", + "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/300478/avatar.png", + "web_url": "https://gitlab.com/jschatz1", + "access_level": 40, + "expires_at": null + }, + { + "id": 444, + "name": "Dmitriy Zaporozhets", + "username": "dzaporozhets", + "state": "active", + "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/444/avatar.png", + "web_url": "https://gitlab.com/dzaporozhets", + "access_level": 40, + "expires_at": null + }, + { + "id": 424775, + "name": "Mark Pundsack", + "username": "markpundsack", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/26cf0d1d89d41b47dc9a9d70a20d721d?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/markpundsack", + "access_level": 30, + "expires_at": null + } +] \ No newline at end of file diff --git a/mocks/__files/merge_requests/merge_requests.json b/mocks/__files/merge_requests/merge_requests.json new file mode 100644 index 0000000..a801af5 --- /dev/null +++ b/mocks/__files/merge_requests/merge_requests.json @@ -0,0 +1,618 @@ +[ + { + "id": 13932943, + "iid": 20569, + "project_id": 13083, + "title": "WIP: Fix autosave issues for MR discussions", + "description": "Fixes multiple autosave issues and ESC confirmations around noteable shared components and new MR discussions.\r\n\r\n### Fixes autosave issue in noteable shared components\r\n![_mr-autosave](/uploads/2997c1e1d745ccd70f8ccf6854e86b56/_mr-autosave.gif)\r\n\r\n### Fixes ESC confirmation and autosave issues in reply a discussion form\r\n![_mr-esc-confirm](/uploads/79f7c7aace864ce02bd680099c715fc2/_mr-esc-confirm.gif)\r\n\r\n### Adds ESC confirmation to new discussion form\r\n![_mr-esc-confirm2](/uploads/a4f3b3d41fb3b15db0e1a88f89264622/_mr-esc-confirm2.gif)\r\n\r\n\r\nFixes https://gitlab.com/gitlab-org/gitlab-ce/issues/48876 and https://gitlab.com/gitlab-org/gitlab-ce/issues/48877", + "state": "opened", + "created_at": "2018-07-11T22:39:55.571Z", + "updated_at": "2018-07-11T23:35:44.014Z", + "target_branch": "master", + "source_branch": "_acet-fix-mr-autosave", + "upvotes": 0, + "downvotes": 0, + "author": { + "id": 502136, + "name": "Fatih Acet", + "username": "fatihacet", + "state": "active", + "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/502136/avatar.png", + "web_url": "https://gitlab.com/fatihacet" + }, + "assignee": { + "id": 502136, + "name": "Fatih Acet", + "username": "fatihacet", + "state": "active", + "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/502136/avatar.png", + "web_url": "https://gitlab.com/fatihacet" + }, + "source_project_id": 13083, + "target_project_id": 13083, + "labels": [ + "Discussion", + "Pick into 11.1", + "bug", + "frontend", + "mr refactor", + "regression", + "reproduced on GitLab.com" + ], + "work_in_progress": true, + "milestone": { + "id": 450583, + "iid": 13, + "group_id": 9970, + "title": "11.1", + "description": "", + "state": "active", + "created_at": "2018-01-23T21:40:27.318Z", + "updated_at": "2018-03-01T19:52:29.776Z", + "due_date": "2018-07-22", + "start_date": "2018-06-08", + "web_url": "https://gitlab.com/groups/gitlab-org/-/milestones/13" + }, + "merge_when_pipeline_succeeds": false, + "merge_status": "can_be_merged", + "sha": "da788f233de489315e3155f170700c625af352c4", + "merge_commit_sha": null, + "user_notes_count": 1, + "discussion_locked": null, + "should_remove_source_branch": null, + "force_remove_source_branch": true, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20569", + "time_stats": { + "time_estimate": 0, + "total_time_spent": 0, + "human_time_estimate": null, + "human_total_time_spent": null + }, + "squash": false, + "approvals_before_merge": null + }, + { + "id": 13932747, + "iid": 20568, + "project_id": 13083, + "title": "add initial smoke tests and documentation", + "description": "## What does this MR do?\n\nAdds initial smoke test functionality for quick sanity testing from the UI.\n\n## Are there points in the code the reviewer needs to double check?\n\nThere will be a sister MR to this created in the [QA Repository](https://gitlab.com/gitlab-org/gitlab-qa) regarding documentation on *how to run* these smoke tests.\n\nWe can run them by using:\n\n`bin/qa Test::Smoke http://localhost:3000`\n\nI ran the \"smoke suite\" a couple times: here are my findings.\n\n| Time taken |\n|------------|\n| 50.9s |\n| 50.08s |\n| 50.78 |\n\n## Why was this MR needed?\n\nThis MR was created per discussions in https://gitlab.com/gitlab-org/gitlab-qa/issues/288\n\n## Does this MR meet the acceptance criteria?\n\n- [ ] [Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary\n- [x] [Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs)\n- [x] Tests added for this feature/bug\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\n - [ ] Has been reviewed by a Frontend maintainer\n - [ ] Has been reviewed by a Backend maintainer\n- [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\n- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\n- [ ] End-to-end tests pass (`package-and-qa` manual pipeline job)\n\n## What are the relevant issue numbers?\n\n- https://gitlab.com/gitlab-org/gitlab-qa/issues/288\n\n## Notes\n\nWe should of course expand this suite, perhaps adding more `describe` scenarios in our source base to what we believe should be constituted as a \"smoke test.\"\n\n/cc @gl\\-quality @rspeicher @grzesiek @stanhu", + "state": "opened", + "created_at": "2018-07-11T22:18:59.366Z", + "updated_at": "2018-07-11T22:19:01.327Z", + "target_branch": "master", + "source_branch": "qa-smoke-tests", + "upvotes": 0, + "downvotes": 0, + "author": { + "id": 272636, + "name": "Dan Davison", + "username": "ddavison", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/6e56557ffa1baafe3e73e45bd2dc9524?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/ddavison" + }, + "assignee": { + "id": 2097582, + "name": "Mek Stittri", + "username": "meks", + "state": "active", + "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/2097582/avatar.png", + "web_url": "https://gitlab.com/meks" + }, + "source_project_id": 13083, + "target_project_id": 13083, + "labels": [ + "Discussion", + "QA", + "Quality" + ], + "work_in_progress": false, + "milestone": null, + "merge_when_pipeline_succeeds": false, + "merge_status": "can_be_merged", + "sha": "2d06e080106b0d20adeda763bb5bc6beae2c8535", + "merge_commit_sha": null, + "user_notes_count": 0, + "discussion_locked": null, + "should_remove_source_branch": null, + "force_remove_source_branch": false, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20568", + "time_stats": { + "time_estimate": 0, + "total_time_spent": 0, + "human_time_estimate": null, + "human_total_time_spent": null + }, + "squash": false, + "approvals_before_merge": null + }, + { + "id": 13931916, + "iid": 20567, + "project_id": 13083, + "title": "WIP: Resolve \"Remove ghost notification settings for groups and projects\"", + "description": "## What does this MR do?\n\n## Are there points in the code the reviewer needs to double check?\n\n## Why was this MR needed?\n\n## Screenshots (if relevant)\n\n## Does this MR meet the acceptance criteria?\n\n- [x] [Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary\n- [ ] [Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs)\n- [ ] API support added\n- [x] Tests added for this feature/bug\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\n - [ ] Has been reviewed by a UX Designer\n - [ ] Has been reviewed by a Frontend maintainer\n - [ ] Has been reviewed by a Backend maintainer\n - [ ] Has been reviewed by a Database specialist\n- [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\n- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\n- [x] Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides)\n- [ ] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)\n- [ ] Internationalization required/considered\n- [ ] End-to-end tests pass (`package-and-qa` manual pipeline job)\n\n## What are the relevant issue numbers?\n\n\nCloses #44824", + "state": "opened", + "created_at": "2018-07-11T21:06:10.653Z", + "updated_at": "2018-07-11T21:06:43.081Z", + "target_branch": "master", + "source_branch": "44824-remove-ghost-notification-settings-for-group-and-project", + "upvotes": 0, + "downvotes": 0, + "author": { + "id": 331646, + "name": "🙈 jacopo beschi 🙉", + "username": "jacopo-beschi", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/692fb66988ac3863f360e846c1afc4f3?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/jacopo-beschi" + }, + "assignee": { + "id": 331646, + "name": "🙈 jacopo beschi 🙉", + "username": "jacopo-beschi", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/692fb66988ac3863f360e846c1afc4f3?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/jacopo-beschi" + }, + "source_project_id": 1915107, + "target_project_id": 13083, + "labels": [], + "work_in_progress": true, + "milestone": null, + "merge_when_pipeline_succeeds": false, + "merge_status": "cannot_be_merged", + "sha": "4cf0900526027785658829666f235349bafe4475", + "merge_commit_sha": null, + "user_notes_count": 0, + "discussion_locked": null, + "should_remove_source_branch": null, + "force_remove_source_branch": true, + "allow_collaboration": true, + "allow_maintainer_to_push": true, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20567", + "time_stats": { + "time_estimate": 0, + "total_time_spent": 0, + "human_time_estimate": null, + "human_total_time_spent": null + }, + "squash": true, + "approvals_before_merge": null + }, + { + "id": 13929701, + "iid": 20566, + "project_id": 13083, + "title": "Fix archived parameter for projects API", + "description": "## What does this MR do?\n\nFixes a regression where the archived parameter is incorrectly applied to the projects finder.\n\n## Are there points in the code the reviewer needs to double check?\n\nIt changes default (but incorrect per spec) API behavior which is in place for 1,5 years.\nCurrently without `archived` parameter only active projects are returned (so filter `archived=false` is incorrectly applied).\nThe current default API behavior matches GUI behavior, however it's not possible to filter archived projects only via API (which is possible via GUI).\n\nThis MR replaces !17244 (from @razer6), which is un-maintained for last 5 months due to contributor inactivity.\nThe code from that MR is refreshed and remaining open comments are implemented.\n\n## Why was this MR needed?\n\nSee discussions in #32301 and !17244\n\n## Does this MR meet the acceptance criteria?\n\n- [x] [Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary\n- [x] [Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs)\n- [x] API support added\n- [x] Tests added for this feature/bug\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\n - [ ] Has been reviewed by a UX Designer\n - [ ] Has been reviewed by a Frontend maintainer\n - [ ] Has been reviewed by a Backend maintainer\n - [ ] Has been reviewed by a Database specialist\n- [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\n- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\n- [x] Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides)\n- [x] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)\n- [x] Internationalization required/considered\n- [ ] End-to-end tests pass (`package-and-qa` manual pipeline job)\n\n## What are the relevant issue numbers?\n\nCloses #32301", + "state": "opened", + "created_at": "2018-07-11T19:55:40.907Z", + "updated_at": "2018-07-11T20:00:23.499Z", + "target_branch": "master", + "source_branch": "fix-project-api-archived", + "upvotes": 0, + "downvotes": 0, + "author": { + "id": 1334624, + "name": "Peter Marko", + "username": "petermarko", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/28cbcbcb84533b9f8afc75521bdc457e?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/petermarko" + }, + "assignee": null, + "source_project_id": 904528, + "target_project_id": 13083, + "labels": [], + "work_in_progress": false, + "milestone": null, + "merge_when_pipeline_succeeds": false, + "merge_status": "can_be_merged", + "sha": "4fd3d6ed3bf663f8d978db62fb1f552c529e2950", + "merge_commit_sha": null, + "user_notes_count": 0, + "discussion_locked": null, + "should_remove_source_branch": null, + "force_remove_source_branch": true, + "allow_collaboration": true, + "allow_maintainer_to_push": true, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20566", + "time_stats": { + "time_estimate": 0, + "total_time_spent": 0, + "human_time_estimate": null, + "human_total_time_spent": null + }, + "squash": false, + "approvals_before_merge": null + }, + { + "id": 13929032, + "iid": 20565, + "project_id": 13083, + "title": "Remove healthchecks from prometheus endpoint", + "description": "## What does this MR do?\r\n\r\n- Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/49112\r\n\r\n## Are there points in the code the reviewer needs to double check?\r\n\r\n```shell\r\n# Simulate a Gitaly server under extreme load....\r\n$ lldb -p $(pgrep gitaly) \u0026 \r\n\r\n# Without this fix: Prometheus scrape endpoint times out after ~55s with a 500 error\r\n$ time curl http://localhost:3000/-/metrics\r\nNameError at /-/metrics\r\n=======================\r\n\r\n\u003e uninitialized constant GRPC::GRPC\r\n...\r\nreal\t0m58.135s\r\nuser\t0m0.014s\r\nsys\t0m0.016s\r\n\r\n# With this fix: Prometheus scrape endpoint returns the prometheus metrics successfully, immediately\r\n$ time curl http://localhost:3000/-/metrics\r\nclient_browser_timing_count{event=\"contentComplete\"} 40\r\n# HELP client_browser_timing Multiprocess metric\r\n# TYPE client_browser_timing histogram\r\nclient_browser_timing_bucket{event=\"connect\",le=\"+Inf\"} 40\r\nclient_browser_timing_bucket{event=\"connect\",le=\"0.005\"} 40\r\n...\r\n\r\nreal\t0m0.607s\r\nuser\t0m0.020s\r\nsys\t0m0.027s\r\n\r\n```\r\n\r\n## Why was this MR needed?\r\n\r\nSimilar reasons as https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20552:\r\n\r\n\u003e When any single Gitaly server fails, up to 50% of the web and api fleet workload is saturated by prometheus healthcheck requests, which happen 4 times a minute on each node, with each request currently taking almost a full minute, before failing with a 500 error.\r\n\r\nWith this fix: when any single Gitaly server fails: the prometheus endpoint will return immediately with the correct metrics and a 200 response.\r\n\r\n## Does this MR meet the acceptance criteria?\r\n\r\n- [ ] [Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary\r\n- [ ] [Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs)\r\n- [ ] API support added\r\n- [ ] Tests added for this feature/bug\r\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\r\n - [ ] Has been reviewed by a UX Designer\r\n - [ ] Has been reviewed by a Frontend maintainer\r\n - [ ] Has been reviewed by a Backend maintainer\r\n - [ ] Has been reviewed by a Database specialist\r\n- [ ] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\r\n- [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\r\n- [ ] Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides)\r\n- [ ] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)\r\n- [ ] Internationalization required/considered\r\n- [ ] End-to-end tests pass (`package-and-qa` manual pipeline job)\r\n\r\n## What are the relevant issue numbers?", + "state": "opened", + "created_at": "2018-07-11T19:08:21.900Z", + "updated_at": "2018-07-11T19:11:52.822Z", + "target_branch": "master", + "source_branch": "an/no-healthcheck-until-brooklyn", + "upvotes": 0, + "downvotes": 0, + "author": { + "id": 895869, + "name": "Andrew Newdigate", + "username": "andrewn", + "state": "active", + "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/895869/avatar.png", + "web_url": "https://gitlab.com/andrewn" + }, + "assignee": null, + "source_project_id": 13083, + "target_project_id": 13083, + "labels": [ + "Gitaly", + "availability", + "performance" + ], + "work_in_progress": false, + "milestone": { + "id": 450583, + "iid": 13, + "group_id": 9970, + "title": "11.1", + "description": "", + "state": "active", + "created_at": "2018-01-23T21:40:27.318Z", + "updated_at": "2018-03-01T19:52:29.776Z", + "due_date": "2018-07-22", + "start_date": "2018-06-08", + "web_url": "https://gitlab.com/groups/gitlab-org/-/milestones/13" + }, + "merge_when_pipeline_succeeds": false, + "merge_status": "can_be_merged", + "sha": "b4cc74f3b45ed206fdcfb021cbdbc8621807177c", + "merge_commit_sha": null, + "user_notes_count": 1, + "discussion_locked": null, + "should_remove_source_branch": null, + "force_remove_source_branch": true, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20565", + "time_stats": { + "time_estimate": 0, + "total_time_spent": 0, + "human_time_estimate": null, + "human_total_time_spent": null + }, + "squash": true, + "approvals_before_merge": null + }, + { + "id": 13928405, + "iid": 20564, + "project_id": 13083, + "title": "Revert \"Log push output on exception\" because it is no longer needed", + "description": "## What does this MR do?\n\nWe have successfully diagnosed https://gitlab.com/gitlab-org/gitlab-ce/issues/48241, so this logging is no longer needed.\n\n## Does this MR meet the acceptance criteria?\n\n- ~~[Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary~~\n- ~~[Documentation created/updated](https://docs.gitlab.com/ee/development/writing_documentation.html#contributing-to-docs)~~\n- ~~API support added~~\n- ~~Tests added for this feature/bug~~\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\n - [ ] Has been reviewed by a Backend maintainer\n- ~~Conform by the [merge request performance guides]~~(https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\n- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\n- ~~Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides)~~\n- [x] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)\n- ~~Internationalization required/considered~~\n- [x] End-to-end tests pass (`package-and-qa` manual pipeline job)\n\n## What are the relevant issue numbers?\n\nhttps://gitlab.com/gitlab-org/gitlab-ce/issues/48241", + "state": "opened", + "created_at": "2018-07-11T18:44:19.250Z", + "updated_at": "2018-07-11T21:48:31.133Z", + "target_branch": "master", + "source_branch": "mk/remove-push-output-logging", + "upvotes": 0, + "downvotes": 0, + "author": { + "id": 1144264, + "name": "Michael Kozono", + "username": "mkozono", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/ddaa576b4b6933a6fb7a996088c30f6c?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/mkozono" + }, + "assignee": { + "id": 128633, + "name": "Rémy Coutable", + "username": "rymai", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/263da227929cc0035cb0eba512bcf81a?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/rymai" + }, + "source_project_id": 13083, + "target_project_id": 13083, + "labels": [ + "Quality", + "technical debt" + ], + "work_in_progress": false, + "milestone": null, + "merge_when_pipeline_succeeds": false, + "merge_status": "can_be_merged", + "sha": "2555bf5ee35862a9f940d3004e3b9f7bdf196e12", + "merge_commit_sha": null, + "user_notes_count": 1, + "discussion_locked": null, + "should_remove_source_branch": null, + "force_remove_source_branch": true, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20564", + "time_stats": { + "time_estimate": 0, + "total_time_spent": 0, + "human_time_estimate": null, + "human_total_time_spent": null + }, + "squash": true, + "approvals_before_merge": null + }, + { + "id": 13927668, + "iid": 20563, + "project_id": 13083, + "title": "Resolve \"Follow-up from \"Milestone tests\"\"", + "description": "## What does this MR do?\n\nThis MR extracts the `has_milestone?` method out of `QA::Page::MergeRequest::Show` and into `QA::Page::Issuable::Sidebar`. \n\n## Does this MR meet the acceptance criteria?\n\n- [x] Tests added for this feature/bug\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\n - [ ] Has been reviewed by a Backend maintainer\n- [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\n- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\n- [ ] End-to-end tests pass (`package-and-qa` manual pipeline job)\n\n## What are the relevant issue numbers?\n\nCloses #48690", + "state": "opened", + "created_at": "2018-07-11T18:17:37.205Z", + "updated_at": "2018-07-11T18:27:01.373Z", + "target_branch": "master", + "source_branch": "48690-follow-up-from-milestone-tests", + "upvotes": 0, + "downvotes": 0, + "author": { + "id": 272636, + "name": "Dan Davison", + "username": "ddavison", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/6e56557ffa1baafe3e73e45bd2dc9524?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/ddavison" + }, + "assignee": { + "id": 128633, + "name": "Rémy Coutable", + "username": "rymai", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/263da227929cc0035cb0eba512bcf81a?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/rymai" + }, + "source_project_id": 13083, + "target_project_id": 13083, + "labels": [ + "QA", + "Quality", + "enhancement" + ], + "work_in_progress": false, + "milestone": { + "id": 494367, + "iid": 15, + "group_id": 9970, + "title": "11.2", + "description": "", + "state": "active", + "created_at": "2018-03-27T19:26:05.990Z", + "updated_at": "2018-03-27T19:28:34.472Z", + "due_date": "2018-08-22", + "start_date": "2018-07-08", + "web_url": "https://gitlab.com/groups/gitlab-org/-/milestones/15" + }, + "merge_when_pipeline_succeeds": false, + "merge_status": "can_be_merged", + "sha": "a825dc229a9b9ecb76dc6b88d7002afe29ff5781", + "merge_commit_sha": null, + "user_notes_count": 0, + "discussion_locked": null, + "should_remove_source_branch": null, + "force_remove_source_branch": true, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20563", + "time_stats": { + "time_estimate": 0, + "total_time_spent": 0, + "human_time_estimate": null, + "human_total_time_spent": null + }, + "squash": false, + "approvals_before_merge": null + }, + { + "id": 13925429, + "iid": 20562, + "project_id": 13083, + "title": "Fix MR widget border", + "description": "![Screen_Shot_2018-07-11_at_12.08.08_PM](/uploads/58608375fdec4ae03fa245ef17e8adea/Screen_Shot_2018-07-11_at_12.08.08_PM.png)", + "state": "merged", + "created_at": "2018-07-11T17:08:41.143Z", + "updated_at": "2018-07-11T17:39:06.035Z", + "target_branch": "master", + "source_branch": "fix-mr-widget-border", + "upvotes": 0, + "downvotes": 0, + "author": { + "id": 201566, + "name": "Annabel Gray", + "username": "annabeldunstone", + "state": "active", + "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/201566/avatar.png", + "web_url": "https://gitlab.com/annabeldunstone" + }, + "assignee": { + "id": 482476, + "name": "Filipa Lacerda", + "username": "filipa", + "state": "active", + "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/482476/avatar.png", + "web_url": "https://gitlab.com/filipa" + }, + "source_project_id": 13083, + "target_project_id": 13083, + "labels": [ + "Pick into 11.1", + "frontend", + "regression" + ], + "work_in_progress": false, + "milestone": { + "id": 450583, + "iid": 13, + "group_id": 9970, + "title": "11.1", + "description": "", + "state": "active", + "created_at": "2018-01-23T21:40:27.318Z", + "updated_at": "2018-03-01T19:52:29.776Z", + "due_date": "2018-07-22", + "start_date": "2018-06-08", + "web_url": "https://gitlab.com/groups/gitlab-org/-/milestones/13" + }, + "merge_when_pipeline_succeeds": true, + "merge_status": "can_be_merged", + "sha": "0cf9af01ce5c6db84aba8d40defc0cb03cb6e75f", + "merge_commit_sha": "a781d0f9b2b89f5a3fa33dc72fcefb485f2078ce", + "user_notes_count": 2, + "discussion_locked": null, + "should_remove_source_branch": true, + "force_remove_source_branch": true, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20562", + "time_stats": { + "time_estimate": 0, + "total_time_spent": 0, + "human_time_estimate": null, + "human_total_time_spent": null + }, + "squash": false, + "approvals_before_merge": null + }, + { + "id": 13925353, + "iid": 20561, + "project_id": 13083, + "title": "Resolve \"QA: False failure on QA test \"Push to protected branch when allowed\" during staging failover rehearsal\"", + "description": "## What does this MR do?\n\nThis ensure the external encoding is set to UTF-8 when running QA specs.\n\n## Are there points in the code the reviewer needs to double check?\n\nIf QA passes I guess that's it.\n\n## Does this MR meet the acceptance criteria?\n\n- Conform by the [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html)\n - [ ] Has been reviewed by a Backend maintainer\n- [x] Conform by the [merge request performance guides](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)\n- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/CONTRIBUTING.md#style-guides)\n- [x] Conform by the [database guides](https://docs.gitlab.com/ee/development/README.html#databases-guides)\n- [x] If you have multiple commits, please combine them into a few logically organized commits by [squashing them](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)\n- [ ] End-to-end tests pass (`package-and-qa` manual pipeline job)\n\n## What are the relevant issue numbers?\n\nCloses #48241", + "state": "opened", + "created_at": "2018-07-11T17:02:36.349Z", + "updated_at": "2018-07-11T17:03:50.347Z", + "target_branch": "master", + "source_branch": "48241-fix-invalid-byte-sequence-in-qa", + "upvotes": 0, + "downvotes": 0, + "author": { + "id": 128633, + "name": "Rémy Coutable", + "username": "rymai", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/263da227929cc0035cb0eba512bcf81a?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/rymai" + }, + "assignee": { + "id": 128633, + "name": "Rémy Coutable", + "username": "rymai", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/263da227929cc0035cb0eba512bcf81a?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/rymai" + }, + "source_project_id": 13083, + "target_project_id": 13083, + "labels": [ + "QA", + "Quality", + "bug" + ], + "work_in_progress": false, + "milestone": { + "id": 494367, + "iid": 15, + "group_id": 9970, + "title": "11.2", + "description": "", + "state": "active", + "created_at": "2018-03-27T19:26:05.990Z", + "updated_at": "2018-03-27T19:28:34.472Z", + "due_date": "2018-08-22", + "start_date": "2018-07-08", + "web_url": "https://gitlab.com/groups/gitlab-org/-/milestones/15" + }, + "merge_when_pipeline_succeeds": false, + "merge_status": "can_be_merged", + "sha": "c9a27a42f0e07799bedfbc49af711dc84449ad17", + "merge_commit_sha": null, + "user_notes_count": 1, + "discussion_locked": null, + "should_remove_source_branch": null, + "force_remove_source_branch": true, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20561", + "time_stats": { + "time_estimate": 0, + "total_time_spent": 0, + "human_time_estimate": null, + "human_total_time_spent": null + }, + "squash": false, + "approvals_before_merge": null + }, + { + "id": 13924879, + "iid": 20560, + "project_id": 13083, + "title": "Revert \"Merge branch 'ee-5481-epic-todos' into 'master'\"", + "description": "Revert of https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/19908", + "state": "merged", + "created_at": "2018-07-11T16:34:45.542Z", + "updated_at": "2018-07-11T20:08:18.664Z", + "target_branch": "master", + "source_branch": "revert-todos-epic", + "upvotes": 0, + "downvotes": 0, + "author": { + "id": 508743, + "name": "Jarka Kadlecová", + "username": "jarka", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/3931dae84deb01d2881e4909077b8dbe?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/jarka" + }, + "assignee": { + "id": 209240, + "name": "Yorick Peterse", + "username": "yorickpeterse", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/644bcc0c58aa01920c4de4f941afcac9?s=80\u0026d=identicon", + "web_url": "https://gitlab.com/yorickpeterse" + }, + "source_project_id": 13083, + "target_project_id": 13083, + "labels": [ + "Discussion", + "bug" + ], + "work_in_progress": false, + "milestone": { + "id": 450583, + "iid": 13, + "group_id": 9970, + "title": "11.1", + "description": "", + "state": "active", + "created_at": "2018-01-23T21:40:27.318Z", + "updated_at": "2018-03-01T19:52:29.776Z", + "due_date": "2018-07-22", + "start_date": "2018-06-08", + "web_url": "https://gitlab.com/groups/gitlab-org/-/milestones/13" + }, + "merge_when_pipeline_succeeds": true, + "merge_status": "can_be_merged", + "sha": "8717c7dad9b5a8fa21ec9a652c54718a6b4c2175", + "merge_commit_sha": "9591fdbed7c14712986a8308036787481bbb3bc0", + "user_notes_count": 1, + "discussion_locked": null, + "should_remove_source_branch": true, + "force_remove_source_branch": false, + "web_url": "https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20560", + "time_stats": { + "time_estimate": 0, + "total_time_spent": 0, + "human_time_estimate": null, + "human_total_time_spent": null + }, + "squash": false, + "approvals_before_merge": null + } +] \ No newline at end of file diff --git a/mocks/__files/ssh_keys/ssh_keys.json b/mocks/__files/ssh_keys/ssh_keys.json new file mode 100644 index 0000000..4e65703 --- /dev/null +++ b/mocks/__files/ssh_keys/ssh_keys.json @@ -0,0 +1,20 @@ +[ + { + "id": 1, + "title": "Public key", + "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=", + "created_at": "2014-08-01T14:47:39.080Z" + }, + { + "id": 2, + "title": "Whatever key", + "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=", + "created_at": "2014-08-01T14:47:39.080Z" + }, + { + "id": 3, + "title": "Another Public key", + "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=", + "created_at": "2014-08-01T14:47:39.080Z" + } +] \ No newline at end of file diff --git a/mocks/mappings/badges/project_1_badge_1.json b/mocks/mappings/badges/project_1_badge_1.json new file mode 100644 index 0000000..c08e112 --- /dev/null +++ b/mocks/mappings/badges/project_1_badge_1.json @@ -0,0 +1,12 @@ +{ + "request": { + "url": "/api/v4/projects/1/badges/1", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "badges/badge_1.json", + "headers": { + } + } +} diff --git a/mocks/mappings/badges/project_1_badges.json b/mocks/mappings/badges/project_1_badges.json new file mode 100644 index 0000000..97f9d74 --- /dev/null +++ b/mocks/mappings/badges/project_1_badges.json @@ -0,0 +1,14 @@ +{ + "request": { + "url": "/api/v4/projects/1/badges?page=1&per_page=10", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "badges/badges.json", + "headers": { + "X-Page": "1", + "X-Per-Page": "10" + } + } +} diff --git a/mocks/mappings/branches/project_1_branches.json b/mocks/mappings/branches/project_1_branches.json new file mode 100644 index 0000000..8d10e2c --- /dev/null +++ b/mocks/mappings/branches/project_1_branches.json @@ -0,0 +1,14 @@ +{ + "request": { + "url": "/api/v4/projects/1/branches?page=1&per_page=10", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "branches/branches.json", + "headers": { + "X-Page": "1", + "X-Per-Page": "10" + } + } +} diff --git a/mocks/mappings/groups/groups.json b/mocks/mappings/groups/groups.json index 975b972..529a489 100644 --- a/mocks/mappings/groups/groups.json +++ b/mocks/mappings/groups/groups.json @@ -7,6 +7,8 @@ "status": 200, "bodyFileName": "groups/groups.json", "headers": { + "X-Page": "1", + "X-Per-Page": "10" } } } diff --git a/mocks/mappings/members/group_1_members.json b/mocks/mappings/members/group_1_members.json new file mode 100644 index 0000000..8c8c027 --- /dev/null +++ b/mocks/mappings/members/group_1_members.json @@ -0,0 +1,14 @@ +{ + "request": { + "url": "/api/v4/groups/1/members?page=1&per_page=10", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "members/members.json", + "headers": { + "X-Page": "1", + "X-Per-Page": "10" + } + } +} diff --git a/mocks/mappings/members/project_1_members.json b/mocks/mappings/members/project_1_members.json new file mode 100644 index 0000000..ac6589d --- /dev/null +++ b/mocks/mappings/members/project_1_members.json @@ -0,0 +1,14 @@ +{ + "request": { + "url": "/api/v4/projects/1/members?page=1&per_page=10", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "members/members.json", + "headers": { + "X-Page": "1", + "X-Per-Page": "10" + } + } +} diff --git a/mocks/mappings/merge_requests/group_merge_requests.json b/mocks/mappings/merge_requests/group_merge_requests.json new file mode 100644 index 0000000..84298d7 --- /dev/null +++ b/mocks/mappings/merge_requests/group_merge_requests.json @@ -0,0 +1,14 @@ +{ + "request": { + "url": "/api/v4/groups/1/merge_requests?page=1&per_page=10", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "merge_requests/merge_requests.json", + "headers": { + "X-Page": "1", + "X-Per-Page": "10" + } + } +} diff --git a/mocks/mappings/merge_requests/merge_requests.json b/mocks/mappings/merge_requests/merge_requests.json new file mode 100644 index 0000000..a007dcc --- /dev/null +++ b/mocks/mappings/merge_requests/merge_requests.json @@ -0,0 +1,14 @@ +{ + "request": { + "url": "/api/v4/merge_requests?page=1&per_page=10", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "merge_requests/merge_requests.json", + "headers": { + "X-Page": "1", + "X-Per-Page": "10" + } + } +} diff --git a/mocks/mappings/merge_requests/project_merge_requests.json b/mocks/mappings/merge_requests/project_merge_requests.json new file mode 100644 index 0000000..e85605c --- /dev/null +++ b/mocks/mappings/merge_requests/project_merge_requests.json @@ -0,0 +1,14 @@ +{ + "request": { + "url": "/api/v4/projects/1/merge_requests?page=1&per_page=10", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "merge_requests/merge_requests.json", + "headers": { + "X-Page": "1", + "X-Per-Page": "10" + } + } +} diff --git a/mocks/mappings/namespaces/namespaces.json b/mocks/mappings/namespaces/namespaces.json index 78dabd6..45aa898 100644 --- a/mocks/mappings/namespaces/namespaces.json +++ b/mocks/mappings/namespaces/namespaces.json @@ -7,6 +7,8 @@ "status": 200, "bodyFileName": "namespaces/namespaces.json", "headers": { + "X-Page": "1", + "X-Per-Page": "10" } } } diff --git a/mocks/mappings/namespaces/namespaces_search.json b/mocks/mappings/namespaces/namespaces_search.json index ebe3505..cf0f53f 100644 --- a/mocks/mappings/namespaces/namespaces_search.json +++ b/mocks/mappings/namespaces/namespaces_search.json @@ -7,6 +7,8 @@ "status": 200, "bodyFileName": "namespaces/namespaces_search.json", "headers": { + "X-Page": "1", + "X-Per-Page": "10" } } } diff --git a/mocks/mappings/projects/projects.json b/mocks/mappings/projects/projects.json index 98bc4e7..616a2a2 100644 --- a/mocks/mappings/projects/projects.json +++ b/mocks/mappings/projects/projects.json @@ -7,6 +7,8 @@ "status": 200, "bodyFileName": "projects/projects.json", "headers": { + "X-Page": "1", + "X-Per-Page": "10" } } } diff --git a/mocks/mappings/runners/runners.json b/mocks/mappings/runners/runners.json index 675dcb3..99a920d 100644 --- a/mocks/mappings/runners/runners.json +++ b/mocks/mappings/runners/runners.json @@ -7,6 +7,8 @@ "status": 200, "bodyFileName": "runners/runners.json", "headers": { + "X-Page": "1", + "X-Per-Page": "10" } } } diff --git a/mocks/mappings/ssh_keys/current_user_ssh_keys.json b/mocks/mappings/ssh_keys/current_user_ssh_keys.json new file mode 100644 index 0000000..2a0dc34 --- /dev/null +++ b/mocks/mappings/ssh_keys/current_user_ssh_keys.json @@ -0,0 +1,14 @@ +{ + "request": { + "url": "/api/v4/user/keys?page=1&per_page=10", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "ssh_keys/ssh_keys.json", + "headers": { + "X-Page": "1", + "X-Per-Page": "10" + } + } +} diff --git a/mocks/mappings/ssh_keys/user_1_ssh_keys.json b/mocks/mappings/ssh_keys/user_1_ssh_keys.json new file mode 100644 index 0000000..f19cd19 --- /dev/null +++ b/mocks/mappings/ssh_keys/user_1_ssh_keys.json @@ -0,0 +1,14 @@ +{ + "request": { + "url": "/api/v4/users/1/keys?page=1&per_page=10", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "ssh_keys/ssh_keys.json", + "headers": { + "X-Page": "1", + "X-Per-Page": "10" + } + } +} diff --git a/mocks/mappings/users/users.json b/mocks/mappings/users/users.json index 534db10..e2dd599 100644 --- a/mocks/mappings/users/users.json +++ b/mocks/mappings/users/users.json @@ -7,6 +7,8 @@ "status": 200, "bodyFileName": "users/users.json", "headers": { + "X-Page": "1", + "X-Per-Page": "10" } } }