Skip to content

Commit 6079358

Browse files
authored
Add audit command (#198)
* Add auditing command Add a command that does basic auditing. This command will iterate backwards over a branch printing VSA verifiedLevels and provenance controls if available. Commits with missing attestions will be noted. Also rejiggered how some debug info was being logged to keep the display a bit more clean. Signed-off-by: Tom Hennen <tomhennen@google.com> * make more logs debug statements Signed-off-by: Tom Hennen <tomhennen@google.com> * make linter happy Signed-off-by: Tom Hennen <tomhennen@google.com> * add gh controls if no provenance Signed-off-by: Tom Hennen <tomhennen@google.com> * remove duplicate nil check Signed-off-by: Tom Hennen <tomhennen@google.com> * keep going for most errors Signed-off-by: Tom Hennen <tomhennen@google.com> * add ending commit feature Signed-off-by: Tom Hennen <tomhennen@google.com> * add basic and full audit mode Signed-off-by: Tom Hennen <tomhennen@google.com> * make linter happy Signed-off-by: Tom Hennen <tomhennen@google.com> * Tweak output, include link * Instead of "passed: true/false" now "passed" or "failed" * Include a link to the commit Signed-off-by: Tom Hennen <tomhennen@google.com> * add long help text Signed-off-by: Tom Hennen <tomhennen@google.com> --------- Signed-off-by: Tom Hennen <tomhennen@google.com>
1 parent 6674e76 commit 6079358

10 files changed

Lines changed: 338 additions & 23 deletions

File tree

go.work.sum

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,18 @@ cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1h
77
cloud.google.com/go/compute/metadata v0.5.2/go.mod h1:C66sj2AluDcIqakBq/M8lw8/ybHgOZqin2obFxa/E5k=
88
cloud.google.com/go/firestore v1.15.0/go.mod h1:GWOxFXcv8GZUtYpWHw/w6IuYNux/BtmeVTMmjrm4yhk=
99
cloud.google.com/go/monitoring v1.21.2/go.mod h1:hS3pXvaG8KgWTSz+dAdyzPrGUYmi2Q+WFX8g2hqVEZU=
10+
cloud.google.com/go/monitoring v1.24.0/go.mod h1:Bd1PRK5bmQBQNnuGwHBfUamAV1ys9049oEPHnn4pcsc=
1011
cloud.google.com/go/profiler v0.4.1/go.mod h1:LBrtEX6nbvhv1w/e5CPZmX9ajGG9BGLtGbv56Tg4SHs=
1112
cloud.google.com/go/profiler v0.4.2/go.mod h1:7GcWzs9deJHHdJ5J9V1DzKQ9JoIoTGhezwlLbwkOoCs=
1213
cloud.google.com/go/pubsub v1.45.1/go.mod h1:3bn7fTmzZFwaUjllitv1WlsNMkqBgGUb3UdMhI54eCc=
1314
cloud.google.com/go/pubsub v1.45.3/go.mod h1:cGyloK/hXC4at7smAtxFnXprKEFTqmMXNNd9w+bd94Q=
15+
cloud.google.com/go/pubsub v1.47.0/go.mod h1:LaENesmga+2u0nDtLkIOILskxsfvn/BXX9Ak1NFxOs8=
1416
cloud.google.com/go/security v1.17.5/go.mod h1:MA8w7SbQAQO9CQ9r0R7HR0F7g1AJoqx87SFLpapq3OU=
1517
cloud.google.com/go/security v1.18.3/go.mod h1:NmlSnEe7vzenMRoTLehUwa/ZTZHDQE59IPRevHcpCe4=
18+
cloud.google.com/go/security v1.18.5/go.mod h1:D1wuUkDwGqTKD0Nv7d4Fn2Dc53POJSmO4tlg1K1iS7s=
1619
cloud.google.com/go/storage v1.43.0/go.mod h1:ajvxEa7WmZS1PxvKRq4bq0tFT3vMd502JwstCcYv0Q0=
1720
cloud.google.com/go/storage v1.45.0/go.mod h1:wpPblkIuMP5jCB/E48Pz9zIo2S/zD8g+ITmxKkPCITE=
21+
cloud.google.com/go/storage v1.50.0/go.mod h1:l7XeiD//vx5lfqE3RavfmU9yvk5Pp0Zhcv482poyafY=
1822
cloud.google.com/go/trace v1.11.2/go.mod h1:bn7OwXd4pd5rFuAnTrzBuoZ4ax2XQeG3qNgYmfCy0Io=
1923
contrib.go.opencensus.io/exporter/stackdriver v0.13.14/go.mod h1:5pSSGY0Bhuk7waTHuDf4aQ8D2DrhgETRo9fy6k3Xlzc=
2024
cuelabs.dev/go/oci/ociregistry v0.0.0-20240404174027-a39bec0462d2/go.mod h1:pK23AUVXuNzzTpfMCA06sxZGeVQ/75FdVtW249de9Uo=
@@ -37,7 +41,9 @@ github.com/CycloneDX/cyclonedx-go v0.9.2/go.mod h1:vcK6pKgO1WanCdd61qx4bFnSsDJQ6
3741
github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU=
3842
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0/go.mod h1:obipzmGjfSjam60XLwGfqUkJsfiheAl+TUjG+4yzyPM=
3943
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.1/go.mod h1:jyqM3eLpJ3IbIFDTKVz2rF9T/xWGW0rIriGwnz8l9Tk=
44+
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.49.0/go.mod h1:6fTWu4m3jocfUZLYF5KsZC1TUfRvEjs7lM4crme/irw=
4045
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.48.1/go.mod h1:viRWSEhtMZqz1rhwmOVKkWl6SwmVowfL9O2YR5gI2PE=
46+
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.49.0/go.mod h1:wRbFgBQUVm1YXrvWKofAEmq9HNJTDphbAaJSSX01KUI=
4147
github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE=
4248
github.com/Masterminds/semver/v3 v3.3.1/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
4349
github.com/OneOfOne/xxhash v1.2.8/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q=
@@ -158,11 +164,13 @@ github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXE
158164
github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk=
159165
github.com/gabriel-vasile/mimetype v1.4.8/go.mod h1:ByKUIKGjh1ODkGM1asKUbQZOLGrPjydw3hYPU2YU9t8=
160166
github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
167+
github.com/go-jose/go-jose/v3 v3.0.0/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8=
161168
github.com/go-piv/piv-go v1.11.0/go.mod h1:NZ2zmjVkfFaL/CF8cVQ/pXdXtuj110zEKGdJM6fJZZM=
162169
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
163170
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
164171
github.com/go-playground/validator/v10 v10.22.1/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
165172
github.com/go-playground/validator/v10 v10.24.0/go.mod h1:GGzBIJMuE98Ic/kJsBXbz1x/7cByt++cQ+YOuDM5wus=
173+
github.com/go-playground/validator/v10 v10.26.0/go.mod h1:I5QpIEbmr8On7W0TktmJAumgzX4CA1XNl4ZmDuVHKKo=
166174
github.com/go-redis/redismock/v9 v9.2.0/go.mod h1:18KHfGDK4Y6c2R0H38EUGWAdc7ZQS9gfYxc94k7rWT0=
167175
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
168176
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
@@ -294,6 +302,7 @@ github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCko
294302
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI=
295303
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
296304
github.com/pkg/sftp v1.13.6/go.mod h1:tz1ryNURKu77RL+GuCzmoJYxQczL3wLNNpPWagdg4Qk=
305+
github.com/pkg/sftp v1.13.7/go.mod h1:KMKI0t3T6hfA+lTR/ssZdunHo+uwq7ghoN09/FSu3DY=
297306
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8=
298307
github.com/poy/onpar v1.1.2/go.mod h1:6X8FLNoxyr9kkmnlqpK6LSoiOtrO6MICtWwEuWkLjzg=
299308
github.com/prometheus/prometheus v0.51.0/go.mod h1:yv4MwOn3yHMQ6MZGHPg/U7Fcyqf+rxqiZfSur6myVtc=
@@ -302,6 +311,7 @@ github.com/protobom/protobom v0.5.2/go.mod h1:io5yUKGWBqGa2sx1n7aVPg+tG13Hun9oMz
302311
github.com/protocolbuffers/txtpbfmt v0.0.0-20231025115547-084445ff1adf/go.mod h1:jgxiZysxFPM+iWKwQwPR+y+Jvo54ARd4EisXxKYpB5c=
303312
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
304313
github.com/redis/go-redis/v9 v9.7.0/go.mod h1:f6zhXITC7JUJIlPEiBOTXxJgPLdZcA93GewI7inzyWw=
314+
github.com/redis/go-redis/v9 v9.7.3/go.mod h1:bGUrSggJ9X9GUmZpZNEOQKaANxSGgOEBRltRTZHSvrA=
305315
github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
306316
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
307317
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=

sourcetool/cmd/audit.go

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
/*
2+
Copyright © 2025 NAME HERE <EMAIL ADDRESS>
3+
*/
4+
package cmd
5+
6+
import (
7+
"context"
8+
"errors"
9+
"fmt"
10+
"log"
11+
12+
"github.com/spf13/cobra"
13+
14+
"github.com/slsa-framework/slsa-source-poc/sourcetool/pkg/attest"
15+
"github.com/slsa-framework/slsa-source-poc/sourcetool/pkg/audit"
16+
"github.com/slsa-framework/slsa-source-poc/sourcetool/pkg/ghcontrol"
17+
)
18+
19+
type AuditMode int
20+
21+
const (
22+
AuditModeBasic AuditMode = 1
23+
AuditModeFull AuditMode = 2
24+
)
25+
26+
// Enable audit mode enum
27+
// String is used both by fmt.Print and by Cobra in help text
28+
func (e *AuditMode) String() string {
29+
switch *e {
30+
case AuditModeBasic:
31+
return "basic"
32+
case AuditModeFull:
33+
return "full"
34+
}
35+
return "error"
36+
}
37+
38+
// Set must have pointer receiver so it doesn't change the value of a copy
39+
func (e *AuditMode) Set(v string) error {
40+
switch v {
41+
case "basic":
42+
*e = AuditModeBasic
43+
return nil
44+
case "full":
45+
*e = AuditModeFull
46+
return nil
47+
default:
48+
return errors.New(`must be one of "foo", "bar", or "moo"`)
49+
}
50+
}
51+
52+
// Type is only used in help text
53+
func (e *AuditMode) Type() string {
54+
return "AuditMode"
55+
}
56+
57+
type AuditArgs struct {
58+
owner string
59+
repo string
60+
branch string
61+
auditDepth int
62+
endingCommit string
63+
auditMode AuditMode
64+
}
65+
66+
func (aa *AuditArgs) Validate() error {
67+
if aa.owner == "" || aa.repo == "" || aa.branch == "" {
68+
return errors.New("must set owner, repo, and branch flags")
69+
}
70+
return nil
71+
}
72+
73+
var (
74+
auditArgs = &AuditArgs{}
75+
76+
auditCmd = &cobra.Command{
77+
Use: "audit",
78+
Short: "Audits the SLSA properties and controls of a repository",
79+
Long: `Checks the revisions on the specified branch within the repository.
80+
81+
Revisions 'pass'and audit if they have:
82+
1. A corresponding VSA
83+
2. Corresponding source provenance
84+
3. The revision (commit) listed in the provenance matches the revision reported by GitHub
85+
86+
Future:
87+
* Check the provenance to validate the verifiedLevels in the VSA match expectations
88+
(i.e. that the VSA was issued correctly)
89+
`,
90+
Run: func(cmd *cobra.Command, args []string) {
91+
err := doAudit(auditArgs)
92+
if err != nil {
93+
log.Fatal(err)
94+
}
95+
},
96+
}
97+
)
98+
99+
func printResult(ghc *ghcontrol.GitHubConnection, ar *audit.AuditCommitResult, mode AuditMode) {
100+
good := ar.IsGood()
101+
status := "passed"
102+
if !good {
103+
status = "failed"
104+
}
105+
fmt.Printf("commit: %s - %v\n", ar.Commit, status)
106+
107+
if good && AuditModeBasic == mode {
108+
return
109+
}
110+
111+
if ar.VsaPred != nil {
112+
fmt.Printf("\tvsa: %v\n", ar.VsaPred.GetVerifiedLevels())
113+
} else {
114+
fmt.Printf("\tvsa: none\n")
115+
}
116+
if ar.ProvPred != nil {
117+
fmt.Print("\tprov:\n")
118+
fmt.Printf("\t\tcontrols: %v\n", ar.ProvPred.Controls)
119+
if ar.ProvPred.PrevCommit == ar.GhPriorCommit {
120+
fmt.Printf("\t\tPrevCommit matches GH commit: true\n")
121+
} else {
122+
fmt.Printf("\t\tPrevCommit matches GH commit: false: %s != %s\n", ar.ProvPred.PrevCommit, ar.GhPriorCommit)
123+
}
124+
} else {
125+
fmt.Printf("\tprov: none\n")
126+
}
127+
if ar.GhControlStatus != nil {
128+
fmt.Printf("\tgh controls: %v\n", ar.GhControlStatus.Controls)
129+
}
130+
131+
fmt.Printf("\tlink: https://github.com/%s/%s/commit/%s\n", ghc.Owner(), ghc.Repo(), ar.GhPriorCommit)
132+
}
133+
134+
func doAudit(auditArgs *AuditArgs) error {
135+
err := auditArgs.Validate()
136+
if err != nil {
137+
return err
138+
}
139+
140+
ghc := ghcontrol.NewGhConnection(auditArgs.owner, auditArgs.repo, ghcontrol.BranchToFullRef(auditArgs.branch)).WithAuthToken(githubToken)
141+
ctx := context.Background()
142+
verifier := getVerifier()
143+
pa := attest.NewProvenanceAttestor(ghc, verifier)
144+
145+
auditor := audit.NewAuditor(ghc, pa, verifier)
146+
147+
latestCommit, err := ghc.GetLatestCommit(ctx, auditArgs.branch)
148+
if err != nil {
149+
return fmt.Errorf("could not get latest commit for %s", auditArgs.branch)
150+
}
151+
152+
fmt.Printf("Auditing branch %s starting from revision %s\n", auditArgs.branch, latestCommit)
153+
154+
count := 0
155+
for ar, err := range auditor.AuditBranch(ctx, auditArgs.branch) {
156+
if ar == nil {
157+
return err
158+
}
159+
if err != nil {
160+
fmt.Printf("\terror: %v\n", err)
161+
}
162+
printResult(ghc, ar, auditArgs.auditMode)
163+
if auditArgs.endingCommit != "" && auditArgs.endingCommit == ar.Commit {
164+
fmt.Printf("Found ending commit %s\n", auditArgs.endingCommit)
165+
return nil
166+
}
167+
if auditArgs.auditDepth > 0 && count >= auditArgs.auditDepth {
168+
fmt.Printf("Reached depth limit %d\n", auditArgs.auditDepth)
169+
return nil
170+
}
171+
count++
172+
}
173+
174+
return nil
175+
}
176+
177+
func init() {
178+
rootCmd.AddCommand(auditCmd)
179+
180+
auditCmd.Flags().StringVar(&auditArgs.owner, "owner", "", "The GitHub repository owner - required.")
181+
auditCmd.Flags().StringVar(&auditArgs.repo, "repo", "", "The GitHub repository name - required.")
182+
auditCmd.Flags().StringVar(&auditArgs.branch, "branch", "", "The branch within the repository - required.")
183+
auditCmd.Flags().IntVar(&auditArgs.auditDepth, "depth", 0, "The max number of revisions to audit (depth <= audit all revisions).")
184+
auditCmd.Flags().StringVar(&auditArgs.endingCommit, "ending-commit", "", "The commit to stop auditing at.")
185+
auditArgs.auditMode = AuditModeBasic
186+
auditCmd.Flags().Var(&auditArgs.auditMode, "audit-mode", "'basic' for limited details (default), 'full' for all details")
187+
}

sourcetool/main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ Copyright © 2025 NAME HERE <EMAIL ADDRESS>
33
*/
44
package main
55

6-
import "github.com/slsa-framework/slsa-source-poc/sourcetool/cmd"
6+
import (
7+
"github.com/slsa-framework/slsa-source-poc/sourcetool/cmd"
8+
)
79

810
func main() {
11+
// To enable debug logging
12+
// Add this line slog.SetLogLoggerLevel(slog.LevelDebug)
913
cmd.Execute()
1014
}

sourcetool/pkg/attest/log.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package attest
2+
3+
import (
4+
"fmt"
5+
"log/slog"
6+
)
7+
8+
func Debugf(format string, args ...any) {
9+
slog.Debug(fmt.Sprintf(format, args...))
10+
}

sourcetool/pkg/attest/provenance.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ func (pa ProvenanceAttestor) createCurrentProvenance(ctx context.Context, commit
174174
func (pa ProvenanceAttestor) GetProvenance(ctx context.Context, commit, ref string) (*spb.Statement, *SourceProvenancePred, error) {
175175
notes, err := pa.gh_connection.GetNotesForCommit(ctx, commit)
176176
if notes == "" {
177-
log.Printf("didn't find notes for commit %s", commit)
177+
Debugf("didn't find notes for commit %s", commit)
178178
return nil, nil, nil
179179
}
180180

@@ -190,12 +190,9 @@ func (pa ProvenanceAttestor) GetProvenance(ctx context.Context, commit, ref stri
190190
func (pa ProvenanceAttestor) getProvFromReader(reader *BundleReader, commit, ref string) (*spb.Statement, *SourceProvenancePred, error) {
191191
for {
192192
stmt, err := reader.ReadStatement(MatchesTypeAndCommit(SourceProvPredicateType, commit))
193-
if err != nil {
194-
return nil, nil, err
195-
}
196193
if err != nil {
197194
// Ignore errors, we want to check all the lines.
198-
log.Printf("error while processing line: %v", err)
195+
Debugf("error while processing line: %v", err)
199196
continue
200197
}
201198

@@ -212,11 +209,11 @@ func (pa ProvenanceAttestor) getProvFromReader(reader *BundleReader, commit, ref
212209
// Should be good!
213210
return stmt, prevProdPred, nil
214211
} else {
215-
log.Printf("prov '%v' does not reference commit '%s' for branch '%s', skipping", stmt, commit, ref)
212+
Debugf("prov '%v' does not reference commit '%s' for branch '%s', skipping", stmt, commit, ref)
216213
}
217214
}
218215

219-
log.Printf("didn't find commit %s for ref %s", commit, ref)
216+
Debugf("didn't find commit %s for ref %s", commit, ref)
220217
return nil, nil, nil
221218
}
222219

@@ -250,7 +247,7 @@ func (pa ProvenanceAttestor) CreateSourceProvenance(ctx context.Context, prevAtt
250247

251248
// No prior provenance found, so we just go with current.
252249
if prevProvStmt == nil || prevProvPred == nil {
253-
log.Printf("No previous provenance found, have to bootstrap\n")
250+
Debugf("No previous provenance found, have to bootstrap\n")
254251
return curProv, nil
255252
}
256253

sourcetool/pkg/attest/statement.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"errors"
66
"fmt"
77
"io"
8-
"log"
98

109
spb "github.com/in-toto/attestation/go/v1"
1110
"google.golang.org/protobuf/encoding/protojson"
@@ -31,7 +30,7 @@ func (br *BundleReader) convertLineToStatement(line string) (*spb.Statement, err
3130
} else {
3231
// We ignore errors because there could be other stuff in the
3332
// bundle this line came from.
34-
log.Printf("Line '%s' failed verification: %v", line, err)
33+
Debugf("Line '%s' failed verification: %v", line, err)
3534
}
3635

3736
// TODO: add support for 'regular' DSSEs.
@@ -68,11 +67,11 @@ type StatementMatcher func(*spb.Statement) bool
6867
func MatchesTypeAndCommit(predicateType, commit string) StatementMatcher {
6968
return func(statement *spb.Statement) bool {
7069
if statement.GetPredicateType() != predicateType {
71-
log.Printf("statement predicate type (%s) doesn't match %s", statement.GetPredicateType(), predicateType)
70+
Debugf("statement predicate type (%s) doesn't match %s", statement.GetPredicateType(), predicateType)
7271
return false
7372
}
7473
if !DoesSubjectIncludeCommit(statement, commit) {
75-
log.Printf("statement \n%v\n does not match commit %s", StatementToString(statement), commit)
74+
Debugf("statement \n%v\n does not match commit %s", StatementToString(statement), commit)
7675
return false
7776
}
7877
return true
@@ -102,7 +101,8 @@ func (br *BundleReader) ReadStatement(matcher StatementMatcher) (*spb.Statement,
102101
}
103102
statement, err := br.convertLineToStatement(line)
104103
if err != nil {
105-
return nil, fmt.Errorf("problem converting line to statement line: '%s', error: %w", line, err)
104+
// Ignore errors, the next line could be fine.
105+
Debugf("problem converting line to statement line: '%s', error: %v", line, err)
106106
}
107107
if statement == nil {
108108
// Not sure what this is, just continue

0 commit comments

Comments
 (0)