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

batches: add entry point to GH App commit signing from repo GH Apps page#52430

Merged
courier-new merged 2 commits into
batches/commit-signingfrom
kr/link-to-bc-settings-from-gh-apps
May 26, 2023
Merged

batches: add entry point to GH App commit signing from repo GH Apps page#52430
courier-new merged 2 commits into
batches/commit-signingfrom
kr/link-to-bc-settings-from-gh-apps

Conversation

@courier-new

Copy link
Copy Markdown
Contributor

Closes https://github.com/sourcegraph/sourcegraph/issues/52342.

Based on the discussion and resolution over Slack, we don't want the Batch Changes GitHub App to live on the main GH Apps page since their purposes and connection flow differ in most regards. However, it might still be natural for admins to expect to find a Batch Changes GH App on this page, or to wind up here by mistake when trying to set up a GH App for commit signing.

As such, this PR adds a note and link to the Batch Changes settings page in the page header description, to serve as a secondary entry point into the future GH App commit signing flow.

image

When the Batch Changes feature is disabled on an instance, this additional text will not be present.

Obviously, there's nothing on the Batch Changes settings page for this yet; this PR is just for adding the link.

Test plan

Manual testing:

  • With batchChangesEnabled: false, verified the description appeared as-is.
  • With batchChangesEnabled: true, verified the updated description appeared and the link routed me to the BC site admin settings page.

@courier-new courier-new added batch-changes Issues related to Batch Changes batches-signed-commit labels May 25, 2023
@courier-new courier-new requested a review from a team May 25, 2023 03:05
@courier-new courier-new self-assigned this May 25, 2023
@cla-bot cla-bot Bot added the cla-signed label May 25, 2023
@courier-new courier-new changed the title batches: batches: add entry point to GH App commit signing from repo GH Apps page May 25, 2023
Comment on lines +49 to +52
headingElement="h2"
path={[{ text: 'GitHub Apps' }]}
className={classNames(styles.pageHeader, 'mb-3')}
description={

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I took the liberty of updating the layout here slightly to bring this page closer in line with the other site admin pages immediately adjacent to it. We're still awfully inconsistent in this regard across site admin pages, but at least now all the pages in this sub-section of site admin will look about the same. 😅

@sourcegraph-buildkite

Copy link
Copy Markdown
Collaborator

Bundle size report 📦

Initial size Total size Async size Modules
0.00% (0.00 kb) 0.00% (+0.38 kb) 0.00% (+0.38 kb) 0.00% (0)

Look at the Statoscope report for a full comparison between the commits 80514d0 and 60d130d or learn more.

Open explanation
  • Initial size is the size of the initial bundle (the one that is loaded when you open the page)
  • Total size is the size of the initial bundle + all the async loaded chunks
  • Async size is the size of all the async loaded chunks
  • Modules is the number of modules in the initial bundle

@sourcegraph-bot

Copy link
Copy Markdown
Contributor

📖 Storybook live preview

@st0nebreaker st0nebreaker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, thank you! Just a few minor comments below

@@ -0,0 +1,5 @@
.page-header {
display: grid;
grid-template-columns: 1fr auto;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cool - I don't this style used a lot in the wild 🌲 !

Comment on lines +59 to +63
<>
{' '}
To create a GitHub App to sign Batch Changes commits, visit{' '}
<Link to="/site-admin/batch-changes">Batch Changes settings</Link>.
</>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: This might be a bit hidden from the user because it's enmeshed with the former text; maybe it should be a new line to make the text more clear? But maybe we want it more hidden anyway? 😅

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Haha no that's a good question! I actually did put a break between them at first, but then just visually it looks kinda... off-balanced? And it suddenly becomes unclear where the "Create" button should go, because it only relates to the former line of text, which would make me want to align it to the top, but it also results in another entry on the list below, which would make me want to align it to the bottom... the disagreement over which makes me kinda just want to stick it in the middle?? Basically the description area just isn't set up well for two distinct text sections when there's also a CTA button up there. 😞 So I'm kinda tempted to just leave it all together, even at the risk of it being too subtle. 👀

image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

but it also results in another entry on the list below, which would make me want to align it to the bottom
Do you mean the 2nd line of text? I think top alignment would look okay, if I'm following right. But I don't have too strong an opinion here; keeping it more compact looks good to me too.

return (
<Routes>
<Route index={true} element={<GitHubAppsPage />} />
<Route index={true} element={<GitHubAppsPage batchChangesEnabled={props.batchChangesEnabled} />} />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we have the batchChangesEnabled flag off automatically for licensed users? I'm wondering if this field would be better determined from the license in case admin users forget about the batch changes feature. What do you think? In #52113 I've been exploring our batches licensing a lot so this flags it 😆

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hehe I'm thinking I want to come back to this when we do some clean up and pick up https://github.com/sourcegraph/sourcegraph/issues/52207. 😉 For now I just wanted to match the behavior to how we determine to show the "Batch Changes" section of site admin settings, and for now that's purely derived based on this antiquated-- ahem... I mean, legacy property... 😅

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fair enough! 😁

@courier-new courier-new merged commit 7729ffd into batches/commit-signing May 26, 2023
@courier-new courier-new deleted the kr/link-to-bc-settings-from-gh-apps branch May 26, 2023 03:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

batch-changes Issues related to Batch Changes cla-signed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants