@@ -15,13 +15,13 @@ import (
1515)
1616
1717type (
18- DeploymentsInteractor service
18+ DeploymentInteractor service
1919)
2020
2121// IsApproved verifies that the request is approved or not.
2222// It is approved if there is an approval of reviews at least, but
2323// it is rejected if there is a reject of reviews.
24- func (i * DeploymentsInteractor ) IsApproved (ctx context.Context , d * ent.Deployment ) bool {
24+ func (i * DeploymentInteractor ) IsApproved (ctx context.Context , d * ent.Deployment ) bool {
2525 rvs , _ := i .store .ListReviews (ctx , d )
2626
2727 for _ , r := range rvs {
@@ -43,7 +43,7 @@ func (i *DeploymentsInteractor) IsApproved(ctx context.Context, d *ent.Deploymen
4343// But if it requires a review, it saves the payload on the DB
4444// and waits until reviewed.
4545// It returns an error for a undeployable payload.
46- func (i * DeploymentsInteractor ) Deploy (ctx context.Context , u * ent.User , r * ent.Repo , d * ent.Deployment , env * extent.Env ) (* ent.Deployment , error ) {
46+ func (i * DeploymentInteractor ) Deploy (ctx context.Context , u * ent.User , r * ent.Repo , d * ent.Deployment , env * extent.Env ) (* ent.Deployment , error ) {
4747 if err := i .isDeployable (ctx , u , r , d , env ); err != nil {
4848 return nil , err
4949 }
@@ -128,7 +128,7 @@ func (i *DeploymentsInteractor) Deploy(ctx context.Context, u *ent.User, r *ent.
128128// DeployToRemote posts a new deployment to SCM with the saved payload
129129// after review has finished.
130130// It returns an error for a undeployable payload.
131- func (i * DeploymentsInteractor ) DeployToRemote (ctx context.Context , u * ent.User , r * ent.Repo , d * ent.Deployment , env * extent.Env ) (* ent.Deployment , error ) {
131+ func (i * DeploymentInteractor ) DeployToRemote (ctx context.Context , u * ent.User , r * ent.Repo , d * ent.Deployment , env * extent.Env ) (* ent.Deployment , error ) {
132132 if d .Status != deployment .StatusWaiting {
133133 return nil , e .NewErrorWithMessage (
134134 e .ErrorCodeDeploymentStatusInvalid ,
@@ -172,7 +172,7 @@ func (i *DeploymentsInteractor) DeployToRemote(ctx context.Context, u *ent.User,
172172 return d , nil
173173}
174174
175- func (i * DeploymentsInteractor ) createRemoteDeployment (ctx context.Context , u * ent.User , r * ent.Repo , d * ent.Deployment , env * extent.Env ) (* extent.RemoteDeployment , error ) {
175+ func (i * DeploymentInteractor ) createRemoteDeployment (ctx context.Context , u * ent.User , r * ent.Repo , d * ent.Deployment , env * extent.Env ) (* extent.RemoteDeployment , error ) {
176176 // Rollback configures it can deploy the ref without any constraints.
177177 // 1) Set auto_merge false to avoid the merge conflict.
178178 // 2) Set required_contexts empty to skip the verfication.
@@ -184,7 +184,7 @@ func (i *DeploymentsInteractor) createRemoteDeployment(ctx context.Context, u *e
184184 return i .scm .CreateRemoteDeployment (ctx , u , r , d , env )
185185}
186186
187- func (i * DeploymentsInteractor ) isDeployable (ctx context.Context , u * ent.User , r * ent.Repo , d * ent.Deployment , env * extent.Env ) error {
187+ func (i * DeploymentInteractor ) isDeployable (ctx context.Context , u * ent.User , r * ent.Repo , d * ent.Deployment , env * extent.Env ) error {
188188 // Skip verifications for roll back.
189189 if ! d .IsRollback {
190190 if ok , err := env .IsDeployableRef (d .Ref ); ! ok {
@@ -210,7 +210,7 @@ func (i *DeploymentsInteractor) isDeployable(ctx context.Context, u *ent.User, r
210210 return nil
211211}
212212
213- func (i * DeploymentsInteractor ) runClosingInactiveDeployment (stop <- chan struct {}) {
213+ func (i * DeploymentInteractor ) runClosingInactiveDeployment (stop <- chan struct {}) {
214214 ctx := context .Background ()
215215
216216 ticker := time .NewTicker (time .Minute )
0 commit comments