Closed mach6 closed 3 years ago
This needs some testing on our side, since we have been compiling drone-tree-config
directly into our drone fork.
I hope to get this done during the next weeks.
Sounds good.
FYI, I do something similar. I compile my fork of drone-tree-config into a private drone config extension. I have had this change running for about a month now on a reasonably large deployment with several allow listed monoliths. Thus far, I have not encountered any issues.
That said, I’m happy to wait until y’all vet it too..
I appreciate you letting me know!
Changed the github_client.NewGitHubClient implementation such that it re-uses the same github.Client for all requests.
There is no need to recreate a new delegate for every request. The internal go-github library calls NewRequest using the delegate receiver for all calls. Furthermore, the same credentials (token) and sever (endpoint) are used for all github requests throughout this project.
--
Also, in this change set -- Updated
github_client_test
and mainplugin_test
code to use a fixedtestMux
across all tests in the same file. This change ensures "the contract" -- a singleserver
andtoken
will be configured -- is also true for the tests.Notable limitation: Per this implementation, "the contract" is not enforced or checked within
github_client.go
.. Calling code such asplugin.go
needs to comply by never passing a differentserver
ortoken
-- which now that I've updated the tests, is the case everywhere in this project. I'm happy to add a check to detect a change to theserver
ortoken
which is passed, if there is a favorable view for it.