mirror of
https://github.com/harness/drone.git
synced 2025-05-17 01:20:13 +08:00
address comments
This commit is contained in:
parent
1f06534259
commit
d5f121eff7
@ -25,7 +25,7 @@ func (c *Controller) Find(
|
||||
) (io.ReadCloser, error) {
|
||||
space, err := c.spaceStore.FindByRef(ctx, spaceRef)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not find parent space: %w", err)
|
||||
return nil, fmt.Errorf("failed to find parent space: %w", err)
|
||||
}
|
||||
|
||||
pipeline, err := c.pipelineStore.FindByUID(ctx, space.ID, pipelineUID)
|
||||
|
@ -25,7 +25,7 @@ func (c *Controller) Tail(
|
||||
) (<-chan *livelog.Line, <-chan error, error) {
|
||||
space, err := c.spaceStore.FindByRef(ctx, spaceRef)
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("could not find parent space: %w", err)
|
||||
return nil, nil, fmt.Errorf("failed to find parent space: %w", err)
|
||||
}
|
||||
|
||||
pipeline, err := c.pipelineStore.FindByUID(ctx, space.ID, pipelineUID)
|
||||
|
@ -97,7 +97,8 @@ func HandleTail(logCtrl *logs.Controller) http.HandlerFunc {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
break L
|
||||
case <-errc:
|
||||
case err := <-errc:
|
||||
log.Err(err).Msg("received error in the tail channel")
|
||||
break L
|
||||
case <-msgDelayTimer.C:
|
||||
io.WriteString(w, ": ping\n\n")
|
||||
|
@ -52,7 +52,7 @@ const (
|
||||
type stage struct {
|
||||
ID int64 `db:"stage_id"`
|
||||
ExecutionID int64 `db:"stage_execution_id"`
|
||||
Number int `db:"stage_number"`
|
||||
Number int64 `db:"stage_number"`
|
||||
Name string `db:"stage_name"`
|
||||
Kind string `db:"stage_kind"`
|
||||
Type string `db:"stage_type"`
|
||||
|
@ -41,7 +41,7 @@ const (
|
||||
type step struct {
|
||||
ID int64 `db:"step_id"`
|
||||
StageID int64 `db:"step_stage_id"`
|
||||
Number int `db:"step_number"`
|
||||
Number int64 `db:"step_number"`
|
||||
Name string `db:"step_name"`
|
||||
Status string `db:"step_status"`
|
||||
Error string `db:"step_error"`
|
||||
|
@ -19,12 +19,12 @@ var WireSet = wire.NewSet(
|
||||
|
||||
func ProvideLogStore(db *sqlx.DB, config *types.Config) store.LogStore {
|
||||
s := NewDatabaseLogStore(db)
|
||||
if config.S3.Bucket != "" {
|
||||
if config.Logs.S3.Bucket != "" {
|
||||
p := NewS3LogStore(
|
||||
config.S3.Bucket,
|
||||
config.S3.Prefix,
|
||||
config.S3.Endpoint,
|
||||
config.S3.PathStyle,
|
||||
config.Logs.S3.Bucket,
|
||||
config.Logs.S3.Prefix,
|
||||
config.Logs.S3.Endpoint,
|
||||
config.Logs.S3.PathStyle,
|
||||
)
|
||||
return NewCombined(p, s)
|
||||
}
|
||||
|
@ -90,12 +90,14 @@ type Config struct {
|
||||
Expire time.Duration `envconfig:"GITNESS_TOKEN_EXPIRE" default:"720h"`
|
||||
}
|
||||
|
||||
// S3 provides optional storage option for logs.
|
||||
S3 struct {
|
||||
Bucket string `envconfig:"GITNESS_S3_BUCKET"`
|
||||
Prefix string `envconfig:"GITNESS_S3_PREFIX"`
|
||||
Endpoint string `envconfig:"GITNESS_S3_ENDPOINT"`
|
||||
PathStyle bool `envconfig:"GITNESS_S3_PATH_STYLE"`
|
||||
Logs struct {
|
||||
// S3 provides optional storage option for logs.
|
||||
S3 struct {
|
||||
Bucket string `envconfig:"GITNESS_LOGS_S3_BUCKET"`
|
||||
Prefix string `envconfig:"GITNESS_LOGS_S3_PREFIX"`
|
||||
Endpoint string `envconfig:"GITNESS_LOGS_S3_ENDPOINT"`
|
||||
PathStyle bool `envconfig:"GITNESS_LOGS_S3_PATH_STYLE"`
|
||||
}
|
||||
}
|
||||
|
||||
// Cors defines http cors parameters
|
||||
|
@ -7,7 +7,7 @@ package types
|
||||
type Stage struct {
|
||||
ID int64 `json:"-"`
|
||||
ExecutionID int64 `json:"execution_id"`
|
||||
Number int `json:"number"`
|
||||
Number int64 `json:"number"`
|
||||
Name string `json:"name"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
|
@ -7,7 +7,7 @@ package types
|
||||
type Step struct {
|
||||
ID int64 `json:"-"`
|
||||
StageID int64 `json:"-"`
|
||||
Number int `json:"number"`
|
||||
Number int64 `json:"number"`
|
||||
Name string `json:"name"`
|
||||
Status string `json:"status"`
|
||||
Error string `json:"error,omitempty"`
|
||||
|
Loading…
Reference in New Issue
Block a user