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

No shallow taps #11337

Merged
merged 36 commits into from May 7, 2021
Merged

No shallow taps #11337

merged 36 commits into from May 7, 2021

Conversation

cnnrmnn
Copy link
Contributor

@cnnrmnn cnnrmnn commented May 6, 2021

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

See #11328.
Removes the --full and --shallow tap command flags. Changes tap command to fully clone taps and convert any existing shallow clones to full clones when updated.

MikeMcQuaid
MikeMcQuaid previously approved these changes May 6, 2021
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Makes sense to me, nice work @cnnrmnn! Won't merge just yet in case other maintainers have thoughts.

@Bo98
Copy link
Member

Bo98 commented May 6, 2021

Does this need a deprecation path?

@Rylan12
Copy link
Member

Rylan12 commented May 6, 2021

Does this need a deprecation path?

Yes I think it does. I wouldn't be surprised if there are scripts tat use brew tap --shallow.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Nice work, almost there!

Library/Homebrew/cmd/tap.rb Show resolved Hide resolved
Library/Homebrew/cmd/tap.rb Outdated Show resolved Hide resolved
Library/Homebrew/cmd/tap.rb Outdated Show resolved Hide resolved
Library/Homebrew/cmd/tap.rb Outdated Show resolved Hide resolved
Library/Homebrew/cmd/tap.rb Outdated Show resolved Hide resolved
cnnrmnn and others added 5 commits May 7, 2021 09:42
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
@cnnrmnn
Copy link
Contributor Author

cnnrmnn commented May 7, 2021

Nice work, almost there!

Appreciate you taking the time to help me out. All changes noted for future contributions :)

Copy link
Member

@Rylan12 Rylan12 left a comment

Choose a reason for hiding this comment

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

Two comments:

First, can you just add a few TODO comments wherever the commented out deprecations are? It makes it a little bit easier to find those once it's time to uncomment them. I also like to add the major/minor version number to the comment to make it easier for whoever's doing the deprecation.

Also, we have have a replacement option that can be passed to the switch that helps with deprecating/disabling command flags. Although it seems, for some reason, that they can only be used for disabling rather than deprecations... Can you add commented out replacement lines for the --full and --shallow lines?

It should look something like this:

  def tap_args
    Homebrew::CLI::Parser.new do
      usage_banner "`tap` [<options>] [<user>`/`<repo>] [<URL>]"
      description <<~EOS
        Tap a formula repository.
        ...
      EOS
      switch "--full",
             description: "Convert a shallow clone to a full clone without untapping. Taps are only cloned as "\
                          "shallow clones if `--shallow` was originally passed."
             # TODO: (3.3) Uncomment and remove references to `args.full?`
             # replacement: false
      switch "--shallow",
             description: "Fetch tap as a shallow clone rather than a full clone. Useful for continuous integration."
             # TODO: (3.3) Uncomment and remove references to `args.shallow?`
             # replacement: false
      # ...
    end
  end

Library/Homebrew/cmd/tap.rb Show resolved Hide resolved
Library/Homebrew/cmd/tap.rb Show resolved Hide resolved
cnnrmnn and others added 3 commits May 7, 2021 10:07
Add tap --full deprecation TODO

Co-authored-by: Rylan Polster <rslpolster@gmail.com>
Co-authored-by: Rylan Polster <rslpolster@gmail.com>
@cnnrmnn
Copy link
Contributor Author

cnnrmnn commented May 7, 2021

Also, we have have a replacement option that can be passed to the switch that helps with deprecating/disabling command flags. Although it seems, for some reason, that they can only be used for disabling rather than deprecations... Can you add commented out replacement lines for the --full and --shallow lines?

By disabling, do you mean removing the command altogether or deprecating it as a no-op?

@Rylan12
Copy link
Member

Rylan12 commented May 7, 2021

By disabling, do you mean removing the command altogether or deprecating it as a no-op?

When we make backward incompatible changes, we do it in a three-part cycle:

  1. Deprecation: this means that a warning is shown to users but the comand/method/flag still works (although if you have HOMEBREW_DEVELOPER set this becomes an error not a warning)
  2. Disabling: this means that the comand/method/flag no longer works but a message is still shown
  3. Removing the comand/method/flag completely

We advance to each level only on a major or minor release. So, when Homebrew 3.2.0 is released, we'll want these flags to be deprecated. 3.3.0 will have them disabled, and 3.4.0 will have them totally removed.

Right now it's fine for them to be a no-op because we haven't yet reached the 3.2.0 release mark. After that, though, they won't really be a no-op any more because if you try to pass one of them you'll either see an error with `brew tap --full` has been deprecated/disabled! (3.2-3.3) or invalid option: --foo (3.4+)

Does that help clarify?

@cnnrmnn
Copy link
Contributor Author

cnnrmnn commented May 7, 2021

Does that help clarify?

Yes, thanks!

@MikeMcQuaid
Copy link
Member

@cnnrmnn Flaky tests, I'll rerun!

@cnnrmnn
Copy link
Contributor Author

cnnrmnn commented May 7, 2021

@cnnrmnn Flaky tests, I'll rerun!

Looks like they failed again. I'm unsure why.

@Bo98
Copy link
Member

Bo98 commented May 7, 2021

Rebase on master and it should work. The faulty test has been removed.

dependabot bot and others added 20 commits May 7, 2021 16:47
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Add tap --full deprecation TODO

Co-authored-by: Rylan Polster <rslpolster@gmail.com>
Co-authored-by: Rylan Polster <rslpolster@gmail.com>
@MikeMcQuaid MikeMcQuaid merged commit 3eaa0d7 into Homebrew:master May 7, 2021
@Rylan12
Copy link
Member

Rylan12 commented May 8, 2021

Thanks for the PR, @cnnrmnn! 🎉

Also, I noticed that you're a Yale student—I'll be joining you there next year!

@cnnrmnn
Copy link
Contributor Author

cnnrmnn commented May 8, 2021

Thanks for the PR, @cnnrmnn! 🎉

Also, I noticed that you're a Yale student—I'll be joining you there next year!

Awesome, welcome! Shoot me an email if you have any questions. :)

@Rylan12
Copy link
Member

Rylan12 commented May 8, 2021

Thanks, will do! ❤️🐶

@cnnrmnn cnnrmnn deleted the no-shallow-taps branch May 13, 2021 13:36
@github-actions github-actions bot added the outdated PR was locked due to age label Jun 13, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants