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

fix(utils/github): failure with fine-granted api tokens #14584

Merged
merged 1 commit into from Feb 10, 2023

Conversation

anatawa12
Copy link
Contributor

@anatawa12 anatawa12 commented Feb 10, 2023

  • 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?

Fixes #14582

With fine-granted PATs, we cannot search both PRs and issues so I fix fetch_pull_requests to search only pullrequests.

I confirmed #14582 is fixed. brew bump-formula-pr anatawa12/core/vrc-get --url https://github.com/anatawa12/vrc-get/archive/0.1.7.tar.gz --no-fork --force works well in my env.

I think it's impossible to write tests without PATs. How should I write tests?


brew tests failires:

Failures:

  1) pkg-config returns the correct version for libcurl
     Failure/Error: expect(pc_version("libcurl")).to eq(version)

       expected: "7.85.0"
            got: "7.84.0"

       (compared using ==)
     # ./test/os/mac/pkgconfig_spec.rb:54:in `block (2 levels) in <top (required)>'
     # ./test/spec_helper.rb:232:in `block (3 levels) in <top (required)>'
     # ./test/spec_helper.rb:231:in `block (2 levels) in <top (required)>'
     # ./vendor/bundle/ruby/2.6.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:124:in `block in run'
     # ./vendor/bundle/ruby/2.6.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in `loop'
     # ./vendor/bundle/ruby/2.6.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in `run'
     # ./vendor/bundle/ruby/2.6.0/gems/rspec-retry-0.6.2/lib/rspec_ext/rspec_ext.rb:12:in `run_with_retry'
     # ./vendor/bundle/ruby/2.6.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:37:in `block (2 levels) in setup'

  2) pkg-config returns the correct version for sqlite3
     Failure/Error: expect(pc_version("sqlite3")).to eq(version)

       expected: "3.39.5"
            got: "3.39.4"

       (compared using ==)
     # ./test/os/mac/pkgconfig_spec.rb:116:in `block (2 levels) in <top (required)>'
     # ./test/spec_helper.rb:232:in `block (3 levels) in <top (required)>'
     # ./test/spec_helper.rb:231:in `block (2 levels) in <top (required)>'
     # ./vendor/bundle/ruby/2.6.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:124:in `block in run'
     # ./vendor/bundle/ruby/2.6.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in `loop'
     # ./vendor/bundle/ruby/2.6.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in `run'
     # ./vendor/bundle/ruby/2.6.0/gems/rspec-retry-0.6.2/lib/rspec_ext/rspec_ext.rb:12:in `run_with_retry'
     # ./vendor/bundle/ruby/2.6.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:37:in `block (2 levels) in setup'

Finished in 28.57 seconds (files took 2.11 seconds to load)
317 examples, 2 failures

Failed examples:

rspec ./test/os/mac/pkgconfig_spec.rb:48 # pkg-config returns the correct version for libcurl
rspec ./test/os/mac/pkgconfig_spec.rb:110 # pkg-config returns the correct version for sqlite3

@MikeMcQuaid
Copy link
Member

brew tests failires:

@Bo98 thoughts on making those pkg-config tests only run on CI?

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.

Thanks so much for your first contribution! Without people like you submitting PRs we couldn't run this project. You rock, @anatawa12!

@MikeMcQuaid MikeMcQuaid merged commit 43a887a into Homebrew:master Feb 10, 2023
@Bo98
Copy link
Member

Bo98 commented Feb 10, 2023

@Bo98 thoughts on making those pkg-config tests only run on CI?

The problem here is actually the lack of CI. We don't have macOS 13 CI, and won't for a few more months, so this never came up and no one else seems to have noticed.

I now know though so I'll fix it.

@MikeMcQuaid
Copy link
Member

@Bo98 hah, gotcha, thanks ❤️. I guess could maybe be a brew doctor CI-only check or something instead?

@Bo98
Copy link
Member

Bo98 commented Feb 10, 2023

It does make sense as something that is tied to recommended Xcode version bumps (which we do have a apparently-broken??? workflow for), yes. SDK updates are the times where these versions can change.

@MikeMcQuaid
Copy link
Member

@Bo98 yeh, feels most related to our CI machines (which we do have these tests for) rather than brew tests (where it's not obvious when it's OS-dependent)

@github-actions github-actions bot added the outdated PR was locked due to age label Mar 13, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 13, 2023
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
3 participants