Skip to content

Remove handle_comment collaborator check #211

@maleadt

Description

@maleadt

It should be up to the caller to enforce this, and it doesn't work generally anyway (requiring push permissions to the repo):

┌ Error: handle_connection handler error
│   exception =
│    Error found in GitHub reponse:
│    	Status Code: 403
│    	Message: Must have push access to view repository collaborators.
│    	Docs URL: https://docs.github.com/rest/collaborators/collaborators#check-if-a-user-is-a-repository-collaborator
│    	Errors:
│    Stacktrace:
│      [1] error(::String, ::String, ::String, ::String, ::String)
│        @ Base ./error.jl:44
│      [2] handle_response_error(r::HTTP.Messages.Response)
│        @ GitHub ~/Julia/depot/packages/GitHub/Ij6eH/src/utils/requests.jl:177
│      [3] iscollaborator(api::GitHub.GitHubWebAPI, repo::GitHub.Repo, user::String; options::Base.Pairs{Symbol, GitHub.OAuth2, Tuple{Symbol}, NamedTuple{(:auth,), Tuple{GitHub.OAuth2}}})
│        @ GitHub ~/Julia/depot/packages/GitHub/Ij6eH/src/repositories/repositories.jl:101
│      [4] #iscollaborator#93
│        @ ./none:0 [inlined]
│      [5] handle_comment(handle::Nanosoldier.var"#66#67"{Nanosoldier.Config, Vector{Nanosoldier.AbstractJob}}, event::GitHub.WebhookEvent, auth::GitHub.OAuth2, trigger::Regex, check_collab::Bool, use_access_token::Bool)
│        @ GitHub ~/Julia/depot/packages/GitHub/Ij6eH/src/activity/events.jl:186
│      [6] #260
│        @ ~/Julia/depot/packages/GitHub/Ij6eH/src/activity/events.jl:156 [inlined]
│      [7] handle_event_request(request::HTTP.Messages.Request, handle::GitHub.var"#260#262"{GitHub.OAuth2, Bool, Bool, Nanosoldier.var"#66#67"{Nanosoldier.Config, Vector{Nanosoldier.AbstractJob}}, Regex}; auth::GitHub.OAuth2, secret::String, events::Vector{String}, repos::Vector{String}, forwards::Nothing)
│        @ GitHub ~/Julia/depot/packages/GitHub/Ij6eH/src/activity/events.jl:112
│      [8] (::GitHub.var"#252#254"{GitHub.OAuth2, String, Vector{String}, GitHub.var"#260#262"{GitHub.OAuth2, Bool, Bool, Nanosoldier.var"#66#67"{Nanosoldier.Config, Vector{Nanosoldier.AbstractJob}}, Regex}})(request::HTTP.Messages.Request)
│        @ GitHub ~/Julia/depot/packages/GitHub/Ij6eH/src/activity/events.jl:79
│      [9] (::HTTP.Handlers.var"#1#2"{GitHub.var"#252#254"{GitHub.OAuth2, String, Vector{String}, GitHub.var"#260#262"{GitHub.OAuth2, Bool, Bool, Nanosoldier.var"#66#67"{Nanosoldier.Config, Vector{Nanosoldier.AbstractJob}}, Regex}}})(stream::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Connection})
│        @ HTTP.Handlers ~/Julia/depot/packages/HTTP/RQd4C/src/Handlers.jl:58
│     [10] #invokelatest#2
│        @ ./essentials.jl:729 [inlined]
│     [11] invokelatest
│        @ ./essentials.jl:726 [inlined]
│     [12] handle_connection(f::Function, c::HTTP.ConnectionPool.Connection, listener::HTTP.Servers.Listener{Nothing, Sockets.TCPServer}, readtimeout::Int64, access_log::Nothing)
│        @ HTTP.Servers ~/Julia/depot/packages/HTTP/RQd4C/src/Servers.jl:447
│     [13] (::HTTP.Servers.var"#16#17"{HTTP.Handlers.var"#1#2"{GitHub.var"#252#254"{GitHub.OAuth2, String, Vector{String}, GitHub.var"#260#262"{GitHub.OAuth2, Bool, Bool, Nanosoldier.var"#66#67"{Nanosoldier.Config, Vector{Nanosoldier.AbstractJob}}, Regex}}}, HTTP.Servers.Listener{Nothing, Sockets.TCPServer}, Set{HTTP.ConnectionPool.Connection}, Int64, Nothing, Base.Semaphore, HTTP.ConnectionPool.Connection})()
│        @ HTTP.Servers ./task.jl:484
└ @ HTTP.Servers ~/Julia/depot/packages/HTTP/RQd4C/src/Servers.jl:461

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