Skip to content

Commit

Permalink
add detailed debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
foosinn committed Jan 19, 2021
1 parent bc7fcf0 commit 5f9de16
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
9 changes: 9 additions & 0 deletions plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ func (p *Plugin) Find(ctx context.Context, droneRequest *config.Request) (*drone

// getConfig retrieves drone config data from the repo
func (p *Plugin) getConfig(ctx context.Context, req *request) (string, error) {
logrus.WithFields(logrus.Fields{
"after": req.Build.After,
"before": req.Build.Before,
"branch": req.Repo.Branch,
"ref": req.Build.Ref,
"slug": req.Repo.Slug,
"trigger": req.Build.Trigger,
}).Debugf("drone-tree-config environment")

// get changed files
changedFiles, err := p.getScmChanges(ctx, req)
if err != nil {
Expand Down
7 changes: 0 additions & 7 deletions plugin/scm.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,9 @@ func (p *Plugin) getScmChanges(ctx context.Context, req *request) ([]string, err
}
} else {
// use diff to get changed files
repoBranch := req.Repo.Branch
commitBranch := req.Build.Source
before := req.Build.Before
after := req.Build.After

// check for branch pr
if commitBranch != repoBranch {
before = repoBranch
}

// check for broken before
if before == "0000000000000000000000000000000000000000" || before == "" {
before = fmt.Sprintf("%s~1", after)
Expand Down

0 comments on commit 5f9de16

Please sign in to comment.