Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move provider definition to individual requests #1261

Merged
merged 1 commit into from
Jan 5, 2024
Merged

Conversation

st0012
Copy link
Member

@st0012 st0012 commented Dec 18, 2023

Motivation

While working on #1247, I found that we try to access some request's constants directly from the executor for building the providers. I think this is a leaky abstraction and requests should simply have a provider method to return the associated options or provider.

Implementation

  1. Define a Request.provider method on request classes that need a provider
  2. Simply call the method from the executor

Automated Tests

Manual Tests

@st0012 st0012 added the chore Chore task label Dec 18, 2023
@st0012 st0012 self-assigned this Dec 18, 2023
@st0012 st0012 requested a review from a team as a code owner December 18, 2023 18:36
@st0012 st0012 requested review from Morriar and vinistock December 18, 2023 18:36
@Morriar Morriar added bugfix This PR will fix an existing bug and removed bugfix This PR will fix an existing bug labels Dec 19, 2023
Copy link
Contributor

@andyw8 andyw8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't 🎩 but I like the improvement.

Some provider definitions require the request's data like constants. Instead
of exposing all those to the executor, it's better to define the providers
inside the request classes.
@st0012 st0012 force-pushed the extract-provider-logic branch from 6a4bded to 5c9d9bd Compare January 4, 2024 13:40
Copy link
Member

@vinistock vinistock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@st0012 st0012 merged commit eb0e725 into main Jan 5, 2024
30 of 36 checks passed
@st0012 st0012 deleted the extract-provider-logic branch January 5, 2024 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Chore task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants