Skip to content

Hackless Go-native tools for Knative #254

Open

Description

@krsna-m

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.

Activity

  1. cardil commented on Feb 17, 2023

    @cardil
    Contributor

    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
  2. cardil commented on Mar 24, 2023

    @cardil
    Contributor
  3. sbdtu5498 commented on Jun 27, 2023

    @sbdtu5498

    /assign

  4. changed the title [-]Revisit hack scripts[/-] [+]Rewrite hacks into Go native tools[/+] on Oct 10, 2023
  5. cardil commented on Oct 10, 2023

    @cardil
    Contributor

    /assign

    I'll assign myself to foster this epic.

  6. changed the title [-]Rewrite hacks into Go native tools[/-] [+]Hackless Go-native tools for Knative[/+] on Oct 13, 2023
  7. cardil commented on Apr 5, 2024

    @cardil
    Contributor

    /triage accepted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

triage/acceptedIssues which should be fixed (post-triage)

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions