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

Hackless Go-native tools for Knative #254

Open
7 tasks
krsna-m opened this issue Nov 15, 2022 · 5 comments · May be fixed by #299
Open
7 tasks

Hackless Go-native tools for Knative #254

krsna-m opened this issue Nov 15, 2022 · 5 comments · May be fixed by #299
Assignees
Labels
triage/accepted Issues which should be fixed (post-triage)

Comments

@krsna-m
Copy link
Contributor

krsna-m commented Nov 15, 2022

The productivity consensus is to deprecate the hacks repository and shift away from using shell scripts in Knative. Instead, the well-defined functionality should be re-implemented using Go-native tools. This will make it easier for Knative contributors to maintain, allow for testing with ease, and ultimately improve the overall solution's quality.

The default target for this rewrite is the knative/toolbox repository. Some code, which is reusable and might be used by direct code import, might be rewritten to specific sub-package withing the knative.dev/pkg.

Task list

Original issue by @kvmware:

It has gotten to a point where hack scripts are more than what they should be doing in bash.
We should minimize the amount of bash to simple easy to understand shellchecked bash scripts and offload any more complicated logic to golang which the community has more familiarity with.

@cardil
Copy link
Contributor

cardil commented Feb 17, 2023

I think we should stop development of shell hacks. Recent code signing issues (see: #272, #240) clearly shows writing such tools in shell is short-sighted - the code is cryptic, hard to maintain, and often contains bugs. Although we have now a unit test framework, still testing isn't easy.

I think we should freeze this repo, and try to rewrite scripts one by one as Golang native tools. Those tools could be executed in Make files or simple scripts, as CLI, like:

go run knative.dev/tool/releaser@latest \
  --dot-release \
  --release-gcs knative-releases/kn-plugin-event \
  --release-gcr gcr.io/knative-releases \
  --github-token /etc/hub-token/token \
  --apple-codesign-key /etc/notary/cert.p12 \
  --apple-notary-api-key /etc/notary/key.json \
  --apple-codesign-password-file /etc/notary/password \
  --branch release-1.9

Or you could embed such innovations directly in Go-native build tools like Mage or goyek.

A good starting point for such rewrite is https://github.com/wavesoftware/go-magetasks/ which I would like to donate to Knative tools, and disconnect it from Mage, so it would be a general tooling.

It misses some things like:

  • update-deps tooling,
  • release tooling,
  • codegen tooling,
  • presubmit-tests runner,
  • e2e test runner

@cardil
Copy link
Contributor

cardil commented Mar 24, 2023

This might help: https://github.com/bitfield/script

@sbdtu5498
Copy link

/assign

@sbdtu5498 sbdtu5498 linked a pull request Jul 10, 2023 that will close this issue
@cardil cardil changed the title Revisit hack scripts Rewrite hacks into Go native tools Oct 10, 2023
@cardil
Copy link
Contributor

cardil commented Oct 10, 2023

/assign

I'll assign myself to foster this epic.

@cardil cardil changed the title Rewrite hacks into Go native tools Hackless Go-native tools for Knative Oct 13, 2023
@cardil
Copy link
Contributor

cardil commented Apr 5, 2024

/triage accepted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage/accepted Issues which should be fixed (post-triage)
Projects
Status: In Design/Discussion
Development

Successfully merging a pull request may close this issue.

3 participants