147 Commits

Author SHA1 Message Date
Markus Reiter
480e264d9a
Lint Ruby docs. 2024-05-01 11:35:21 +02:00
Ruoyu Zhong
4cf42f7c18
pr-pull: simplify 2024-04-17 07:37:02 +08:00
Ruoyu Zhong
dd92ad8e1b
Update default artifact pattern to avoid migration problems 2024-04-17 06:15:14 +08:00
Ruoyu Zhong
1a1a466e9d
pr-pull: support globbing artifacts
Artifact actions v3 is deprecated and will soon be unavailable [^1].
This adds support for v4 by allowing `brew pr-pull` to accept a glob
pattern for artifact names, like actions/download-artifact does [^2].

[^1]: https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/
[^2]: https://github.com/actions/download-artifact/tree/v4/#usage
2024-04-17 03:36:43 +08:00
Douglas Eichelberger
c50fb2dbd2 Remove redundant cli/parser requires 2024-03-29 18:53:07 -07:00
Douglas Eichelberger
dc062bea52 Port Homebrew::DevCmd::PrPull 2024-03-22 09:33:28 -07:00
Bo Anderson
d1cebef8c5
dev-cmd/pr-*: remove Oxford commas previously missed by linter 2024-03-10 22:31:44 +00:00
Mike McQuaid
ea2892f8ee
brew.rb: handle missing args. 2024-03-07 16:20:20 +00:00
Bo Anderson
1d7101d8a3
Use HOMEBREW_TEMP more universally 2024-02-26 16:58:53 +00:00
Issy Long
f4218a6316
Fix RuboCop Performance/MapCompact offenses
- Rename an iterator variable since it would make the line too long.
2024-02-25 22:59:59 +00:00
Mike McQuaid
8c2dcbac3d
Merge pull request #16530 from trail-of-forks/joesweeney/provenance-on-publish
Add option to retain tmpdir on pr-pull
2024-01-26 14:02:12 +00:00
Joseph Sweeney
b261dc7798 Fix style 2024-01-25 11:50:19 -05:00
Joe Sweeney
a61cb1a4d0
Set GitHub workflow output correctly
Co-authored-by: Bo Anderson <mail@boanderson.me>
2024-01-25 11:45:20 -05:00
Joseph Sweeney
0b0d9a6066 Add option to retain tmpdir on pr-pull
This option will be used to generate build provenance in the
`publish-commit-bottles.yml` workflow in `Homebrew/homebrew-core`. It
adds a single flag that controls whether or not the temporary directory
where bottles are downloaded is retained.
2024-01-25 10:35:59 -05:00
Bo Anderson
5692c8ecbf
Fix style violations under newer RuboCop 2023-12-14 05:47:12 +00:00
Bo Anderson
b42256d286
Deprecate, disable & delete code for Homebrew 4.2.0 2023-12-07 23:42:13 +00:00
Mike McQuaid
b3c33d34ab
Various sharding fixes
- Load paths with no API when needed (e.g. for `brew edit`)
- Use no API mode for `brew log` as it's needed there
- Define sharding format for homebrew-cask and homebrew-core inside
  `Tap` methods
- Create new formulae/casks in location defined by these `Tap` methods
- Fix a bug in Formulary that made sharded formulae lookup less
  efficient (and possibly broke it for core and some API usage)
- Fix various other hardcoded Formula/Cask directory assumptions

Co-authored-by: Bo Anderson <mail@boanderson.me>
2023-08-04 16:43:13 +01:00
Bo Anderson
9235024131
dev-cmd/pr-pull: fix branch warning conditions 2023-07-22 22:41:51 +01:00
Bo Anderson
bb7aef85db
Migrate remaining no-api commands to new scoped system 2023-06-22 17:11:20 +01:00
Carlo Cabrera
d7870bb24d
Move artifact download code to separate file
This will help avoid mutually-recursive `require`s.
2023-05-17 23:48:58 +08:00
Carlo Cabrera
d372eb86ca
utils/github: remove unnecessary chdir call
The only existing caller already has the requested directory as the
workign directory, so this is currently not needed.
2023-05-17 21:11:15 +08:00
Carlo Cabrera
05337cbb79
Refactor GitHub artifact downloads out of dev-cmd/pr-pull
I plan to use these in `test-bot` to download built bottles from
previous CI runs.
2023-05-17 21:11:15 +08:00
Douglas Eichelberger
08af78a2a5 brew style --fix 2023-04-25 09:26:24 -07:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
Carlo Cabrera
2f37877858
git_repository: implement #to_s instead 2023-04-24 22:34:09 +08:00
Douglas Eichelberger
403f08db8b Remove delegation 2023-04-16 09:30:21 -07:00
Douglas Eichelberger
b90897e280 Create git_repo attr 2023-04-15 19:35:13 -07:00
Douglas Eichelberger
a6fbf5f1ac brew style --fix 2023-04-15 19:35:13 -07:00
Douglas Eichelberger
1ffb77f821 cleanup 2023-04-15 19:35:13 -07:00
Douglas Eichelberger
8307255ce8 Update call sites 2023-04-15 19:35:13 -07:00
Carlo Cabrera
08fb8e441f
dev-cmd/pr-pull: add debug output for merge base 2023-03-29 17:56:05 +08:00
Carlo Cabrera
1ed8b3db2f
dev-cmd/pr-pull: handle non-cherry-picked commits in #autosquash! 2023-03-29 17:13:07 +08:00
Carlo Cabrera
b26d92ca9a
🐛 fixes 2023-03-28 23:07:03 +08:00
Carlo Cabrera
f0272b0944
dev-cmd/pr-pu{ll,blish}: handle PRs with an autosquash label
- request `autosquash` from the publish job in `pr-publish` if the PR is
  labelled with `autosquash`
- show a warning in `pr-pull` if called without `--autosquash` on a PR
  with the autosquash label.
2023-03-28 22:20:05 +08:00
Carlo Cabrera
834e4c98fc
dev-cmd/pr-*: replace --no-autosquash with --autosquash
We will now no longer be squashing commits by default, so it makes sense
to default to doing nothing but still autosquash commits when requested
with `--autosquash`.
2023-03-28 21:51:01 +08:00
Issy Long
61dc026fcc
rubocop: Remove the final Naming/MethodParameterName exceptions: pr
- Core RuboCop didn't want this shortening upstreamed, but that's OK!
2023-03-24 00:29:42 +00:00
Carlo Cabrera
e5b9e97b92
Use git merge-base to determine original_commit 2023-03-20 00:55:20 +08:00
Carlo Cabrera
c669f1d625
pr-pull: add --no-cherry-pick flag
Needed for Homebrew/homebrew-core#125556. Without this, `pr-pull`
attempts to cherry-pick commits from the PR branch onto the PR branch,
and then gets upset that nothing happened.

See https://github.com/Homebrew/homebrew-core/actions/runs/4461335852/jobs/7835095294#step:10:40
2023-03-19 23:44:44 +08:00
Douglas Eichelberger
f4c9a96c70 Enable types in dev-cmd 2023-03-14 08:32:03 -07:00
EricFromCanada
dfc9906184
internal messaging fixes 2023-02-10 23:17:16 -05:00
Bo Anderson
04f6f53b58
dev-cmd/pr-pull: avoid expensive search API calls 2022-09-03 21:19:37 +01:00
Carlo Cabrera
a82974974c
Update Library/Homebrew/dev-cmd/pr-pull.rb
Co-authored-by: Bo Anderson <mail@boanderson.me>
2022-08-05 21:51:39 +08:00
Carlo Cabrera
61544369e4
pr-pull: fix PRs conflicting with themselves
https://github.com/Homebrew/homebrew-core/pull/106755#issuecomment-1206460655
2022-08-05 21:41:28 +08:00
Michka Popoff
3eacc0fb7c
pr-pull: fix check conflicts
The previous refactorings broke the conflict check.
Go back to the initially proposed syntax to fill the hashes/arrays,
which is more readable, and which works (the proc syntax does not seem to work for our purpose here)

Remove space before the error message, else only the first line of the output has 2 spaces
and this looks weird
2022-08-04 23:34:52 +02:00
Michka Popoff
756c2b2c52
github/pr-pull: fix/improve parameters
Fixes #13634
2022-08-03 14:13:50 +02:00
Carlo Cabrera
b2cf1822fa
Fix brew style 2022-08-02 22:53:29 +08:00
Carlo Cabrera
8a169364a8
pr-pull: fix typo
Error: tried to create Proc object without a block
    Do not report this issue until you've run `brew update` and tried again.
    /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/pr-pull.rb:372:in `proc'
    /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/pr-pull.rb:372:in `pr_check_conflicts'
    /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/pr-pull.rb:439:in `block in pr_pull'
    /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/pr-pull.rb:429:in `each'
    /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/pr-pull.rb:429:in `pr_pull'
    /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:93:in `<main>'
    Error: Process completed with exit code 1.

https://github.com/Homebrew/homebrew-core/runs/7634004090?check_suite_focus=true#step:10:15
2022-08-02 22:46:30 +08:00
Michka Popoff
374c3985d6
pr-pull: check for conflicts with long running builds
This change will prevent us having to run some long running builds
multiple times and to rely on luck to get things merged without conflicts.

The check takes less than 30 secondes on my local setup.
2022-08-01 23:34:06 +02:00
Mike McQuaid
2d5eab2e1c
brew style --fix 2022-06-30 08:56:21 +01:00
Mike McQuaid
1bb44979ee
Disable and delete code for 3.5.0
The next planned release will be 3.5.0 so let's fix things up for there.
2022-05-30 14:59:14 +01:00