batches: surface batch change rollout window in JSContext#50471
Conversation
f3185f4 to
7615738
Compare
|
Codenotify: Notifying subscribers in CODENOTIFY files for diff 185c154...d6a939b. No notifications. |
|
The global jscontext is already super bloated, does it have to be in there or could we request it dynamically if the user visits a page that requires it? |
I agree and I initially thought of requesting it via the GraphQL endpoint but I wasn't sure the tradeoff made sense. We'll basically be making the |
bb3fe6e to
b64230c
Compare
#48217 and #48963 require the `batchChangesRolloutWindows` configuration to be available in the frontend. This PR surfaces the value via the `jscontext` object preloaded when the UI starts. ## Test plan <!-- All pull requests REQUIRE a test plan: https://docs.sourcegraph.com/dev/background-information/testing_principles --> * Start up a Sourcegraph instance with `sg start batches` * If the rollout window is configured in the Site Config, then logging `window.context` should include the configured values in the `batchChangesRolloutWindows` field.  * If not, the value of `batchChangesRolloutWindows` will be null. 
#48217 and #48963 require the `batchChangesRolloutWindows` configuration to be available in the frontend. This PR surfaces the value via the `jscontext` object preloaded when the UI starts. ## Test plan <!-- All pull requests REQUIRE a test plan: https://docs.sourcegraph.com/dev/background-information/testing_principles --> * Start up a Sourcegraph instance with `sg start batches` * If the rollout window is configured in the Site Config, then logging `window.context` should include the configured values in the `batchChangesRolloutWindows` field.  * If not, the value of `batchChangesRolloutWindows` will be null. 
|
Super delayed feedback here, but just wanted to share, I think I'd also prefer this sort of thing to come from the GraphQL API rather than the JSContext object. I don't believe we've explicitly stated guidance on this sort of thing anywhere, and this definitely isn't true for everything that's in there today, but generally I consider the things we put in JSContext to be:
The fields like It's not a big deal to leave it here, just wanted to share my two cents since I realize this isn't a topic that's well documented (and I'll make a note to raise this as a topic in need of clearer guidance/explanation at frontend crew!!), but maybe it's worth filing an issue to refactor to a GraphQL query for a rainy day. Bonus points if we can update |
|
Agree with Kelli here on the reasoning :) |
As discussed, #51752 takes care of this and removes the rollout window configuration from JSContext. |
#48217 and #48963 require the
batchChangesRolloutWindowsconfiguration to be available in the frontend.This PR surfaces the value via the
jscontextobject preloaded when the UI starts.Test plan
Start up a Sourcegraph instance with
sg start batchesIf the rollout window is configured in the Site Config, then logging

window.contextshould include the configured values in thebatchChangesRolloutWindowsfield.If not, the value of

batchChangesRolloutWindowswill be null.