-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EC-802 Include SHA/Image Digest in report output
This commit adds functionality to display the SHA/Image digest in the report output. Speicifically it ensures that for git and oci sources, the identifying SHA/Image Digests are determined and provided in the report output, allowing for auditing and reproducibility. Signed-off-by: robnester-rh <[email protected]>
- Loading branch information
1 parent
a17b9de
commit 290f4cc
Showing
21 changed files
with
851 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,7 @@ type gitState struct { | |
HostAndPort string | ||
RepositoriesDir string | ||
CertificatePath string | ||
LatestCommit string | ||
} | ||
|
||
func (g gitState) Key() any { | ||
|
@@ -186,6 +187,10 @@ func Host(ctx context.Context) string { | |
return testenv.FetchState[gitState](ctx).HostAndPort | ||
} | ||
|
||
func LatestCommit(ctx context.Context) string { | ||
return testenv.FetchState[gitState](ctx).LatestCommit | ||
} | ||
|
||
// CertificatePath returns the path to the self-signed certificate used for TLS | ||
// handshake | ||
func CertificatePath(ctx context.Context) string { | ||
|
@@ -270,13 +275,15 @@ func createGitRepository(ctx context.Context, repositoryName string, files *godo | |
} | ||
|
||
// do a `git commit` | ||
_, err = w.Commit("test data", &git.CommitOptions{ | ||
h, err := w.Commit("test data", &git.CommitOptions{ | ||
Author: &object.Signature{ | ||
Name: "Testy McTestface", | ||
Email: "[email protected]", | ||
When: time.Date(1970, time.January, 1, 0, 9, 9, 9, time.UTC), // makes commits deterministic | ||
}, | ||
}) | ||
|
||
state.LatestCommit = h.String() | ||
if err != nil { | ||
return err | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.