Add low level api cookie passing
What does this MR do and why?
Adds low level cookie passing functionality in API calls that previously ignored the "gitlab_canary" cookie.
How to set up and validate locally
- Execute an end-to-end test that features an API call with the
QA_COOKIES
ENV variable set.CHROME_HEADLESS=false QA_COOKIES=gitlab_canary=true bundle exec bin/qa Test::Instance::All http://localhost:3000 qa/specs/features/browser_ui/3_create/merge_request/create_merge_request_spec.rb
- Open Chrome devtools and inspect the
Cookie
values in the header of the API call(s) - Alternatively, you could install a proxy such as
mitmproxy
to inspect traffic.brew install mitmproxy
These methods can be difficult to track and implement due to the speed of the tests. You may need to insert pauses within the test to more easily capture the network calls. Wireshark is another option that would capture even calls missed through devtools. The other alternative is to run the test locally using pry-byebug
and inserting breakpoints/stepping through the test and inspecting the values.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Closes #343654 (closed)
Edited by Zeff Morgan