Skip to content

Commit

Permalink
report: add rest of report program
Browse files Browse the repository at this point in the history
This PR contains the rest of the report program. It includes the last two files not part of the last PR:

* `cache.go`: Caches the trees generated from each branch and revision combination. Since a dry-run may take many minutes, caching allows the program to remain performant and responsive to changes in the templates without having to redo a dry-run.
* `main.go`: Handles the command line flags and actual running of the program. It handles retrieving values from the cache or cloning and dry running as necessary.

There are some small changes to the lint config and go.mod to allow the cache to be compressed. It uses a package already vendored so does not include additional dependencies. Compression is beneficial since the cache for the main branch alone may be over a megabyte in size but only ~40 KB when compressed.

Excluded from this PR is the GitHub workflow to actually generate the report along with some high-level documentation.
  • Loading branch information
klaskosk committed Feb 17, 2025
1 parent 23140b6 commit e58a58d
Show file tree
Hide file tree
Showing 5 changed files with 764 additions and 2 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ linters-settings:
- "github.com/stmcginnis/gofish"
- "github.com/BurntSushi/toml"
- "github.com/containers/image/v5/pkg/sysregistriesv2"
- "github.com/klauspost/compress/zstd"
wsl:
strict-append: false
gofmt:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ require (
open-cluster-management.io/config-policy-controller v0.15.0
open-cluster-management.io/governance-policy-propagator v0.15.0
open-cluster-management.io/multicloud-operators-subscription v0.15.0
github.com/klauspost/compress v1.17.11
sigs.k8s.io/controller-runtime v0.19.5
)

Expand Down Expand Up @@ -145,7 +146,6 @@ require (
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kdomanski/iso9660 v0.2.1 // indirect
github.com/klauspost/compress v1.17.11 // indirect
github.com/kube-object-storage/lib-bucket-provisioner v0.0.0-20221122204822-d1a8c34382f1 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
Expand Down
Loading

0 comments on commit e58a58d

Please sign in to comment.