thanos icon indicating copy to clipboard operation
thanos copied to clipboard

port codebase to adapt to new thanos errors pkg replacing github.com/pkg/errors

Open bisakhmondal opened this issue 3 years ago • 5 comments

In continuation of #5239

Related Issue: closes #5176

  • [ ] I added CHANGELOG entry for this change.
  • [x] Change is not relevant to the end user.

Changes

  • Replace old github.com/pkg/errors import
  • Update New,Errorf -> Newf and Wrap -> Wrapf
  • Pr #5239, depends on github.com/thanos-io/thanos/pkg/testutil internal pkg leading to give rise of cyclic dependency - Fixed

Used the following snippet to automate the replacement and then a make format with manual imports ordering

for file in $(git grep -l "github.com/pkg/errors" | grep ".go"); do
  sed -i 's/errors\.Wrap(/errors\.Wrapf(/g' $file
  sed -i 's/errors\.Errorf(/errors\.Newf(/g' $file
  sed -i 's/errors\.New(/errors\.Newf(/g' $file
  sed -i 's/github\.com\/pkg\/errors/github\.com\/thanos-io\/thanos\/pkg\/errors/g'  $file
  echo "$file processing done"
done

Verification

make lint && make build works successfully

bisakhmondal avatar May 24 '22 11:05 bisakhmondal

Thanks a lot for this effort! I wonder if we should do this port in one go, or split it component-wise somehow. 🙂 Also, test failures seem related!

saswatamcode avatar May 26 '22 11:05 saswatamcode

Would you like to push this forward @bisakhmondal? 🙂

saswatamcode avatar Jun 09 '22 10:06 saswatamcode

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Aug 12 '22 06:08 stale[bot]

What's the status of this?

matej-g avatar Sep 21 '22 07:09 matej-g

the code has been ported to https://github.com/efficientgo/core I think once @bwplotka finalizes the APIs there (had some double thoughts), I can clean it up with the new imports. That's the plan, right? @bwplotka

bisakhmondal avatar Sep 21 '22 08:09 bisakhmondal

Still needed

matej-g avatar Oct 07 '22 09:10 matej-g

Hello 👋 Looks like there was no activity on this amazing PR for the last 30 days. Do you mind updating us on the status? Is there anything we can help with? If you plan to still work on it, just comment on this PR or push a commit. Thanks! 🤗 If there will be no activity in the next week, this issue will be closed (we can always reopen a PR if you get back to this!). Alternatively, use remind command if you wish to be reminded at some point in future.

stale[bot] avatar Nov 12 '22 12:11 stale[bot]

Closing for now as promised, let us know if you need this to be reopened! 🤗

stale[bot] avatar May 21 '23 21:05 stale[bot]