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

Add setup krel github action #101

Closed

Conversation

Vyom-Yadav
Copy link
Member

@Vyom-Yadav Vyom-Yadav commented Nov 19, 2024

Adds a GitHub Action to setup krel.

This is required to setup a presubmit job for PRs like: kubernetes/sig-release#2659. The current requirement is to add validation using:

$ krel release-notes validate --help
krel release-notes validate <path-to-release-notes>

The 'validate' subcommand of krel has been developed to:

1. Check release notes maps for valid yaml.

2. Check release notes maps for valid punctuation.

Usage:
  krel release-notes validate [flags]

Flags:
  -h, --help                           help for validate
      --path-to-release-notes string   The path to the release notes to validate. Can be a top level directory or a specific file.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Vyom-Yadav
Once this PR has been reviewed and has the lgtm label, please assign jeremyrickard for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 19, 2024
@cpanato
Copy link
Member

cpanato commented Nov 19, 2024

May I ask why? What is the need for that?

Signed-off-by: Vyom-Yadav <jackhammervyom@gmail.com>
@Vyom-Yadav Vyom-Yadav force-pushed the add-setup-krel-action branch from 4510b94 to baaa5cd Compare November 19, 2024 21:48
@Vyom-Yadav
Copy link
Member Author

May I ask why? What is the need for that?

Just added the reason to the PR description. It is required for running a pre submit validation job.

@puerco
Copy link
Member

puerco commented Nov 19, 2024

The release team is building a yaml linter into krel (for the release notes maps), this would allow it to run on k/release to catch badly formatted yaml.

One thing that comes to mind is that krel is not intended to be a general-purpose tool so perhaps we could still have the installer workflow but only for k/release (not as a reusable action)? WdYT @cpanato ?

@Vyom-Yadav
Copy link
Member Author

Vyom-Yadav commented Nov 19, 2024

One thing that comes to mind is that krel is not intended to be a general-purpose tool so perhaps we could still have the installer workflow but only for k/release (not as a reusable action)?

Do you want to have this directly on /~https://github.com/kubernetes/sig-release? (I'm assuming by k/release you meant that and not /~https://github.com/kubernetes/release).

Or do you actually want to have this in /~https://github.com/kubernetes/release, and want this to be a reusable workflow and not a composite action? (https://docs.github.com/en/actions/sharing-automations/avoiding-duplication)

@cpanato
Copy link
Member

cpanato commented Nov 20, 2024

@puerco @Vyom-Yadav, why is that not a stand-alone tool instead being injected inside krel?

@Vyom-Yadav
Copy link
Member Author

@npolshakova Is there any release notes specific validation other than standard yaml format validation that krel release-notes validate provides?

@npolshakova
Copy link

@npolshakova Is there any release notes specific validation other than standard yaml format validation that krel release-notes validate provides?

Yep, there are a couple of reasons this is not a stand-alone tool and instead is bundled as part of krel.

  • krel release-notes validate uses the same go yaml validation logic that krel release-notes --create-draft-pr --fix uses to make it consistent for the release notes team
  • Currently release-notes validate also check for punctuation consistency. There have been other suggested things it can check for (K8s terms spelling, correct tense, etc.).
  • The release notes team already relies on krel to create the PR. Adding a new tool dependency is extra overhead for the team.

exit 1
fi

# Compare paths

Choose a reason for hiding this comment

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

Can we run it on the git diff (git diff --name-only master) that gets created when a release notes PR is put for review? This way it will ignore old changes and only run on the new files.

Copy link
Member Author

@Vyom-Yadav Vyom-Yadav Nov 22, 2024

Choose a reason for hiding this comment

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

This is just the test workflow for setting up krel. This would be used out of tree on sig release repo, which will be a separate PR after this which would have the constraints on when to trigger it.

Choose a reason for hiding this comment

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

Nice! Then we can potentially reuse the action for other krel commands: /~https://github.com/kubernetes/release/tree/23fe7e8cfa915a24abf3d61d2fadc80ab0674baf/docs/krel#usage

@Vyom-Yadav
Copy link
Member Author

@cpanato I hope #101 (comment) answers your question

@puerco
Copy link
Member

puerco commented Nov 25, 2024

@Vyom-Yadav yeah I meant on k/sig-release, sorry.

The goal of the release-actions repo is to let others reuse the general purpose tools we have. Since krel (and this feature specifically) is only intended for use in the kubernetes releases I think we should not offer it here for everybody, but we should definitely have it in sig-release.

@npolshakova
Copy link

@Vyom-Yadav yeah I meant on k/sig-release, sorry.

The goal of the release-actions repo is to let others reuse the general purpose tools we have. Since krel (and this feature specifically) is only intended for use in the kubernetes releases I think we should not offer it here for everybody, but we should definitely have it in sig-release.

I think when we brought this up in the release meeting, they specifically suggested having krel live here because there already is an example workflow that uses the release-notes binary )/~https://github.com/kubernetes-sigs/release-actions/tree/main/setup-release-notes).

That way sig-release will be relatively free of go code and GitHub workflow logic, and would just import in this workflow.

@puerco
Copy link
Member

puerco commented Dec 17, 2024

@Vyom-Yadav

We discussed this during the Dec 17 SIG release meeting. Based on our discussion please recreate this PR in k/sig-release.

A final note on the implementation: Before you recreate the PR, please make sure that instead of building it in the workflow, download a prebuilt (pinned) krel binary from k/release, verify the signature and run that instead of building it fresh.

/cc @npolshakova @cpanato @kubernetes-sigs/release-engineering

@puerco
Copy link
Member

puerco commented Dec 17, 2024

We will be closing this soon (see comment above) I'll leave it open for visibility for a few days.
/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 17, 2024
@Vyom-Yadav
Copy link
Member Author

Vyom-Yadav commented Jan 4, 2025

I'll send updates to the newer PR.

/close

@k8s-ci-robot
Copy link
Contributor

@Vyom-Yadav: Closed this PR.

In response to this:

I'll send updated to the newer PR.

/close

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-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants