Replace calls to git binary in git package with pure go code
Our git package has several calls to the git package. In order to be able to use our binaries in leaner container images (ie distroless) we need to write alternatives to some of its functions to pure go, and drop the calls to the git binary.
From @puerco in https://github.com/kubernetes-sigs/release-sdk/pull/13#issuecomment-972522598 and https://github.com/kubernetes-sigs/release-sdk/pull/13#issuecomment-972523949:
Thinking a little bit about these functions that relate to forking, much of the code relies on github apis, but if you think about it the functions are more git specific. For example, things like
github.BranchExists()are in essence GitHub API laziness for looking into thegit ls-remoteoutput 🤔 WDYT?
The downside of course is that we would have to implement some of the github code in git which is in practice pointless as we already have the functionality.
Also, ref https://github.com/kubernetes-sigs/release-sdk/pull/3#issuecomment-918468002:
/hold cancel (ref: https://kubernetes.slack.com/archives/CJH2GBF7Y/p1631557597076000?thread_ts=1631554156.074500&cid=CJH2GBF7Y)
@justaugustus
@puerco — actually, I stand by the original assessment (because of github importing git)
@justaugustus
Let’s do the initial migration to release-sdk and then pull out the git stuff in a follow-up
@puerco
ok 👍
@justaugustus
(I’d just prefer not to have any refactors masked by the migration commits)
@puerco
yeah makes sense
@justaugustus
also, it looks like it might be really simple, but I’ve made the mistake of assuming that before 🙃
/help
@justaugustus: This request has been marked as needing help from a contributor.
Guidelines
Please ensure that the issue body includes answers to the following questions:
- Why are we solving this issue?
- To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
- Does this issue have zero to low barrier of entry?
- How can the assignee reach out to you for help?
For more details on the requirements of such an issue, please see here and ensure that they are met.
If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.
In response to this:
From @puerco in https://github.com/kubernetes-sigs/release-sdk/pull/13#issuecomment-972522598 and https://github.com/kubernetes-sigs/release-sdk/pull/13#issuecomment-972523949:
Thinking a little bit about these functions that relate to forking, much of the code relies on github apis, but if you think about it the functions are more git specific. For example, things like
github.BranchExists()are in essence GitHub API laziness for looking into thegit ls-remoteoutput 🤔 WDYT?The downside of course is that we would have to implement some of the github code in git which is in practice pointless as we already have the functionality.
Also, ref https://github.com/kubernetes-sigs/release-sdk/pull/3#issuecomment-918468002:
/hold cancel (ref: https://kubernetes.slack.com/archives/CJH2GBF7Y/p1631557597076000?thread_ts=1631554156.074500&cid=CJH2GBF7Y)
@justaugustus
@puerco — actually, I stand by the original assessment (because of github importing git)
@justaugustus
Let’s do the initial migration to release-sdk and then pull out the git stuff in a follow-up
@puerco
ok 👍
@justaugustus
(I’d just prefer not to have any refactors masked by the migration commits)
@puerco
yeah makes sense
@justaugustus
also, it looks like it might be really simple, but I’ve made the mistake of assuming that before 🙃
/help
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
/cc (I am interested in this but not very sure when I would get some time to work on it, maybe the December vacations. This sounds to me like a good weekend hacking project)
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle stale - Mark this issue or PR as rotten with
/lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle stale - Mark this issue or PR as rotten with
/lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle stale - Mark this issue or PR as rotten with
/lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Reopen this issue with
/reopen - Mark this issue as fresh with
/remove-lifecycle rotten - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/close not-planned
@k8s-triage-robot: Closing this issue, marking it as "Not Planned".
In response to this:
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied- After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied- After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closedYou can:
- Reopen this issue with
/reopen- Mark this issue as fresh with
/remove-lifecycle rotten- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/close not-planned
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
/assign