Skip to content

log: remove zap & go-chi dependecy from pkg/types#2667

Merged
Hayden-IO merged 1 commit intosigstore:mainfrom
tonistiigi:log-dependency-fix
Nov 4, 2025
Merged

log: remove zap & go-chi dependecy from pkg/types#2667
Hayden-IO merged 1 commit intosigstore:mainfrom
tonistiigi:log-dependency-fix

Conversation

@tonistiigi
Copy link
Copy Markdown
Contributor

Summary

Rekor currently depends on Uber’s Zap logging framework (with go-chi middleware integration). It’s unclear to me why this particular stack was introduced, as other Sigstore projects don’t seem to use it.

However, this dependency leaks into library packages such as those under pkg/types, which are meant to be reused by other projects like sigstore-go when running TLog verification. This adds an unnecessary heavy dependency and also causes out-of-place log output in importing applications.

This PR fixes that by adding a lightweight, dependency-free internal logger (pkg/internal/log) as the default for these library packages. The internal logger is silent by default, which is suitable for libraries. Any user of Zap or the Rekor CLI utilities can continue to configure logging via pkg/log without any code or behavior changes(Rekor CLI still gets all the same logs as before). If an importing application wants to capture logs from Rekor libs, it can configure the pkg/log package as before.

Dependency footprint change for sigstore-go/verifier:

112 files changed, 34 insertions(+), 14361 deletions(-)

Release Note

Documentation

@tonistiigi tonistiigi requested a review from a team as a code owner November 4, 2025 00:15
@codecov
Copy link
Copy Markdown

codecov bot commented Nov 4, 2025

Codecov Report

❌ Patch coverage is 22.22222% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.12%. Comparing base (488eb97) to head (09290ed).
⚠️ Report is 558 commits behind head on main.

Files with missing lines Patch % Lines
pkg/internal/log/logger.go 0.00% 6 Missing ⚠️
pkg/types/intoto/intoto.go 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2667       +/-   ##
===========================================
- Coverage   66.46%   26.12%   -40.34%     
===========================================
  Files          92      191       +99     
  Lines        9258    20112    +10854     
===========================================
- Hits         6153     5254      -899     
- Misses       2359    14029    +11670     
- Partials      746      829       +83     
Flag Coverage Δ
e2etests 49.61% <22.22%> (+2.05%) ⬆️
unittests 16.68% <0.00%> (-31.00%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Hayden-IO
Hayden-IO previously approved these changes Nov 4, 2025
Copy link
Copy Markdown
Contributor

@Hayden-IO Hayden-IO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@Hayden-IO
Copy link
Copy Markdown
Contributor

Can you add the license header to the new file?

Currently the uber/zap logger and go-chi middleware have
leaked into the library packages in pkg/types imported by
other projects.

This adds internal dependency-free logger as default for
these library packages. Any user of Zap or the Rekor
CLI utilities can continue to use `pkg/log` to use and
configure Zap without any changes. The internal logger is
silent by default as suitable for libraries.

Signed-off-by: Tonis Tiigi <[email protected]>
@tonistiigi
Copy link
Copy Markdown
Contributor Author

Can you add the license header to the new file?

Done

@Hayden-IO Hayden-IO merged commit cd90eec into sigstore:main Nov 4, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants