gsoc icon indicating copy to clipboard operation
gsoc copied to clipboard

Autobumping resources in Formulae

Open nandahkrishna opened this issue 2 years ago • 9 comments

We currently have brew livecheck to give us the latest versions of Formulae and brew bump which uses that information to update Formulae to their latest versions. However, many Formulae have resources that need to be bumped manually, which requires some searching. It would be beneficial to have livecheck- or bump-like tooling to help automate this, as most resource updates have a clear "strategy". (We already do this for many Formulae with PyPI resources using brew update-python-resources.)

Here are a couple of solutions I had in mind:

  1. Add resource bump strategies to Homebrew/brew, e.g., RubyGems, CPAN or even :track_formula_version. This information could be added to resource blocks in Formulae and used when brew bump-formula-pr is run.
  2. Create a separate Tap (just like livecheck originally was) with the bump strategies and Livecheckable-equivalents for resources.

nandahkrishna avatar Feb 04 '22 17:02 nandahkrishna

I'd suggest even allowing livecheck blocks in resources.

SMillerDev avatar Feb 05 '22 06:02 SMillerDev

Love this idea, thanks @nandahkrishna. I like the idea of extending livecheck for this and, at least eventually, it lives in Homebrew/brew and Homebrew/homebrew-core.

MikeMcQuaid avatar Feb 07 '22 10:02 MikeMcQuaid

I love this idea too. I'm going to mark it as a 175 hour project, but let me know if you think it should be 350 hours instead.

mistydemeo avatar Feb 14 '22 01:02 mistydemeo

I'm fine with this being a 175-hour project. So far, these are the objectives that come to mind, although all of these wouldn't have to be achieved during GSoC:

  • Extend the livecheck DSL to work for resources.
  • Add default strategies meant for resources from specific sources (such as RubyGems, CPAN, etc.).
  • Add livecheck blocks for resources in homebrew/core.
  • Implement a brew update-resources command and augment brew livecheck with an option to retrieve resource versions.

It's worth noting that some resource updates, such as the ones from PyPI and RubyGems, often involve the addition or removal of some resources. These would probably require having a formula-level strategy for the resources. Our existing PyPI resource updation strategy uses pipgrip, which requires that the formula itself be from PyPI – so it would be great to add strategies that work for formulae from other sources that require PyPI resources.

nandahkrishna avatar Feb 15 '22 16:02 nandahkrishna

Hi! I'm interested in working on this issue as GSoC project. I've gone through project's description by @nandahkrishna and @MikeMcQuaid's guidelines for working GSoC project on GitHub. To get a basic idea on how things are working right now, I have looked at Livecheck's module and class, which I believe serves as a starting point for this project (kindly do correct me if I am mistaken)

Is there anything that you guys recommend me to look into before submitting a proposal for this project on GSoC ?

mohammadzainabbas avatar Apr 19 '22 11:04 mohammadzainabbas

@mohammadzainabbas That sounds like a good start!

MikeMcQuaid avatar Apr 19 '22 11:04 MikeMcQuaid

Perfect! I have submitted a proposal for this project on GSoC.

mohammadzainabbas avatar Apr 19 '22 12:04 mohammadzainabbas

Thanks, Mohammad! We'll review your proposal soon.

mistydemeo avatar Apr 19 '22 18:04 mistydemeo

Just a note on prior art: @branchvincent has an update-perl-resources external command that could be useful here.

carlocab avatar Apr 21 '22 03:04 carlocab