cluster-api-provider-aws icon indicating copy to clipboard operation
cluster-api-provider-aws copied to clipboard

Introduce args in releasechangelog script

Open rvacaru opened this issue 2 years ago • 15 comments

What type of PR is this? /kind refactor

What this PR does / why we need it:

The releasechangelog.sh script now uses arguments instead of relying on the right variables being set out side the script.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged): Fixes #3405

Special notes for your reviewer: The PREVIOUS_VERSION arg is not set in the Makefile, as of now it ends up being parsed as -o. I need help in order to get the previous version and pass it or set a default value, but I don't think it's doable cause of the call to gh api.

Checklist:

  • [X] squashed commits
  • [X] includes documentation
  • [ ] adds unit tests
  • [ ] adds or updates e2e tests

rvacaru avatar Apr 22 '22 12:04 rvacaru

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: rvacaru / name: Razvan Vacaru (59a63d211944d299062157603d0ba9c5b3765cc3)

Welcome @rvacaru!

It looks like this is your first PR to kubernetes-sigs/cluster-api-provider-aws 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api-provider-aws has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot avatar Apr 22 '22 12:04 k8s-ci-robot

@rvacaru: This issue is currently awaiting triage.

If CAPA/CAPI contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

k8s-ci-robot avatar Apr 22 '22 12:04 k8s-ci-robot

Hi @rvacaru. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

k8s-ci-robot avatar Apr 22 '22 12:04 k8s-ci-robot

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: To complete the pull request process, please assign richardcase after the PR has been reviewed. You can assign the PR to them by writing /assign @richardcase in a comment when ready.

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 avatar Apr 22 '22 12:04 k8s-ci-robot

@rvacaru Could you please sign the CLA and try again?

Ankitasw avatar Apr 26 '22 15:04 Ankitasw

/easycla

rvacaru avatar Apr 28 '22 15:04 rvacaru

/easycla

rvacaru avatar Apr 28 '22 16:04 rvacaru

/ok-to-test

shivi28 avatar Apr 29 '22 07:04 shivi28

@Ankitasw @dlipovetsky what can I do to progress with this pr? The only open point is how to get the previous version or maybe just remove it for the time being.

rvacaru avatar May 19 '22 16:05 rvacaru

The script was using the same variable names with Makefile before and I changed them because they were getting overridden: https://github.com/kubernetes-sigs/cluster-api-provider-aws/pull/3388

Can you confirm that this issue does not get reintroduced?

sedefsavas avatar Jun 03 '22 20:06 sedefsavas

@rvacaru hi 😊 would you like to continue with this pr?

Skarlso avatar Jul 17 '22 10:07 Skarlso

@Skarlso sure I can check for the regression @sedefsavas is mentioning

rvacaru avatar Jul 18 '22 11:07 rvacaru

Awesome! Thank you! :)

Skarlso avatar Jul 18 '22 11:07 Skarlso

@rvacaru any progress with this?

Ankitasw avatar Aug 11 '22 14:08 Ankitasw

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/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was 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

k8s-triage-robot avatar Nov 09 '22 15:11 k8s-triage-robot

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/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was 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

k8s-triage-robot avatar Dec 09 '22 16:12 k8s-triage-robot

@sedefsavas @Skarlso I've renamed all the getops arguments in the release changelog script, so they won't be shadowed/overridden with the ones in Makefile. I managed to test the sh script myself(instead of running $GH I simply echo the same line for sake of testing), this is the output:

$ ./hack/releasechangelog.sh -v 1.0 -p 0.0 -o test-org-capa-name -r test-repo-name -c ctrl-img-name

# Release notes for Cluster API Provider AWS (CAPA) 1.0
[Documentation](https://cluster-api-aws.sigs.k8s.io/)
# Changelog since 0.0
GH api repos/test-org-capa-name/test-repo-name/releases/generate-notes -F tag_name=1.0 -F previous_tag_name=0.0 --jq '.body'
**The image for this release is**: registry.k8s.io/cluster-api-aws/cluster-api-aws-controller:1.0
Thanks to all our contributors!

If I test it with make release-changelog, by hardcoding the PREVIOUS_VERSION and VERSION in Makefile since I don't know where they come from or how to generate them, then the CHANGELOG.md looks like this:

# Release notes for Cluster API Provider AWS (CAPA) 1.1.0
[Documentation](https://cluster-api-aws.sigs.k8s.io/)
# Changelog since 0.0.12
GH api repos/kubernetes-sigs/cluster-api-provider-aws/releases/generate-notes -F tag_name=1.1.0 -F previous_tag_name=0.0.12 --jq '.body'
**The image for this release is**: registry.k8s.io/cluster-api-aws/cluster-api-aws-controller:1.1.0
Thanks to all our contributors!

Could you explain how the two versions are initialized in the Makefile?

rvacaru avatar Dec 16 '22 11:12 rvacaru

The linting error about //nolint: logrlint in pull-cluster-api-provider-aws-test is not introduced in this PR, but there's already the fix for it here: https://github.com/kubernetes-sigs/cluster-api-provider-aws/pull/3920

rvacaru avatar Dec 16 '22 13:12 rvacaru

/remove-lifecycle rotten

rvacaru avatar Dec 16 '22 13:12 rvacaru

/assign

Skarlso avatar Dec 16 '22 18:12 Skarlso

@rvacaru Right, so that error will go away once this is merged and you rebase.

If you don't want to wait, just remove that no:lint marker. It should be okay now to remove it.

Skarlso avatar Dec 16 '22 18:12 Skarlso

Please rebase your PR.

Ankitasw avatar Dec 22 '22 12:12 Ankitasw

rebased this PR branch on top of main, what else is missing?

rvacaru avatar Jan 17 '23 15:01 rvacaru

/lgtm

Skarlso avatar Jan 20 '23 10:01 Skarlso

/approve

Skarlso avatar Jan 20 '23 10:01 Skarlso

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Skarlso

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

The pull request process is described 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 avatar Jan 20 '23 10:01 k8s-ci-robot