Skip to content

HTTPClient: #post_upload replaces #post_json; receives run_env#234

Merged
pda merged 1 commit intomainfrom
further-http-client-refactor
Feb 4, 2025
Merged

HTTPClient: #post_upload replaces #post_json; receives run_env#234
pda merged 1 commit intomainfrom
further-http-client-refactor

Conversation

@pda
Copy link
Member

@pda pda commented Feb 3, 2025

Further to #233, refactor HTTPClient#post_upload (previously called #post_json) to receive run_env as a keyword argument, instead of reaching out to Buildkite::TestCollector::CI.env (which is then dependent on environment variables etc and harder to test).

Buildkite::TestCollector::CI.env itself is tested separately, so we still have coverage across the generated run_env.

I'm extracting this refactor from another change which will add tagging support, to make that other change smaller.

Related:

@pda pda requested a review from a team as a code owner February 3, 2025 07:25
@pda pda changed the title HTTPClient: #post_upload replaced #post_json; takes run_env as kwarg HTTPClient: #post_upload replaces #post_json; receives run_env Feb 3, 2025
@pda pda force-pushed the further-http-client-refactor branch 2 times, most recently from ccdda0d to 3b37e5e Compare February 3, 2025 07:40
@pda pda force-pushed the minor-http-client-refactor branch from bea7372 to f285ee4 Compare February 4, 2025 00:26
Rather than HTTPClient#post_json reaching out to
`Buildkite::TestCollector::CI.env` (which is then dependent on
environment variables etc and harder to test), we can pass that
`run_env` into `#post_upload`.

This paves the way for also passing in `tags` alongside `run_env`.
@pda pda force-pushed the further-http-client-refactor branch from 3b37e5e to 52d0a02 Compare February 4, 2025 00:27
Base automatically changed from minor-http-client-refactor to main February 4, 2025 01:26
@pda pda merged commit 4122411 into main Feb 4, 2025
1 check passed
@pda pda deleted the further-http-client-refactor branch February 4, 2025 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants