Repository: xanzy/go-gitlab
Pull request #1979 (2024-08-04 03:22:42)

feat: add Bitbucket Cloud and Server import endpoints
This expands the changes in #1942 to fully implement #1629 and #1859 by adding functionality for the Bitbucket Cloud and Server repository import endpoints. 

Although the [API documentation](https://docs.gitlab.com/ee/api/import.html) does not specify expected responses, the [OpenAPI specification](https://docs.gitlab.com/ee/api/openapi/openapi_interactive.html) looks like it gives sufficient information.

This is marked as a "draft" for now since I have not yet tested against real Bitbucket or GitLab instances. 


Patch:
diff --git a/examples/bitbucket_import.go b/examples/bitbucket_import.go
new file mode 100644
index 0000000..410ba58
--- /dev/null
+++ b/examples/bitbucket_import.go
@@ -0,0 +1,50 @@
+package main
+
+import (
+	"log"
+
+	"github.com/xanzy/go-gitlab"
+)
+
+func bitbucketCloudExample() {
+	git, err := gitlab.NewClient("yourtokengoeshere")
+	if err != nil {
+		log.Fatal(err)
+	}
+
+	cloudOpt := &gitlab.ImportRepositoryFromBitbucketCloudOptions{
+		BitbucketUsername:    gitlab.Ptr("username"),
+		BitbucketAppPassword: gitlab.Ptr("password"),
+		RepoPath:             gitlab.Ptr("some/repo"),
+		TargetNamespace:      gitlab.Ptr("some-group"),
+		NewName:              gitlab.Ptr("some-repo"),
+	}
+	cloudResp, _, err := git.Import.ImportRepositoryFromBitbucketCloud(cloudOpt)
+	if err != nil {
+		log.Fatal(err)
+	}
+	log.Print(cloudResp.String())
+}
+
+func bitbucketServerExample() {
+	git, err := gitlab.NewClient("yourtokengoeshere")
+	if err != nil {
+		log.Fatal(err)
+	}
+
+	serverOpt := &gitlab.ImportRepositoryFromBitbucketServerOptions{
+		BitbucketServerUrl:      gitlab.Ptr("https://bitbucket.example.com"),
+		BitbucketServerUsername: gitlab.Ptr("username"),
+		PersonalAccessToken:     gitlab.Ptr("access-token"),
+		BitbucketServerProject:  gitlab.Ptr("some-project"),
+		BitbucketServerRepo:     gitlab.Ptr("some-repo"),
+		NewName:                 gitlab.Ptr("some-other-repo"),
+		NewNamespace:            gitlab.Ptr("some-group"),
+		TimeoutStrategy:         gitlab.Ptr("pessimistic"),
+	}
+	serverResp, _, err := git.Import.ImportRepositoryFromBitbucketServer(serverOpt)
+	if err != nil {
+		log.Fatal(err)
+	}
+	log.Print(serverResp.String())
+}
diff --git a/groups.go b/groups.go
index 52fd13f..abad280 100644
--- a/groups.go
+++ b/groups.go
@@ -1037,7 +1037,6 @@ type GroupPushRules struct {
 	CommitCommitterCheck       bool       `json:"commit_committer_check"`
 	CommitCommitterNameCheck   bool       `json:"commit_committer_name_check"`
 	RejectUnsignedCommits      bool       `json:"reject_unsigned_commits"`
-	RejectNonDCOCommits        bool       `json:"reject_non_dco_commits"`
 }
 
 // GetGroupPushRules gets the push rules of a group.
@@ -1083,7 +1082,6 @@ type AddGroupPushRuleOptions struct {
 	MemberCheck                *bool   `url:"member_check,omitempty" json:"member_check,omitempty"`
 	PreventSecrets             *bool   `url:"prevent_secrets,omitempty" json:"prevent_secrets,omitempty"`
 	RejectUnsignedCommits      *bool   `url:"reject_unsigned_commits,omitempty" json:"reject_unsigned_commits,omitempty"`
-	RejectNonDCOCommits        *bool   `url:"reject_non_dco_commits,omitempty" json:"reject_non_dco_commits,omitempty"`
 }
 
 // AddGroupPushRule adds push rules to the specified group.
@@ -1129,7 +1127,6 @@ type EditGroupPushRuleOptions struct {
 	MemberCheck                *bool   `url:"member_check,omitempty" json:"member_check,omitempty"`
 	PreventSecrets             *bool   `url:"prevent_secrets,omitempty" json:"prevent_secrets,omitempty"`
 	RejectUnsignedCommits      *bool   `url:"reject_unsigned_commits,omitempty" json:"reject_unsigned_commits,omitempty"`
-	RejectNonDCOCommits        *bool   `url:"reject_non_dco_commits,omitempty" json:"reject_non_dco_commits,omitempty"`
 }
 
 // EditGroupPushRule edits a push rule for a specified group.
diff --git a/import.go b/import.go
index 5178a07..a8164a7 100644
--- a/import.go
+++ b/import.go
@@ -158,3 +158,109 @@ func (s *ImportService) ImportGitHubGistsIntoGitLabSnippets(opt *ImportGitHubGis
 
 	return s.client.Do(req, nil)
 }
+
+// BitbucketServerImport represents the response from an import from Bitbucket
+// Server.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/import.html#import-repository-from-bitbucket-server
+type BitbucketServerImport struct {
+	ID       int    `json:"id"`
+	Name     string `json:"name"`
+	FullPath string `json:"full_path"`
+	FullName string `json:"full_name"`
+	RefsUrl  string `json:"refs_url"`
+}
+
+func (s BitbucketServerImport) String() string {
+	return Stringify(s)
+}
+
+// ImportRepositoryFromBitbucketServerOptions represents the available ImportRepositoryFromBitbucketServer() options.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/import.html#import-repository-from-bitbucket-server
+type ImportRepositoryFromBitbucketServerOptions struct {
+	BitbucketServerUrl      *string `url:"bitbucket_server_url,omitempty" json:"bitbucket_server_url,omitempty"`
+	BitbucketServerUsername *string `url:"bitbucket_server_username,omitempty" json:"bitbucket_server_username,omitempty"`
+	PersonalAccessToken     *string `url:"personal_access_token,omitempty" json:"personal_access_token,omitempty"`
+	BitbucketServerProject  *string `url:"bitbucket_server_project,omitempty" json:"bitbucket_server_project,omitempty"`
+	BitbucketServerRepo     *string `url:"bitbucket_server_repo,omitempty" json:"bitbucket_server_repo,omitempty"`
+	NewName                 *string `url:"new_name,omitempty" json:"new_name,omitempty"`
+	NewNamespace            *string `url:"new_namespace,omitempty" json:"new_namespace,omitempty"`
+	TimeoutStrategy         *string `url:"timeout_strategy,omitempty" json:"timeout_strategy,omitempty"`
+}
+
+// Import a repository from Bitbucket Server.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/import.html#import-repository-from-bitbucket-server
+func (s *ImportService) ImportRepositoryFromBitbucketServer(opt *ImportRepositoryFromBitbucketServerOptions, options ...RequestOptionFunc) (*BitbucketServerImport, *Response, error) {
+	req, err := s.client.NewRequest(http.MethodPost, "import/bitbucket_server", opt, options)
+	if err != nil {
+		return nil, nil, err
+	}
+
+	bsi := new(BitbucketServerImport)
+	resp, err := s.client.Do(req, bsi)
+	if err != nil {
+		return nil, resp, err
+	}
+
+	return bsi, resp, nil
+}
+
+// BitbucketCloudImport represents the response from an import from Bitbucket
+// Cloud.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/import.html#import-repository-from-bitbucket-cloud
+type BitbucketCloudImport struct {
+	ID                    int    `json:"id"`
+	Name                  string `json:"name"`
+	FullPath              string `json:"full_path"`
+	FullName              string `json:"full_name"`
+	RefsUrl               string `json:"refs_url"`
+	ImportSource          string `json:"import_source"`
+	ImportStatus          string `json:"import_status"`
+	HumanImportStatusName string `json:"human_import_status_name"`
+	ProviderLink          string `json:"provider_link"`
+	RelationType          string `json:"relation_type"`
+	ImportWarning         string `json:"import_warning"`
+}
+
+func (s BitbucketCloudImport) String() string {
+	return Stringify(s)
+}
+
+// ImportRepositoryFromBitbucketCloudOptions represents the available
+// ImportRepositoryFromBitbucketCloud() options.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/import.html#import-repository-from-bitbucket-cloud
+type ImportRepositoryFromBitbucketCloudOptions struct {
+	BitbucketUsername    *string `url:"bitbucket_username,omitempty" json:"bitbucket_username,omitempty"`
+	BitbucketAppPassword *string `url:"bitbucket_app_password,omitempty" json:"bitbucket_app_password,omitempty"`
+	RepoPath             *string `url:"repo_path,omitempty" json:"repo_path,omitempty"`
+	TargetNamespace      *string `url:"target_namespace,omitempty" json:"target_namespace,omitempty"`
+	NewName              *string `url:"new_name,omitempty" json:"new_name,omitempty"`
+}
+
+// Import a repository from Bitbucket Cloud.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/import.html#import-repository-from-bitbucket-cloud
+func (s *ImportService) ImportRepositoryFromBitbucketCloud(opt *ImportRepositoryFromBitbucketCloudOptions, options ...RequestOptionFunc) (*BitbucketCloudImport, *Response, error) {
+	req, err := s.client.NewRequest(http.MethodPost, "import/bitbucket", opt, options)
+	if err != nil {
+		return nil, nil, err
+	}
+
+	bci := new(BitbucketCloudImport)
+	resp, err := s.client.Do(req, bci)
+	if err != nil {
+		return nil, resp, err
+	}
+
+	return bci, resp, nil
+}
diff --git a/personal_access_tokens.go b/personal_access_tokens.go
index 14aee9e..e2ea2f5 100644
--- a/personal_access_tokens.go
+++ b/personal_access_tokens.go
@@ -57,14 +57,7 @@ func (p PersonalAccessToken) String() string {
 // https://docs.gitlab.com/ee/api/personal_access_tokens.html#list-personal-access-tokens
 type ListPersonalAccessTokensOptions struct {
 	ListOptions
-	CreatedAfter   *ISOTime `url:"created_after,omitempty" json:"created_after,omitempty"`
-	CreatedBefore  *ISOTime `url:"created_before,omitempty" json:"created_before,omitempty"`
-	LastUsedAfter  *ISOTime `url:"last_used_after,omitempty" json:"last_used_after,omitempty"`
-	LastUsedBefore *ISOTime `url:"last_used_before,omitempty" json:"last_used_before,omitempty"`
-	Revoked        *bool    `url:"revoked,omitempty" json:"revoked,omitempty"`
-	Search         *string  `url:"search,omitempty" json:"search,omitempty"`
-	State          *string  `url:"state,omitempty" json:"state,omitempty"`
-	UserID         *int     `url:"user_id,omitempty" json:"user_id,omitempty"`
+	UserID *int `url:"user_id,omitempty" json:"user_id,omitempty"`
 }
 
 // ListPersonalAccessTokens gets a list of all personal access tokens.
diff --git a/projects.go b/projects.go
index 4daf2e8..b3edad7 100644
--- a/projects.go
+++ b/projects.go
@@ -1663,7 +1663,6 @@ type ProjectPushRules struct {
 	CommitCommitterCheck       bool       `json:"commit_committer_check"`
 	CommitCommitterNameCheck   bool       `json:"commit_committer_name_check"`
 	RejectUnsignedCommits      bool       `json:"reject_unsigned_commits"`
-	RejectNonDCOCommits        bool       `json:"reject_non_dco_commits"`
 }
 
 // GetProjectPushRules gets the push rules of a project.
@@ -1709,7 +1708,6 @@ type AddProjectPushRuleOptions struct {
 	MemberCheck                *bool   `url:"member_check,omitempty" json:"member_check,omitempty"`
 	PreventSecrets             *bool   `url:"prevent_secrets,omitempty" json:"prevent_secrets,omitempty"`
 	RejectUnsignedCommits      *bool   `url:"reject_unsigned_commits,omitempty" json:"reject_unsigned_commits,omitempty"`
-	RejectNonDCOCommits        *bool   `url:"reject_non_dco_commits,omitempty" json:"reject_non_dco_commits,omitempty"`
 }
 
 // AddProjectPushRule adds a push rule to a specified project.
@@ -1755,7 +1753,6 @@ type EditProjectPushRuleOptions struct {
 	MemberCheck                *bool   `url:"member_check,omitempty" json:"member_check,omitempty"`
 	PreventSecrets             *bool   `url:"prevent_secrets,omitempty" json:"prevent_secrets,omitempty"`
 	RejectUnsignedCommits      *bool   `url:"reject_unsigned_commits,omitempty" json:"reject_unsigned_commits,omitempty"`
-	RejectNonDCOCommits        *bool   `url:"reject_non_dco_commits,omitempty" json:"reject_non_dco_commits,omitempty"`
 }
 
 // EditProjectPushRule edits a push rule for a specified project.
diff --git a/users.go b/users.go
index f463952..224dc42 100644
--- a/users.go
+++ b/users.go
@@ -88,7 +88,6 @@ type User struct {
 	LastActivityOn                 *ISOTime           `json:"last_activity_on"`
 	ColorSchemeID                  int                `json:"color_scheme_id"`
 	IsAdmin                        bool               `json:"is_admin"`
-	IsAuditor                      bool               `json:"is_auditor"`
 	AvatarURL                      string             `json:"avatar_url"`
 	CanCreateGroup                 bool               `json:"can_create_group"`
 	CanCreateProject               bool               `json:"can_create_project"`


Test patch:
diff --git a/groups_test.go b/groups_test.go
index 56eb8bb..248b131 100644
--- a/groups_test.go
+++ b/groups_test.go
@@ -906,8 +906,7 @@ func TestGetGroupPushRules(t *testing.T) {
 			"max_file_size": 5,
 			"commit_committer_check": false,
 			"commit_committer_name_check": false,
-			"reject_unsigned_commits": false,
-			"reject_non_dco_commits": false
+			"reject_unsigned_commits": false
 		  }`)
 	})
 
@@ -930,7 +929,6 @@ func TestGetGroupPushRules(t *testing.T) {
 		CommitCommitterCheck:       false,
 		CommitCommitterNameCheck:   false,
 		RejectUnsignedCommits:      false,
-		RejectNonDCOCommits:        false,
 	}
 
 	if !reflect.DeepEqual(want, rule) {
@@ -956,8 +954,7 @@ func TestAddGroupPushRules(t *testing.T) {
 			"max_file_size": 5,
 			"commit_committer_check": false,
 			"commit_committer_name_check": false,
-			"reject_unsigned_commits": false,
-			"reject_non_dco_commits": false
+			"reject_unsigned_commits": false
 		  }`)
 	})
 
@@ -974,7 +971,6 @@ func TestAddGroupPushRules(t *testing.T) {
 		CommitCommitterCheck:       Ptr(false),
 		CommitCommitterNameCheck:   Ptr(false),
 		RejectUnsignedCommits:      Ptr(false),
-		RejectNonDCOCommits:        Ptr(false),
 	}
 
 	rule, _, err := client.Groups.AddGroupPushRule(1, opt)
@@ -996,7 +992,6 @@ func TestAddGroupPushRules(t *testing.T) {
 		CommitCommitterCheck:       false,
 		CommitCommitterNameCheck:   false,
 		RejectUnsignedCommits:      false,
-		RejectNonDCOCommits:        false,
 	}
 
 	if !reflect.DeepEqual(want, rule) {
@@ -1022,8 +1017,7 @@ func TestEditGroupPushRules(t *testing.T) {
 			"max_file_size": 5,
 			"commit_committer_check": false,
 			"commit_committer_name_check": false,
-			"reject_unsigned_commits": false,
-			"reject_non_dco_commits": false
+			"reject_unsigned_commits": false
 		  }`)
 	})
 
@@ -1040,7 +1034,6 @@ func TestEditGroupPushRules(t *testing.T) {
 		CommitCommitterCheck:       Ptr(false),
 		CommitCommitterNameCheck:   Ptr(false),
 		RejectUnsignedCommits:      Ptr(false),
-		RejectNonDCOCommits:        Ptr(false),
 	}
 
 	rule, _, err := client.Groups.EditGroupPushRule(1, opt)
@@ -1062,7 +1055,6 @@ func TestEditGroupPushRules(t *testing.T) {
 		CommitCommitterCheck:       false,
 		CommitCommitterNameCheck:   false,
 		RejectUnsignedCommits:      false,
-		RejectNonDCOCommits:        false,
 	}
 
 	if !reflect.DeepEqual(want, rule) {
diff --git a/import_test.go b/import_test.go
index 81808e5..1dfd9a2 100644
--- a/import_test.go
+++ b/import_test.go
@@ -121,3 +121,102 @@ func TestImportService_ImportGitHubGistsIntoGitLabSnippets(t *testing.T) {
 	require.EqualError(t, err, "RequestOptionFunc returns an error")
 	require.Nil(t, resp)
 }
+
+func TestImportService_ImportRepositoryFromBitbucketServer(t *testing.T) {
+	mux, client := setup(t)
+
+	mux.HandleFunc("/api/v4/import/bitbucket_server", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodPost)
+		fmt.Fprintf(w, `
+			{
+				"id": 27,
+				"name": "my-repo",
+				"full_path": "/root/my-repo",
+				"full_name": "Administrator / my-repo",
+				"refs_url": "/root/my-repo/refs"
+			}
+		`)
+	})
+
+	want := &BitbucketServerImport{
+		ID:       27,
+		Name:     "my-repo",
+		FullPath: "/root/my-repo",
+		FullName: "Administrator / my-repo",
+		RefsUrl:  "/root/my-repo/refs",
+	}
+
+	opt := &ImportRepositoryFromBitbucketServerOptions{
+		BitbucketServerUrl:      Ptr("https://bitbucket.example.com"),
+		BitbucketServerUsername: Ptr("username"),
+		PersonalAccessToken:     Ptr("token"),
+		BitbucketServerProject:  Ptr("root"),
+		BitbucketServerRepo:     Ptr("my-repo"),
+		NewName:                 Ptr("my-repo"),
+		NewNamespace:            Ptr("root"),
+		TimeoutStrategy:         Ptr("pessimistic"),
+	}
+
+	bsi, resp, err := client.Import.ImportRepositoryFromBitbucketServer(opt)
+	require.NoError(t, err)
+	require.NotNil(t, resp)
+	require.Equal(t, want, bsi)
+
+	bsi, resp, err = client.Import.ImportRepositoryFromBitbucketServer(opt, errorOption)
+	require.EqualError(t, err, "RequestOptionFunc returns an error")
+	require.Nil(t, resp)
+	require.Nil(t, bsi)
+}
+
+func TestImportService_ImportRepositoryFromBitbucketCloud(t *testing.T) {
+	mux, client := setup(t)
+
+	mux.HandleFunc("/api/v4/import/bitbucket", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodPost)
+		fmt.Fprintf(w, `
+			{
+				"id": 27,
+				"name": "my-repo",
+				"full_path": "/root/my-repo",
+				"full_name": "Administrator / my-repo",
+				"refs_url": "/root/my-repo/refs",
+				"import_source": "my-bitbucket/repo",
+				"import_status": "scheduled",
+				"human_import_status_name": "scheduled",
+				"provider_link": "/my-bitbucket/repo",
+				"relation_type": null,
+				"import_warning": null
+			}
+		`)
+	})
+
+	want := &BitbucketCloudImport{
+		ID:                    27,
+		Name:                  "my-repo",
+		FullPath:              "/root/my-repo",
+		FullName:              "Administrator / my-repo",
+		RefsUrl:               "/root/my-repo/refs",
+		ImportSource:          "my-bitbucket/repo",
+		ImportStatus:          "scheduled",
+		HumanImportStatusName: "scheduled",
+		ProviderLink:          "/my-bitbucket/repo",
+	}
+
+	opt := &ImportRepositoryFromBitbucketCloudOptions{
+		BitbucketUsername:    Ptr("username"),
+		BitbucketAppPassword: Ptr("password"),
+		RepoPath:             Ptr("/root/my-repo"),
+		TargetNamespace:      Ptr("/root/"),
+		NewName:              Ptr("my-repo"),
+	}
+
+	bci, resp, err := client.Import.ImportRepositoryFromBitbucketCloud(opt)
+	require.NoError(t, err)
+	require.NotNil(t, resp)
+	require.Equal(t, want, bci)
+
+	bci, resp, err = client.Import.ImportRepositoryFromBitbucketCloud(opt, errorOption)
+	require.EqualError(t, err, "RequestOptionFunc returns an error")
+	require.Nil(t, resp)
+	require.Nil(t, bci)
+}
diff --git a/projects_test.go b/projects_test.go
index d268eea..e91893b 100644
--- a/projects_test.go
+++ b/projects_test.go
@@ -1596,8 +1596,7 @@ func TestGetProjectPushRules(t *testing.T) {
 			"max_file_size": 5,
 			"commit_committer_check": false,
 			"commit_committer_name_check": false,
-			"reject_unsigned_commits": false,
-			"reject_non_dco_commits": false
+			"reject_unsigned_commits": false
 		  }`)
 	})
 
@@ -1620,7 +1619,6 @@ func TestGetProjectPushRules(t *testing.T) {
 		CommitCommitterCheck:       false,
 		CommitCommitterNameCheck:   false,
 		RejectUnsignedCommits:      false,
-		RejectNonDCOCommits:        false,
 	}
 
 	if !reflect.DeepEqual(want, rule) {
@@ -1646,8 +1644,7 @@ func TestAddProjectPushRules(t *testing.T) {
 			"max_file_size": 5,
 			"commit_committer_check": false,
 			"commit_committer_name_check": false,
-			"reject_unsigned_commits": false,
-			"reject_non_dco_commits": false
+			"reject_unsigned_commits": false
 		  }`)
 	})
 
@@ -1664,7 +1661,6 @@ func TestAddProjectPushRules(t *testing.T) {
 		CommitCommitterCheck:       Ptr(false),
 		CommitCommitterNameCheck:   Ptr(false),
 		RejectUnsignedCommits:      Ptr(false),
-		RejectNonDCOCommits:        Ptr(false),
 	}
 
 	rule, _, err := client.Projects.AddProjectPushRule(1, opt)
@@ -1686,7 +1682,6 @@ func TestAddProjectPushRules(t *testing.T) {
 		CommitCommitterCheck:       false,
 		CommitCommitterNameCheck:   false,
 		RejectUnsignedCommits:      false,
-		RejectNonDCOCommits:        false,
 	}
 
 	if !reflect.DeepEqual(want, rule) {
@@ -1712,8 +1707,7 @@ func TestEditProjectPushRules(t *testing.T) {
 			"max_file_size": 5,
 			"commit_committer_check": false,
 			"commit_committer_name_check": false,
-			"reject_unsigned_commits": false,
-			"reject_non_dco_commits": false
+			"reject_unsigned_commits": false
 		  }`)
 	})
 
@@ -1730,7 +1724,6 @@ func TestEditProjectPushRules(t *testing.T) {
 		CommitCommitterCheck:       Ptr(false),
 		CommitCommitterNameCheck:   Ptr(false),
 		RejectUnsignedCommits:      Ptr(false),
-		RejectNonDCOCommits:        Ptr(false),
 	}
 
 	rule, _, err := client.Projects.EditProjectPushRule(1, opt)
@@ -1752,7 +1745,6 @@ func TestEditProjectPushRules(t *testing.T) {
 		CommitCommitterCheck:       false,
 		CommitCommitterNameCheck:   false,
 		RejectUnsignedCommits:      false,
-		RejectNonDCOCommits:        false,
 	}
 
 	if !reflect.DeepEqual(want, rule) {
diff --git a/testdata/get_user_admin.json b/testdata/get_user_admin.json
index d8482d3..6a474be 100644
--- a/testdata/get_user_admin.json
+++ b/testdata/get_user_admin.json
@@ -8,7 +8,6 @@
   "web_url": "http://localhost:3000/john_smith",
   "created_at": "2012-05-23T08:00:58Z",
   "is_admin": true,
-  "is_auditor": true,
   "bio": "Bio of John Smith",
   "location": "USA",
   "public_email": "john@example.com",
diff --git a/users_test.go b/users_test.go
index 79cede7..566c6e1 100644
--- a/users_test.go
+++ b/users_test.go
@@ -103,7 +103,6 @@ func TestGetUserAdmin(t *testing.T) {
 		LastActivityOn:   &lastActivityOn,
 		ColorSchemeID:    2,
 		IsAdmin:          true,
-		IsAuditor:        true,
 		AvatarURL:        "http://localhost:3000/uploads/user/avatar/1/index.jpg",
 		CanCreateGroup:   true,
 		CanCreateProject: true,