-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
batches: display rollout windows configuration in user settings #50479
batches: display rollout windows configuration in user settings #50479
Conversation
Codenotify: Notifying subscribers in CODENOTIFY files for diff 5072054...60071fa.
|
Bundle size report 📦
Look at the Statoscope report for a full comparison between the commits 60071fa and 5072054 or learn more. Open explanation
|
ec3ee2c
to
7173dd9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love the design you came up with for this! 😄 Left several comments but they're all pretty minor so here's a ✅ to go along with them.
client/web/src/enterprise/batches/settings/BatchChangesSettingsArea.story.tsx
Outdated
Show resolved
Hide resolved
client/web/src/enterprise/batches/settings/BatchChangesSettingsArea.tsx
Outdated
Show resolved
Hide resolved
client/web/src/enterprise/batches/settings/BatchChangesSettingsArea.tsx
Outdated
Show resolved
Hide resolved
client/web/src/enterprise/batches/settings/BatchChangesSettingsArea.tsx
Outdated
Show resolved
Hide resolved
client/web/src/enterprise/batches/settings/BatchChangesSettingsArea.tsx
Outdated
Show resolved
Hide resolved
client/web/src/enterprise/batches/settings/BatchChangesSettingsArea.tsx
Outdated
Show resolved
Hide resolved
c8222f8
to
0585d61
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great; the refactor to use the site query makes a lot of sense to me, too. Left a couple nits, but really great work here! 🙌
Once this is merged, can we safely revert https://github.com/sourcegraph/sourcegraph/pull/50471, too?
<UserCodeHostConnections | ||
headerLine={<Text>Add access tokens to enable Batch Changes changeset creation on your code hosts.</Text>} | ||
userID={props.user.id} | ||
/> | ||
</div> | ||
) | ||
|
||
// Displays the rollout window configuration. | ||
export const RolloutWindowsConfiguration: React.FunctionComponent = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Could we give this its own file, like we do with UserCodeHostConnections
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing.
client/web/src/enterprise/batches/settings/BatchChangesSettingsArea.tsx
Outdated
Show resolved
Hide resolved
client/web/src/enterprise/batches/settings/BatchChangesSettingsArea.story.tsx
Outdated
Show resolved
Hide resolved
* Formats the days of the week for a rollout window for display. | ||
* | ||
* If days are provided, joins them with commas and capitalizes each day name. | ||
* Otherwise returns 'every other day' as the default. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry if this is glaringly obvious, but why is "every other day" the default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh no, it's okay; the statement is technically wrong. I'll reword it.
* If days are provided, join them with commas and capitalize each day's name.
* Otherwise, returns 'every other day'.
/** | ||
* Formats the rollout window rate for display. | ||
* | ||
* According to the schema, if the rate is a number then it can only be zero. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you tell, do we actually validate if you provide a number other than 0? I don't remember if I've tried. I wonder if it's worth actually assuming that we haven't validated that here (so only returning "None" if it's actually rate: 0
), and showing "invalid configuration" with the little warning indicator if we get a bad rate like rate: 7
or rate: 200/24 hours
.
This doesn't need to happen in this PR; we could log that as an enhancement. Just something that came to mind that could also be useful here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not yet. I have one more PR to remove the JSContext field for rollout configuration in the Bulk Actions dropdown view. |
5200636
to
52d727b
Compare
Co-authored-by: Kelli Rockwell <kelli@sourcegraph.com>
…sArea.tsx Co-authored-by: Kelli Rockwell <kelli@sourcegraph.com>
…#51560) Make the web application bundle independent from the `//client/web/src/integration` and `//client/shared/src/testing`. It significantly slows down the Percy changes I iterate on locally. Previously they were connected via multiple mock files and the shared `isHotReloadEnabled` variable. The variable is redundant now, and the mock files are correctly moved to the `web_tests` target out of `web_lib`.
Co-authored-by: Kelli Rockwell <kelli@sourcegraph.com>
713faa7
to
60071fa
Compare
When rollout windows are configured on a Sourcegraph instance, there's no way for non-site admins to know the window that has been configured. We are displaying this window (if configured), in the
Batch Changes
section of the UserSettings area.Test plan
Test 1
/users/<username>/settings/batch-changes
on a Sourcegraph instance without rollout windows configured.Test 2
/users/<username>/settings/batch-changes
on a Sourcegraph instance with rollout windows configured.App preview:
Check out the client app preview documentation to learn more.