fix some formatting

This commit is contained in:
Vistaar Juneja 2023-08-22 15:28:30 +01:00
parent 568456e366
commit ebfac87860
14 changed files with 19 additions and 16 deletions

View File

@ -8,7 +8,6 @@ package main
import (
"context"
"github.com/harness/gitness/cli/server"
"github.com/harness/gitness/encrypt"
"github.com/harness/gitness/events"
@ -117,7 +116,7 @@ func initSystem(ctx context.Context, config *types.Config) (*server.System, erro
triggerStore := database.ProvideTriggerStore(db)
triggerController := trigger.ProvideController(db, authorizer, triggerStore, pipelineStore, spaceStore)
connectorController := connector.ProvideController(db, pathUID, connectorStore, authorizer, spaceStore)
templateController := template.ProvideController(db, pathUID, pathStore, templateStore, authorizer, spaceStore)
templateController := template.ProvideController(db, pathUID, templateStore, authorizer, spaceStore)
pullReqStore := database.ProvidePullReqStore(db, principalInfoCache)
pullReqActivityStore := database.ProvidePullReqActivityStore(db, principalInfoCache)
codeCommentView := database.ProvideCodeCommentView(db)

View File

@ -70,7 +70,7 @@ func (e *Aesgcm) Decrypt(ciphertext []byte) (string, error) {
return string(plaintext), err
}
// New provides a new aesgcm encrypter
// New provides a new aesgcm encrypter.
func New(key string, compat bool) (Encrypter, error) {
if len(key) != 32 {
return nil, errKeySize

View File

@ -1,3 +1,7 @@
// Copyright 2022 Harness Inc. All rights reserved.
// Use of this source code is governed by the Polyform Free Trial License
// that can be found in the LICENSE.md file for this repository.
package encrypt
import (

View File

@ -81,5 +81,4 @@ func (c *Controller) sanitizeCreateInput(in *CreateInput) error {
in.Description = strings.TrimSpace(in.Description)
return check.Description(in.Description)
}

View File

@ -84,7 +84,6 @@ func (c *Controller) sanitizeCreateInput(in *CreateInput) error {
in.Description = strings.TrimSpace(in.Description)
return check.Description(in.Description)
}
// helper function returns the same secret with encrypted data.

View File

@ -32,12 +32,12 @@ func (c *Controller) ListConnectors(
count, err := c.connectorStore.Count(ctx, space.ID, filter)
if err != nil {
return nil, 0, fmt.Errorf("failed to count child executions: %w", err)
return nil, 0, fmt.Errorf("failed to count connectors in space: %w", err)
}
connectors, err := c.connectorStore.List(ctx, space.ID, filter)
if err != nil {
return nil, 0, fmt.Errorf("failed to list child executions: %w", err)
return nil, 0, fmt.Errorf("failed to list connectors: %w", err)
}
return connectors, count, nil

View File

@ -80,5 +80,4 @@ func (c *Controller) sanitizeCreateInput(in *CreateInput) error {
in.Description = strings.TrimSpace(in.Description)
return check.Description(in.Description)
}

View File

@ -20,7 +20,6 @@ var WireSet = wire.NewSet(
func ProvideController(db *sqlx.DB,
uidCheck check.PathUID,
pathStore store.PathStore,
templateStore store.TemplateStore,
authorizer authz.Authorizer,
spaceStore store.SpaceStore,

View File

@ -36,12 +36,12 @@ func (c *Controller) List(
count, err := c.triggerStore.Count(ctx, pipeline.ID, filter)
if err != nil {
return nil, 0, fmt.Errorf("failed to count child triggers: %w", err)
return nil, 0, fmt.Errorf("failed to count triggers in space: %w", err)
}
triggers, err := c.triggerStore.List(ctx, pipeline.ID, filter)
if err != nil {
return nil, 0, fmt.Errorf("failed to list child triggers: %w", err)
return nil, 0, fmt.Errorf("failed to list triggers: %w", err)
}
return triggers, count, nil

View File

@ -33,7 +33,7 @@ type executionStore struct {
db *sqlx.DB
}
// exection represents an execution object stored in the database
// exection represents an execution object stored in the database.
type execution struct {
ID int64 `db:"execution_id"`
PipelineID int64 `db:"execution_pipeline_id"`

View File

@ -125,7 +125,7 @@ func (s *stageStore) ListWithSteps(ctx context.Context, executionID int64) ([]*t
return scanRowsWithSteps(rows)
}
// Find returns a stage given the stage ID
// Find returns a stage given the stage ID.
func (s *stageStore) Find(ctx context.Context, stageID int64) (*types.Stage, error) {
const queryFind = `
SELECT` + stageColumns + `
@ -141,7 +141,7 @@ func (s *stageStore) Find(ctx context.Context, stageID int64) (*types.Stage, err
return mapInternalToStage(dst)
}
// ListIncomplete returns a list of stages with a pending status
// ListIncomplete returns a list of stages with a pending status.
func (s *stageStore) ListIncomplete(ctx context.Context) ([]*types.Stage, error) {
const queryListIncomplete = `
SELECT` + stageColumns + `

View File

@ -1,3 +1,7 @@
// Copyright 2022 Harness Inc. All rights reserved.
// Use of this source code is governed by the Polyform Free Trial License
// that can be found in the LICENSE.md file for this repository.
package store
import (

View File

@ -4,7 +4,7 @@
package types
// ListQueryFilter has pagination related info and a query param
// ListQueryFilter has pagination related info and a query param.
type ListQueryFilter struct {
Pagination
Query string `json:"query"`

View File

@ -4,7 +4,7 @@
package types
// Pagination stores pagination related params
// Pagination stores pagination related params.
type Pagination struct {
Page int `json:"page"`
Size int `json:"size"`