Skip to content

Commit

Permalink
chore: repo type
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubisoft-potato committed Jan 17, 2025
1 parent a8fc23a commit d35f48d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 21 deletions.
9 changes: 2 additions & 7 deletions pkg/coderef/storage/v2/code_reference.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (

"github.com/bucketeer-io/bucketeer/pkg/coderef/domain"
"github.com/bucketeer-io/bucketeer/pkg/storage/v2/mysql"
proto "github.com/bucketeer-io/bucketeer/proto/coderef"
)

var (
Expand Down Expand Up @@ -132,7 +131,6 @@ func (s *codeReferenceStorage) GetCodeReference(
id, environmentID string,
) (*domain.CodeReference, error) {
codeRef := &domain.CodeReference{}
var repositoryType int32
row := s.qe(ctx).QueryRowContext(
ctx,
selectCodeReferenceSQL,
Expand All @@ -149,7 +147,7 @@ func (s *codeReferenceStorage) GetCodeReference(
&mysql.JSONObject{Val: &codeRef.Aliases},
&codeRef.RepositoryName,
&codeRef.RepositoryOwner,
&repositoryType,
&codeRef.RepositoryType,
&codeRef.RepositoryBranch,
&codeRef.CommitHash,
&codeRef.EnvironmentId,
Expand All @@ -162,7 +160,6 @@ func (s *codeReferenceStorage) GetCodeReference(
}
return nil, err
}
codeRef.RepositoryType = proto.CodeReference_RepositoryType(repositoryType)
return codeRef, nil
}

Expand All @@ -184,7 +181,6 @@ func (s *codeReferenceStorage) ListCodeReferences(
codeRefs := make([]*domain.CodeReference, 0, limit)
for rows.Next() {
codeRef := &domain.CodeReference{}
var repositoryType int32
err := rows.Scan(
&codeRef.Id,
&codeRef.FeatureId,
Expand All @@ -195,7 +191,7 @@ func (s *codeReferenceStorage) ListCodeReferences(
&mysql.JSONObject{Val: &codeRef.Aliases},
&codeRef.RepositoryName,
&codeRef.RepositoryOwner,
&repositoryType,
&codeRef.RepositoryType,
&codeRef.RepositoryBranch,
&codeRef.CommitHash,
&codeRef.EnvironmentId,
Expand All @@ -205,7 +201,6 @@ func (s *codeReferenceStorage) ListCodeReferences(
if err != nil {
return nil, 0, 0, err
}
codeRef.RepositoryType = proto.CodeReference_RepositoryType(repositoryType)
codeRefs = append(codeRefs, codeRef)
}
if rows.Err() != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@ SELECT
aliases,
repository_name,
repository_owner,
CASE repository_type
WHEN 'GITHUB' THEN 1
WHEN 'GITLAB' THEN 2
WHEN 'BITBUCKET' THEN 3
WHEN 'CUSTOM' THEN 4
ELSE 0
END as repository_type,
repository_type,
repository_branch,
commit_hash,
environment_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@ SELECT
aliases,
repository_name,
repository_owner,
CASE repository_type
WHEN 'GITHUB' THEN 1
WHEN 'GITLAB' THEN 2
WHEN 'BITBUCKET' THEN 3
WHEN 'CUSTOM' THEN 4
ELSE 0
END as repository_type,
repository_type,
repository_branch,
commit_hash,
environment_id,
Expand Down

0 comments on commit d35f48d

Please sign in to comment.