-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
chore(github): Add business+ plan check for multi org #91905
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
base: master
Are you sure you want to change the base?
Changes from 8 commits
e043866
7bd57c5
2ba5d3e
4e2d4cf
604bcab
5acabb2
bee5115
db11b20
e1a57cc
49e22aa
48b29d1
510aa8a
5ed8d97
156fb07
84a0414
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -887,6 +887,15 @@ def _get_eligible_multi_org_installations( | |
class GithubOrganizationSelection(PipelineView): | ||
def dispatch(self, request: HttpRequest, pipeline: Pipeline) -> HttpResponseBase: | ||
self.active_user_organization = determine_active_organization(request) | ||
has_business_plan = ( | ||
features.has( | ||
"organizations:integrations-scm-multi-org", | ||
organization=self.active_user_organization.organization, | ||
actor=request.user, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. qq: whats the purpose of passing user here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤔 I probably yoinked this from a previous feature flag checker, but looking further yeah we dont need to be passing the user/it wont be used. |
||
) | ||
if self.active_user_organization is not None | ||
else False | ||
) | ||
|
||
if self.active_user_organization is None or not features.has( | ||
"organizations:github-multi-org", | ||
|
@@ -912,7 +921,7 @@ def dispatch(self, request: HttpRequest, pipeline: Pipeline) -> HttpResponseBase | |
) | ||
|
||
if chosen_installation_id := request.GET.get("chosen_installation_id"): | ||
if chosen_installation_id == "-1": | ||
if chosen_installation_id == "-1" or not has_business_plan: | ||
return pipeline.next_step() | ||
|
||
# Verify that the given GH installation belongs to the person installing the pipeline | ||
|
@@ -936,7 +945,10 @@ def dispatch(self, request: HttpRequest, pipeline: Pipeline) -> HttpResponseBase | |
return self.render_react_view( | ||
request=request, | ||
pipeline_name="githubInstallationSelect", | ||
props={"installation_info": installation_info}, | ||
props={ | ||
"installation_info": installation_info, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if they don't have multi org, should we still be passing the full list of installations to the FE? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think we should also error if somebody tries to pass a chosen installation id that's not -1 and they don't have multi org There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the passing the full list comment, I think it's useful to keep in case we want to do the per gh org upsell in the dropdown in the UI. |
||
"has_business_plan": has_business_plan, | ||
}, | ||
) | ||
|
||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.