Fetch drops a logging dependency and removes release asset tests
Fetch, a CLI for downloading files, folders, and release assets from GitHub and GitLab, dropped its shared logging helper this week. Two maintenance commits on master also removed tests that depended on an external release fixture. For users and contributors, the useful details are how Fetch now configures logging and which download checks disappeared.
Logging moves directly to Logrus
The dependency cleanup in PR #133 removes go-commons v0.17.2 from go.mod. Fetch already depended on Logrus, so the change uses that library directly. Builds have one fewer direct module dependency to resolve.
The logging replacement commit makes the setup explicit in logger.go. GetProjectLogger creates a new Logrus logger, copies the global log level, and selects TextFormatter with FullTimestamp: true. It still returns a *logrus.Entry, so existing callers retain the same return type.
The CLI initializer now calls logrus.SetLevel after parsing the requested level. The existing --log-level flag still defaults to info. If a build script parses Fetch logs, check its assumptions against this formatter when adopting the change. The wrapper that previously chose the logger configuration is gone, making formatting worth checking even though the flag stays familiar.
Release asset tests lose their external fixture
PR #134 removes tests tied to the old release fixture. Those tests downloaded health-checker v0.0.2 binaries. The final patch deletes the cases without moving them to a replacement release.
The test removal commit drops six tests covering several behaviors:
- Downloading two matching assets and checking that both files exist.
- Computing SHA256 and SHA512 hashes, then accepting matching checksums and rejecting mismatches.
- Rejecting an invalid asset regex or release tag, and warning when
--stdoutaccompanies multiple assets.
This removes the suite’s dependency on those particular binaries. It also removes assertions that could catch regressions in download and validation behavior. Contributors changing those paths should account for the missing cases when deciding what a passing test run proves.
Remaining tests cover a narrower set of cases
main_test.go retains the test that downloads hello+world.txt, an asset name containing a regex character. integration_test.go still checks stdout output for a single asset. These provide useful coverage, but exercise different cases from the deleted checksum and multiple asset tests.
The runtime checks remain in main.go. When callers supply checksums, Fetch verifies downloaded assets and returns a verification error if one fails. Supplying --release-asset-checksum still requires --release-asset-checksum-algo. The multiple asset stdout path also still emits its warning. The removal changes test coverage around these behaviors.
What to watch
- When adopting this branch, check captured logs at
infoanddebug, especially if scripts depend on their text format. - Keep a download check with a known checksum in pipelines that rely on Fetch for release binaries. Include a deliberately wrong checksum to exercise rejection.
- A useful follow up contribution would restore the removed cases with controlled fixtures. Local data or a test server could cover checksum failures and multiple assets without depending on the retired fixture. Neither merged PR adds those replacements.