-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add "debug" feedback receiver and parametrize controller name f…
…or improved testing experience
- Loading branch information
Showing
4 changed files
with
59 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package debug | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/kube-cicd/pipelines-feedback-core/pkgs/contract" | ||
"github.com/kube-cicd/pipelines-feedback-core/pkgs/contract/wiring" | ||
"github.com/kube-cicd/pipelines-feedback-core/pkgs/logging" | ||
"github.com/sirupsen/logrus" | ||
) | ||
|
||
type Receiver struct{} | ||
|
||
func (d *Receiver) InitializeWithContext(sc *wiring.ServiceContext) error { | ||
return nil | ||
} | ||
|
||
func (d *Receiver) WhenCreated(ctx context.Context, pipeline contract.PipelineInfo, log *logging.InternalLogger) error { | ||
log.Info("debug.WhenCreated()") | ||
|
||
return nil | ||
} | ||
|
||
func (d *Receiver) WhenStarted(ctx context.Context, pipeline contract.PipelineInfo, log *logging.InternalLogger) error { | ||
log.Info("debug.WhenStarted()") | ||
|
||
return nil | ||
} | ||
|
||
func (d *Receiver) UpdateProgress(ctx context.Context, pipeline contract.PipelineInfo, log *logging.InternalLogger) error { | ||
log.Info("debug.UpdateProgress()") | ||
logrus.Info(pipeline) | ||
|
||
return nil | ||
} | ||
|
||
func (d *Receiver) WhenFinished(ctx context.Context, pipeline contract.PipelineInfo, log *logging.InternalLogger) error { | ||
log.Info("debug.WhenFinished()") | ||
|
||
return nil | ||
} | ||
|
||
func (d *Receiver) CanHandle(name string) bool { | ||
return true | ||
} | ||
|
||
func (d *Receiver) GetImplementationName() string { | ||
return "debug" | ||
} |