Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

feat/dotcom: UI tracks Cody Gateway access directly in Enterprise Portal#64090

Merged
bobheadxi merged 6 commits into
mainfrom
07-25-feat_dotcom_track_cody_gateway_access_directly_in_enterprise_portal
Aug 8, 2024
Merged

feat/dotcom: UI tracks Cody Gateway access directly in Enterprise Portal#64090
bobheadxi merged 6 commits into
mainfrom
07-25-feat_dotcom_track_cody_gateway_access_directly_in_enterprise_portal

Conversation

@bobheadxi

@bobheadxi bobheadxi commented Jul 25, 2024

Copy link
Copy Markdown
Member

Upgrades the self-contained Cody Gateway modal to only depend on Enterprise Portal to read/write Cody Gateway access.

I also made some minor tweaks to parsing empty form inputs, and also made the "Cody Gateway access token" collapsed by default, with warnings to discourage its use (opted not to remove entirely since it may be useful for dev/debugging)

Depends on:

Closes https://linear.app/sourcegraph/issue/CORE-218

Test plan

sg start dotcom

Edit the Cody Gateway access stuff, toggling it up and down. Cross-reference with the enterprise_portal_cody_gateway_access table.

@bobheadxi bobheadxi force-pushed the 07-25-feat_dotcom_track_cody_gateway_access_directly_in_enterprise_portal branch 2 times, most recently from 45395be to 6bf19f4 Compare July 26, 2024 18:34
@bobheadxi bobheadxi marked this pull request as ready for review July 26, 2024 18:50
@bobheadxi bobheadxi requested review from a team and eseliger July 26, 2024 18:51
@bobheadxi bobheadxi force-pushed the 07-18-feat_enterpriseportal_implement_updatecodygatewayaccess branch from 30e0562 to c594289 Compare July 26, 2024 19:47
@bobheadxi bobheadxi force-pushed the 07-25-feat_dotcom_track_cody_gateway_access_directly_in_enterprise_portal branch from 6bf19f4 to b99c974 Compare July 26, 2024 19:47
@bobheadxi bobheadxi force-pushed the 07-18-feat_enterpriseportal_implement_updatecodygatewayaccess branch from c594289 to db3cc38 Compare July 26, 2024 20:40
@bobheadxi bobheadxi force-pushed the 07-25-feat_dotcom_track_cody_gateway_access_directly_in_enterprise_portal branch from b99c974 to 00e169c Compare July 26, 2024 20:40
@bobheadxi bobheadxi force-pushed the 07-18-feat_enterpriseportal_implement_updatecodygatewayaccess branch from db3cc38 to 38850a6 Compare July 26, 2024 21:30
@bobheadxi bobheadxi force-pushed the 07-25-feat_dotcom_track_cody_gateway_access_directly_in_enterprise_portal branch from 00e169c to c5eda5f Compare July 26, 2024 21:31

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is this collapsed by default, or open by default? I think it should be collapsed :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it's collapsed by default from my testing!

@bobheadxi bobheadxi changed the title feat/dotcom: track Cody Gateway access directly in Enterprise Portal feat/dotcom: UI tracks Cody Gateway access directly in Enterprise Portal Jul 30, 2024
@bobheadxi bobheadxi force-pushed the 07-18-feat_enterpriseportal_implement_updatecodygatewayaccess branch from 38850a6 to 5a3ef94 Compare July 30, 2024 18:32
@bobheadxi bobheadxi force-pushed the 07-18-feat_enterpriseportal_implement_updatecodygatewayaccess branch from 0e7192d to 8e39464 Compare August 8, 2024 17:03
@bobheadxi bobheadxi force-pushed the 07-25-feat_dotcom_track_cody_gateway_access_directly_in_enterprise_portal branch 2 times, most recently from cbfae5f to 33055f4 Compare August 8, 2024 17:09
@bobheadxi bobheadxi force-pushed the 07-18-feat_enterpriseportal_implement_updatecodygatewayaccess branch from 4a2c055 to be61fc6 Compare August 8, 2024 17:24
@bobheadxi bobheadxi force-pushed the 07-25-feat_dotcom_track_cody_gateway_access_directly_in_enterprise_portal branch from 33055f4 to f2dd52c Compare August 8, 2024 17:24
@bobheadxi bobheadxi force-pushed the 07-18-feat_enterpriseportal_implement_updatecodygatewayaccess branch from be61fc6 to 6251655 Compare August 8, 2024 17:39
@bobheadxi bobheadxi force-pushed the 07-25-feat_dotcom_track_cody_gateway_access_directly_in_enterprise_portal branch from f2dd52c to 37536df Compare August 8, 2024 17:39
Base automatically changed from 07-18-feat_enterpriseportal_implement_updatecodygatewayaccess to main August 8, 2024 20:21
@bobheadxi bobheadxi force-pushed the 07-25-feat_dotcom_track_cody_gateway_access_directly_in_enterprise_portal branch 2 times, most recently from a5c0a69 to 3f90dcf Compare August 8, 2024 21:35
@bobheadxi bobheadxi changed the base branch from main to 08-08-fix_enterpriseportal_codyaccess_allow_removing_rate_limit_overrides August 8, 2024 21:36
@bobheadxi bobheadxi force-pushed the 07-25-feat_dotcom_track_cody_gateway_access_directly_in_enterprise_portal branch from 51db89e to 3f90dcf Compare August 8, 2024 22:10
bobheadxi referenced this pull request Aug 8, 2024
…64376)

On double-checking the various Cody Gateway access management CRUD I
noticed that I did not implement the ability to remove the override
entirely properly - right now, removing a rate limit with `field_mask`
and no values results in a zero-value rate limit rather than a null one
as desired.

This change makes it so that if you provider a nil `*_rate_limit`
object, all field paths for that object is also set to nil, removing the
override and allowing the default active-license-plan-based rate limits
to apply.

This also adds a minor adjustment to Cody Gateway to correctly handle
zero durations for rate limit intervals, which should be treated as "no
access".

## Test plan

Unit/integration tests, and a manual test:

- Check out https://github.com/sourcegraph/sourcegraph/pull/64090 and
run `sg start dotcom`
- Go to a subscription, add a rate limit override 

![image](https://github.com/user-attachments/assets/9f417a60-5096-4f6e-8eea-1f0720cb4ada)
- Click the 🗑️ button to remove the rate limit override 

![image](https://github.com/user-attachments/assets/d53f4ae9-43d9-4bb2-a33b-7632f74ea2c8)
- Repeat above on each property
Base automatically changed from 08-08-fix_enterpriseportal_codyaccess_allow_removing_rate_limit_overrides to main August 8, 2024 22:20
@bobheadxi bobheadxi force-pushed the 07-25-feat_dotcom_track_cody_gateway_access_directly_in_enterprise_portal branch from 3f90dcf to f11ce1a Compare August 8, 2024 22:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants