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

Check deprecated methods on release #2673

Merged
2 commits merged into from Mar 8, 2019
Merged

Conversation

deivid-rodriguez
Copy link
Member

Description:

I noticed that we have a bunch of methods in the code base that were supposed to have been deprecated in December 2018, when rubygems 3 was released, but that didn't happen?

I'm not sure if it was intentional or not, but I figured we could have a release check that makes sure we either definitively remove the methods, or expand the deprecation horizon.

Tasks:

  • Describe the problem / feature
  • Write tests
  • Write code to solve the problem
  • Get code review from coworkers / friends

I will abide by the code of conduct.

@deivid-rodriguez
Copy link
Member Author

This is what one currently gets by running rake check_deprecations (manually editing the version in rubygems-update.gemspec to be 4.0.0.pre1):

$ rake check_deprecations
util/rubocop -r ./util/cops/deprecations --only Rubygems/Deprecations
Inspecting 324 files
.......................................................................................................................................................C...............C...............................................................................C...........................................................CCC..C...........

Offenses:

lib/rubygems.rb:597:5: C: Rubygems/Deprecations: Remove deprecate calls with dates in the past, along with the methods they deprecate, or expand the deprecation horizons to a future date
    deprecate :gunzip, "Gem::Util.gunzip", 2018, 12
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/rubygems.rb:611:5: C: Rubygems/Deprecations: Remove deprecate calls with dates in the past, along with the methods they deprecate, or expand the deprecation horizons to a future date
    deprecate :gzip, "Gem::Util.gzip", 2018, 12
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/rubygems.rb:625:5: C: Rubygems/Deprecations: Remove deprecate calls with dates in the past, along with the methods they deprecate, or expand the deprecation horizons to a future date
    deprecate :inflate, "Gem::Util.inflate", 2018, 12
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/rubygems.rb:1226:5: C: Rubygems/Deprecations: Remove deprecate calls with dates in the past, along with the methods they deprecate, or expand the deprecation horizons to a future date
    deprecate :detect_gemdeps, "Gem.use_gemdeps", 2018, 12
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/rubygems/dependency_installer.rb:161:3: C: Rubygems/Deprecations: Remove deprecate calls with dates in the past, along with the methods they deprecate, or expand the deprecation horizons to a future date
  deprecate :add_found_dependencies, :none, 2018, 12
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/rubygems/dependency_installer.rb:353:3: C: Rubygems/Deprecations: Remove deprecate calls with dates in the past, along with the methods they deprecate, or expand the deprecation horizons to a future date
  deprecate :gather_dependencies, :none, 2018, 12
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/rubygems/specification.rb:723:3: C: Rubygems/Deprecations: Remove deprecate calls with dates in the past, along with the methods they deprecate, or expand the deprecation horizons to a future date
  deprecate :default_executable=, :none,       2018, 12
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/rubygems/specification.rb:1787:3: C: Rubygems/Deprecations: Remove deprecate calls with dates in the past, along with the methods they deprecate, or expand the deprecation horizons to a future date
  deprecate :default_executable,  :none,       2018, 12
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/rubygems/specification.rb:1996:3: C: Rubygems/Deprecations: Remove deprecate calls with dates in the past, along with the methods they deprecate, or expand the deprecation horizons to a future date
  deprecate :has_rdoc,            :none,       2018, 12
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/rubygems/specification.rb:2006:3: C: Rubygems/Deprecations: Remove deprecate calls with dates in the past, along with the methods they deprecate, or expand the deprecation horizons to a future date
  deprecate :has_rdoc=,           :none,       2018, 12
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/rubygems/specification.rb:2009:3: C: Rubygems/Deprecations: Remove deprecate calls with dates in the past, along with the methods they deprecate, or expand the deprecation horizons to a future date
  deprecate :has_rdoc?,           :none,       2018, 12
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/rubygems/user_interaction.rb:367:3: C: Rubygems/Deprecations: Remove deprecate calls with dates in the past, along with the methods they deprecate, or expand the deprecation horizons to a future date
  deprecate :debug, :none, 2018, 12
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/rubygems/test_case.rb:717:3: C: Rubygems/Deprecations: Remove deprecate calls with dates in the past, along with the methods they deprecate, or expand the deprecation horizons to a future date
  deprecate :quick_spec, :util_spec, 2018, 12
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/rubygems/test_case.rb:864:3: C: Rubygems/Deprecations: Remove deprecate calls with dates in the past, along with the methods they deprecate, or expand the deprecation horizons to a future date
  deprecate :new_spec, :none, 2018, 12
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/rubygems/installer.rb:847:3: C: Rubygems/Deprecations: Remove deprecate calls with dates in the past, along with the methods they deprecate, or expand the deprecation horizons to a future date
  deprecate :extension_build_error, :none, 2018, 12
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/rubygems/exceptions.rb:21:3: C: Rubygems/Deprecations: Remove deprecate calls with dates in the past, along with the methods they deprecate, or expand the deprecation horizons to a future date
  deprecate :source_exception, :none, 2018, 12
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

324 files inspected, 16 offenses detected
rake aborted!
Command failed with status (1): [util/rubocop -r ./util/cops/deprecations -...]
/home/deivid/Code/rubygems/Rakefile:95:in `block in <top (required)>'
Tasks: TOP => check_deprecations
(See full trace by running task with --trace)

I guess we should delay the removal of these to rubygems 4.0 (2019/12, I guess).

@deivid-rodriguez deivid-rodriguez force-pushed the check_deprecated_methods_on_release branch from be23d02 to 4712d2b Compare March 7, 2019 14:28
Copy link
Member

@bronzdoc bronzdoc left a comment

Choose a reason for hiding this comment

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

Oh this is great! thanks @deivid-rodriguez!

# deprecate :safdfa, nil, 2019, 02
#
# # good
# deprecate :safdfa, nil, 2019, 03
Copy link
Member Author

Choose a reason for hiding this comment

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

Just noticed that this example doesn't match the code. If we try to release a major version, and rubocop finds a method that's supposed to be removed in that same month, it will print an offense, although it's documented as "good" here. I'll fix it now.

@deivid-rodriguez deivid-rodriguez force-pushed the check_deprecated_methods_on_release branch from 4712d2b to fe67f62 Compare March 8, 2019 10:25
@deivid-rodriguez
Copy link
Member Author

I corrected the tiny documentation change, this should be ready now!

@bronzdoc
Copy link
Member

bronzdoc commented Mar 8, 2019

@bundlerbot r+

ghost pushed a commit that referenced this pull request Mar 8, 2019
2673: Check deprecated methods on release r=bronzdoc a=deivid-rodriguez

# Description:

I noticed that we have a bunch of methods in the code base that were supposed to have been deprecated in December 2018, when rubygems 3 was released, but that didn't happen?

I'm not sure if it was intentional or not, but I figured we could have a release check that makes sure we either definitively remove the methods, or expand the deprecation horizon.

# Tasks:

- [x] Describe the problem / feature
- [ ] Write tests
- [x] Write code to solve the problem
- [ ] Get code review from coworkers / friends

I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md).


2676: Fix metadata description docs r=bronzdoc a=sonalkr132



# Description:

> settable by gem authors without requiring an update to the rubygems software.

this has never been true. Not sure why it said that.
Using G in the gem is converting it to link on using `rake spec_guide` ([broken here](rubygems/guides@2ca58b0#diff-a0ed24268b853e4412f766326125de00L12)).

# Tasks:

- [ ] Describe the problem / feature
- [ ] Write tests
- [ ] Write code to solve the problem
- [ ] Get code review from coworkers / friends

I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md).


Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
Co-authored-by: Aditya Prakash <aditya.prakash132@gmail.com>
@ghost
Copy link

ghost commented Mar 8, 2019

Build succeeded

@ghost ghost merged commit fe67f62 into master Mar 8, 2019
@ghost ghost deleted the check_deprecated_methods_on_release branch March 8, 2019 15:35
ghost pushed a commit that referenced this pull request Mar 31, 2019
2704: Remove long ago deprecated methods r=bronzdoc a=deivid-rodriguez


# Description:

Use our `deprecate` helper so that we don't forget to kill this code in the next major release (thanks to #2673). The diff is simple, view it without whitespace changes though.

Or maybe I should just go ahead and kill all this code now... 🤔.

# Tasks:

- [x] Describe the problem / feature
- [ ] Write tests
- [x] Write code to solve the problem
- [ ] Get code review from coworkers / friends

I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md).


Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
hsbt pushed a commit that referenced this pull request Jun 13, 2019
2673: Check deprecated methods on release r=bronzdoc a=deivid-rodriguez

# Description:

I noticed that we have a bunch of methods in the code base that were supposed to have been deprecated in December 2018, when rubygems 3 was released, but that didn't happen?

I'm not sure if it was intentional or not, but I figured we could have a release check that makes sure we either definitively remove the methods, or expand the deprecation horizon.

# Tasks:

- [x] Describe the problem / feature
- [ ] Write tests
- [x] Write code to solve the problem
- [ ] Get code review from coworkers / friends

I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md).


2676: Fix metadata description docs r=bronzdoc a=sonalkr132



# Description:

> settable by gem authors without requiring an update to the rubygems software.

this has never been true. Not sure why it said that.
Using G in the gem is converting it to link on using `rake spec_guide` ([broken here](rubygems/guides@2ca58b0#diff-a0ed24268b853e4412f766326125de00L12)).

# Tasks:

- [ ] Describe the problem / feature
- [ ] Write tests
- [ ] Write code to solve the problem
- [ ] Get code review from coworkers / friends

I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md).


Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
Co-authored-by: Aditya Prakash <aditya.prakash132@gmail.com>
This pull request was closed.
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.

None yet

3 participants