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

Replace external call to diffstat with native code #769

Merged
merged 2 commits into from
Oct 3, 2022

Conversation

julienduchesne
Copy link
Member

Closes #767

I got nerd sniped... though it was pretty quick to implement

  • diffstat is not available in the apk registry so we would have to compile it manually to add it to the docker image
  • Parsing a diff to get the number of lines is pretty simple
  • I tried a few external libraries but they didn't work right + less libs is better

So I opted to write our own implementation of diffstat (probably much simpler than the real thing, less cases to handle)

Closes #767

`diffstat` is not available in the `apk` registry so we would have to compile it manually to add it to the docker image

Parsing a diff to get the number of lines is pretty simple

I tried a few external libraries but they didn't work right + less libs is better
@julienduchesne julienduchesne requested review from Duologic, sh0rez and a team September 29, 2022 17:00
Copy link
Member

@the-it the-it left a comment

Choose a reason for hiding this comment

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

Very small nits ... but overall LGTM

pkg/kubernetes/util/diff.go Show resolved Hide resolved
pkg/kubernetes/util/diff.go Show resolved Hide resolved
@julienduchesne julienduchesne merged commit c5a739e into main Oct 3, 2022
@julienduchesne julienduchesne deleted the julienduchesne/remove-diffstat-requirement branch October 3, 2022 13:27
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.

Diffstat in docker image
2 participants