microcks / microcks/microcks-cli

chore: replace deprecated function usages (`filepath.HasPrefix` and `client.IsErrNotFound`)

Open Beginner friendly
#525 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
52
Forks
68
Avg merge
6h 54m
Merged PRs (30d)
10

Description

Describe the bug

The codebase contains a few function calls that have been deprecated by their respective upstream libraries. Continuing to use them creates technical debt and makes future library upgrades difficult.

  • pkg/connectors/container_client.go:232: Uses client.IsErrNotFound(err) from the Docker SDK, which is deprecated.
  • cmd/importDir_test.go:71: Uses filepath.HasPrefix(path, root), which has been deprecated since Go 1.0 because it does not respect path boundaries.
Expected behavior

The codebase should use modern, supported equivalents for these operations.

Actual behavior

Deprecated functions are used, triggering linter warnings (SA1019).

How to Reproduce?

Reproducer:

  1. Run staticcheck ./... locally.
  2. Observe the deprecation warnings (SA1019) for both functions.
Microcks version or git rev

main (Latest)

Install method (docker-compose, helm chart, operator, docker-desktop extension,...)

CLI

Additional information

This is a good first issue.

  • client.IsErrNotFound(err) should be replaced with cerrdefs.IsNotFound(err).
  • filepath.HasPrefix should be replaced with strings.HasPrefix(path, root+string(filepath.Separator)).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with pkg/connectors/container_client.go:232 and cmd/importDir_test.go:71, then run staticcheck ./... to reproduce the SA1019 warnings. Replace the deprecated calls with the equivalents named in the issue and run the relevant tests plus staticcheck; done means both warnings are gone.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cli, testing
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.