Skip to content

Commit

Permalink
Merge pull request #1633 from azuwis/remove-deprecated-syntax-warning
Browse files Browse the repository at this point in the history
chore: this warning isn't actionable (I think) so let's remove it until it is
  • Loading branch information
jenkins-x-bot authored Jan 6, 2025
2 parents 3c5a461 + 7a76f23 commit d02948f
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions pkg/plugins/trigger/pull-request.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"github.com/jenkins-x/lighthouse/pkg/labels"
"github.com/jenkins-x/lighthouse/pkg/plugins"
"github.com/jenkins-x/lighthouse/pkg/scmprovider"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -57,9 +56,6 @@ func handlePR(c Client, trigger *plugins.Trigger, pr scm.PullRequestHook) error
return nil
}

if err = infoMsg(c, pr.PullRequest); err != nil {
return err
}
return buildAllIfTrustedOrDraft(c, trigger, pr)
case scm.ActionEdited, scm.ActionUpdate:
// if someone changes the base of their PR, we will get this
Expand Down Expand Up @@ -147,23 +143,6 @@ func buildAllIfTrustedOrDraft(c Client, trigger *plugins.Trigger, pr scm.PullReq
return nil
}

func infoMsg(c Client, pr scm.PullRequest) error {
if isSyntaxDeprecated := isPipelinesSyntaxDeprecated(c.Config, pr.Repository()); !isSyntaxDeprecated {
return nil
}

org, repo, _ := orgRepoAuthor(pr)

comment := `[jx-info] Hi, we've detected that the pipelines in this repository are using a syntax that will soon be deprecated.
We'll continue to update you through PRs as we progress. Please check [#8589](https://www.github.com/jenkins-x/jx/issues/8589) for further information.
`

if err := c.SCMProviderClient.CreateComment(org, repo, pr.Number, true, comment); err != nil {
return errors.Wrap(err, "failed to comment info message")
}
return nil
}

func isPipelinesSyntaxDeprecated(cfg *config.Config, repo scm.Repository) bool {
logger := logrus.WithField("repo", repo.FullName)
for _, pre := range cfg.GetPresubmits(repo) {
Expand Down

0 comments on commit d02948f

Please sign in to comment.