Skip to content

Go Github Bypass Unexported #3030

Closed
Closed

Description

@nkreiger

bypassRateLimitCheck requestContext = iota

Is there a reason this is unexported? I'm experimenting with the go-github ratelimiter, and it seems like it doesn't even reach the RoundTrip function to properly sleep with BareDo because its first getting blocked by the Go Github Client Check, which I can't bypass because the context is unexported

Activity

  1. gmlewis commented on Dec 14, 2023

    @gmlewis
    Collaborator

    This was implemented in #1907.

    Can you give an example of how you would use it if it were exported?

    Alternatively, feel free to write up a PR showing your use case as a new unit test and we can take a look at it.

  2. nkreiger commented on Dec 14, 2023

    @nkreiger
    Author

    @gmlewis thanks for the qr, let me validate because it may have been the github changes 3 days ago switching the message

  3. gmlewis commented on Dec 14, 2023

    @gmlewis
    Collaborator

    OK, cool.

    Also, I should have mentioned that the original problem that was trying to be solved was #1899 which would be great if you could take a look at when you have a moment.

  4. nkreiger commented on Dec 14, 2023

    @nkreiger
    Author

    @gmlewis took a look -- I do think the problem remains with it not being exported.

    Based on review of the code, the github client will not make the extra call if the primary rate limit has been exceeded. Therefore, any RoundTrip rate limiting logic defined in the go-github rate limiter, or any other custom client, will NOT be reached.

    It would be awesome to expose this, I'm happy too.

    LMK what you think

    // checkRateLimitBeforeDo does not make any network calls, but uses existing knowledge from

    I do not have the scope to confirm this locally FYI

  5. gmlewis commented on Dec 14, 2023

    @gmlewis
    Collaborator

    So the gist you pointed me to appears to be extremely old and doesn't even contain checkSecondaryRateLimitBeforeDo.
    There also appears to be no difference to checkRateLimitBeforeDo, so I'm not sure what I'm looking at.

    If you want to make a PR based on the current top-of-trunk, that would be fine, and it should be much easier to compare.

  6. gmlewis commented on Mar 17, 2025

    @gmlewis
    Collaborator

    Closing due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions