Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: diggerhq/digger
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 636cdefea1c8b593757d22b90f7970ac09d59b5a
Choose a base ref
..
head repository: diggerhq/digger
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b8942b7261f7f8c5792a9141a9ee41b050597e25
Choose a head ref
Showing with 14 additions and 14 deletions.
  1. +1 −2 cli/pkg/digger/digger.go
  2. +1 −2 cli/pkg/spec/spec.go
  3. +1 −1 ee/backend/go.mod
  4. +1 −1 ee/cli/go.mod
  5. +2 −2 ee/cli/go.sum
  6. +1 −1 ee/drift/go.mod
  7. +2 −2 ee/drift/go.sum
  8. +4 −2 libs/backendapi/diggerapi.go
  9. +1 −1 next/go.mod
3 changes: 1 addition & 2 deletions cli/pkg/digger/digger.go
Original file line number Diff line number Diff line change
@@ -131,7 +131,6 @@ func RunJobs(jobs []orchestrator.Job, prService ci.PullRequestService, orgServic
}

currentJob := jobs[0]
repoNameForBackendReporting := strings.ReplaceAll(currentJob.Namespace, "/", "-")
projectNameForBackendReporting := currentJob.ProjectName
// TODO: handle the apply result summary as well to report it to backend. Possibly reporting changed resources as well
// Some kind of generic terraform operation summary might need to be introduced
@@ -143,7 +142,7 @@ func RunJobs(jobs []orchestrator.Job, prService ci.PullRequestService, orgServic
prNumber := *currentJob.PullRequestNumber

iacUtils := iac_utils.GetIacUtilsIacType(currentJob.IacType())
batchResult, err := backendApi.ReportProjectJobStatus(repoNameForBackendReporting, projectNameForBackendReporting, jobId, "succeeded", time.Now(), &summary, "", jobPrCommentUrl, terraformOutput, iacUtils)
batchResult, err := backendApi.ReportProjectJobStatus(currentJob.Namespace, projectNameForBackendReporting, jobId, "succeeded", time.Now(), &summary, "", jobPrCommentUrl, terraformOutput, iacUtils)
if err != nil {
log.Printf("error reporting Job status: %v.\n", err)
return false, false, fmt.Errorf("error while running command: %v", err)
3 changes: 1 addition & 2 deletions cli/pkg/spec/spec.go
Original file line number Diff line number Diff line change
@@ -137,8 +137,7 @@ func RunSpec(

jobs := []scheduler.Job{job}

fullRepoName := fmt.Sprintf("%v-%v", spec.VCS.RepoOwner, spec.VCS.RepoName)
_, err = backendApi.ReportProjectJobStatus(fullRepoName, spec.Job.ProjectName, spec.JobId, "started", time.Now(), nil, "", "", "", nil)
_, err = backendApi.ReportProjectJobStatus(spec.VCS.RepoName, spec.Job.ProjectName, spec.JobId, "started", time.Now(), nil, "", "", "", nil)
if err != nil {
message := fmt.Sprintf("Failed to report jobSpec status to backend. Exiting. %v", err)
reportError(spec, backendApi, message, err)
2 changes: 1 addition & 1 deletion ee/backend/go.mod
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ require (
github.com/bradleyfalzon/ghinstallation/v2 v2.11.0
github.com/buildkite/go-buildkite/v3 v3.11.0
github.com/dchest/uniuri v1.2.0
github.com/diggerhq/digger/backend v0.0.0-20250108112543-de0a22217565
github.com/diggerhq/digger/backend v0.0.0-20250111163654-1e88db8cfe3a
github.com/diggerhq/digger/ee/drift v0.0.0-20241227171610-34d1db1e4299
github.com/diggerhq/digger/libs v0.4.15
github.com/gin-gonic/gin v1.10.0
2 changes: 1 addition & 1 deletion ee/cli/go.mod
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ replace github.com/diggerhq/digger/libs => ../../libs
replace github.com/diggerhq/digger/cli => ../../cli

require (
github.com/diggerhq/digger/backend v0.0.0-20250108112543-de0a22217565
github.com/diggerhq/digger/backend v0.0.0-20250111163654-1e88db8cfe3a
github.com/diggerhq/digger/cli v0.0.0-20240705091808-75187a7aae8e
github.com/diggerhq/digger/libs v0.4.15
github.com/google/go-github/v61 v61.0.0
4 changes: 2 additions & 2 deletions ee/cli/go.sum
Original file line number Diff line number Diff line change
@@ -480,8 +480,8 @@ github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48 h1:fRzb/w+pyskVMQ+
github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA=
github.com/diggerhq/digger/backend v0.0.0-20241111113338-9a40639ab83c h1:og+JQWQRcsSCmMvCb2ZFt5qqcyaPVwXIVmJZ7Atn7Ko=
github.com/diggerhq/digger/backend v0.0.0-20241111113338-9a40639ab83c/go.mod h1:B4MNwYDhypXt5VxpIzLz8809pCxbb64VL0qc4g8jZv0=
github.com/diggerhq/digger/backend v0.0.0-20250108112543-de0a22217565 h1:TNigA0UlpU/cD0nsP6H4b4xApKqgMQQkBo4OQXz7agk=
github.com/diggerhq/digger/backend v0.0.0-20250108112543-de0a22217565/go.mod h1:Y1u60nSisN42g5l6NG2BFvzTCLbh0HpRRqkDWANdvRA=
github.com/diggerhq/digger/backend v0.0.0-20250111163654-1e88db8cfe3a h1:JKrZmV3a0YN/DOmXpVSeKdxAAVWLHytJf+0QEgbTCT8=
github.com/diggerhq/digger/backend v0.0.0-20250111163654-1e88db8cfe3a/go.mod h1:Y1u60nSisN42g5l6NG2BFvzTCLbh0HpRRqkDWANdvRA=
github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8=
github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U=
github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE=
2 changes: 1 addition & 1 deletion ee/drift/go.mod
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ go 1.22.4

require (
github.com/bradleyfalzon/ghinstallation/v2 v2.11.0
github.com/diggerhq/digger/backend v0.0.0-20250108112543-de0a22217565
github.com/diggerhq/digger/backend v0.0.0-20250111163654-1e88db8cfe3a
github.com/diggerhq/digger/libs v0.4.15
github.com/diggerhq/digger/next v0.0.0-20241111115930-58349692eece
github.com/dominikbraun/graph v0.23.0
4 changes: 2 additions & 2 deletions ee/drift/go.sum
Original file line number Diff line number Diff line change
@@ -544,8 +544,8 @@ github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48 h1:fRzb/w+pyskVMQ+
github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA=
github.com/diggerhq/digger/backend v0.0.0-20241111093622-90aa7b8b0d00 h1:aM37dPV4X2Vdl5ndYJ2D+4LakwfOZTmUYd2hWnh8Me0=
github.com/diggerhq/digger/backend v0.0.0-20241111093622-90aa7b8b0d00/go.mod h1:B4MNwYDhypXt5VxpIzLz8809pCxbb64VL0qc4g8jZv0=
github.com/diggerhq/digger/backend v0.0.0-20250108112543-de0a22217565 h1:TNigA0UlpU/cD0nsP6H4b4xApKqgMQQkBo4OQXz7agk=
github.com/diggerhq/digger/backend v0.0.0-20250108112543-de0a22217565/go.mod h1:Y1u60nSisN42g5l6NG2BFvzTCLbh0HpRRqkDWANdvRA=
github.com/diggerhq/digger/backend v0.0.0-20250111163654-1e88db8cfe3a h1:JKrZmV3a0YN/DOmXpVSeKdxAAVWLHytJf+0QEgbTCT8=
github.com/diggerhq/digger/backend v0.0.0-20250111163654-1e88db8cfe3a/go.mod h1:Y1u60nSisN42g5l6NG2BFvzTCLbh0HpRRqkDWANdvRA=
github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8=
github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U=
github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE=
6 changes: 4 additions & 2 deletions libs/backendapi/diggerapi.go
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ import (
"os"
"path"
"path/filepath"
"strings"
"time"
)

@@ -129,7 +130,8 @@ func (d DiggerApi) ReportProjectRun(namespace string, projectName string, starte
return nil
}

func (d DiggerApi) ReportProjectJobStatus(repo string, projectName string, jobId string, status string, timestamp time.Time, summary *iac_utils.IacSummary, planJson string, PrCommentUrl string, terraformOutput string, iacUtils iac_utils.IacUtils) (*scheduler.SerializedBatch, error) {
func (d DiggerApi) ReportProjectJobStatus(repoFullName string, projectName string, jobId string, status string, timestamp time.Time, summary *iac_utils.IacSummary, planJson string, PrCommentUrl string, terraformOutput string, iacUtils iac_utils.IacUtils) (*scheduler.SerializedBatch, error) {
repoNameForBackendReporting := strings.ReplaceAll(repoFullName, "/", "-")
u, err := url.Parse(d.DiggerHost)
if err != nil {
log.Fatalf("Not able to parse digger cloud url: %v", err)
@@ -152,7 +154,7 @@ func (d DiggerApi) ReportProjectJobStatus(repo string, projectName string, jobId
}
}

u.Path = filepath.Join(u.Path, "repos", repo, "projects", projectName, "jobs", jobId, "set-status")
u.Path = filepath.Join(u.Path, "repos", repoNameForBackendReporting, "projects", projectName, "jobs", jobId, "set-status")
request := map[string]interface{}{
"status": status,
"timestamp": timestamp,
2 changes: 1 addition & 1 deletion next/go.mod
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ replace github.com/diggerhq/digger/libs => ../libs
require (
github.com/bradleyfalzon/ghinstallation/v2 v2.11.0
github.com/dchest/uniuri v1.2.0
github.com/diggerhq/digger/backend v0.0.0-20250108112543-de0a22217565
github.com/diggerhq/digger/backend v0.0.0-20250111163654-1e88db8cfe3a
github.com/diggerhq/digger/libs v0.4.15
github.com/dominikbraun/graph v0.23.0
github.com/getsentry/sentry-go v0.28.1