Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check-plugin fix fails for indirect dependencies #901

Open
stevenh opened this issue Jul 9, 2024 · 3 comments
Open

check-plugin fix fails for indirect dependencies #901

stevenh opened this issue Jul 9, 2024 · 3 comments

Comments

@stevenh
Copy link

stevenh commented Jul 9, 2024

Environment info:
KrakenD version: 2.3.6 on linux amd64 using docker image devopsfaith/krakend

Describe the bug
If you run krakend check-plugin -f to output fixes for incompatible package versions it provides a go get for each package.

These work as expected for direct dependencies however for indirect dependencies the changes are lost when go mod tidy is run.

For indirect dependencies instead of go get they should should be go mod edit -replace <pkg>=<pkg>@<version> which will pin the indirect dependency ensuring the changes aren't lost by running go mod tidy.

It would also be nice if there was a way to apply the changes, instead of having to write shell scripts to parse and run, I would suggest adding additional flag such as --apply.

@stevenh
Copy link
Author

stevenh commented Jul 9, 2024

The underlying bug is in krakend-cobra, but keeping this so we can track the dependency update.

@taik0
Copy link
Member

taik0 commented Jul 21, 2024

The check-plugin apply should be used without running go mod tidy at the end or you will lose all the dependencies "magic".

@stevenh
Copy link
Author

stevenh commented Jul 22, 2024

Unfortunately pipelines often validate go mod tidy results in no changes or is even part of a pre commit check, however even if this is not the case new dependencies are often introduced, requiring a go mod tidy, so you want a permanent fix that doesn't need to be constantly reapplied.

The fix for this has already been merged in the upstream repo krakend/krakend-cobra#28

Keeping this ticket open until there's a new release and the dependency is updated to include the fix which I'm hoping can also include the krakend/krakend-cobra#29 which fully automates of this process too.

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

No branches or pull requests

2 participants