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

Rake Task: avoid calling super with arguments to avoid an ArgumentError #943

Merged
merged 3 commits into from
Mar 22, 2021

Conversation

olleolleolle
Copy link
Collaborator

@olleolleolle olleolleolle commented Mar 22, 2021

Rake's RakeLib base class does not define a specific initializer.

In the initializer for our RakeTask creation class, we call super sans args.

When we do call it with a specific name, super fails like:

ArgumentError: wrong number of arguments (given 1, expected 0)
/home/travis/build/dev-sec/chef-os-hardening/vendor/bundle/ruby/2.6.0/gems/github_changelog_generator-1.16.0/lib/github_changelog_generator/task.rb:34:in `initialize'
/home/travis/build/dev-sec/chef-os-hardening/vendor/bundle/ruby/2.6.0/gems/github_changelog_generator-1.16.0/lib/github_changelog_generator/task.rb:34:in `initialize'

Fixes #942

The RakeLib base class does not define a specific initializer.
mfortin
mfortin previously approved these changes Mar 22, 2021
Copy link

@mfortin mfortin left a comment

Choose a reason for hiding this comment

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

👍

This allows us to keep the RuboCop rule.
@olleolleolle olleolleolle changed the title Rake Task: avoid calling super Rake Task: avoid calling super with argument Mar 22, 2021
@olleolleolle olleolleolle changed the title Rake Task: avoid calling super with argument Rake Task: avoid calling super with arguments Mar 22, 2021
@olleolleolle olleolleolle changed the title Rake Task: avoid calling super with arguments Rake Task: avoid calling super with arguments to avoid an ArgumentError Mar 22, 2021
@kennyadsl
Copy link

Tested this (with super()) and it works for me now.

@olleolleolle olleolleolle merged commit c23a331 into master Mar 22, 2021
@olleolleolle olleolleolle deleted the avoid-issue-with-rakelib-super branch March 22, 2021 15:08
@mfortin
Copy link

mfortin commented Mar 22, 2021

Thanks! Should I expect a new release soon ?

@olleolleolle
Copy link
Collaborator Author

Everything depends on things not going bad when releasing. If they do, I lose hope and then things take more time.

Now, I had to:

  • use the invalid label and redo the changelog generation to exclude "an Issue which was not about this repo"
  • due to Branch Protection, I had to spend time on making a PR, to bump version & generate changelog
  • then I had to break MORE rules of Branch Protection due to other maintainers not being there
  • then I could build and release to RubyGems
  • And then, resetting Branch Protection

So, this is a hassle. And I've already quit this maintainership.

@olleolleolle
Copy link
Collaborator Author

@mfortin PS: the 1.16.1 is out. Try it!

@mfortin
Copy link

mfortin commented Mar 22, 2021

all good, thanks for your prompt response @olleolleolle

@kennyadsl
Copy link

Thank you @olleolleolle

@skywinder
Copy link
Member

Thank you very much @olleolleolle 🙌

I see your pain with this. lmk, how we can we improve this.
I propose to keep release rules simple.
Probably we can remove release branch protection things? In order to make releases faster.

Btw, @mfortin @kennyadsl wants to point out that this repo needs collaborators. so if some want to participate - you are very welcome! #727

If you are using this repo, it would be great if someone can help to help to maintain and release new things for this repo.

@olleolleolle
Copy link
Collaborator Author

Updated the Settings to remove the "requires a review to be merged". All other protections remain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Release 1.16: If you give a specifc name to the GitHubChangelogGenerator::RakeTask, it breaks.
4 participants