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

Conversation

@bahrmichael
Copy link
Contributor

@bahrmichael bahrmichael commented Jul 26, 2024

Closes SRCH-790

Screen.Recording.2024-07-26.at.15.24.55.mov

"+ Add installation" is broken because of SRCH-705

Test plan

Manual testing

Changelog

@cla-bot cla-bot bot added the cla-signed label Jul 26, 2024
@bahrmichael bahrmichael requested review from a team and BolajiOlajide July 29, 2024 08:02
@camdencheek
Copy link
Member

@bahrmichael is it intentional this is still draft? Is it ready for review?

@bahrmichael
Copy link
Contributor Author

@bahrmichael is it intentional this is still draft? Is it ready for review?

I set it as a draft because it felt like a prototype that I wanted to get some early feedback on. It works well enough though, so we can just push it out if there are no objections.

@bahrmichael bahrmichael marked this pull request as ready for review July 29, 2024 15:03
metadata: 'read',
}

export const UserGitHubAppsArea: FC<Props> = props => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should allow creation of GitHub apps in here, why?
Because the GitHub app will be orphaned and not tied to any Sourcegraph services.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's reasonable, and since we have text there indicating that github apps are for batch changes, they should find their way to the batch changes settings. I updated the code to hide the button if we're not in the siteAdmin context.

@camdencheek
Copy link
Member

camdencheek commented Jul 31, 2024

In the video, under the Batch Changes settings page, should the copy under "Code host credentials" be changed so it no longer refers to "access tokens" specifically (now that a user can authenticate with github app)?

Also, should we guide users towards github apps there? There doesn't seem to be any way to discover that they can use a github app (configured on a different page) to fulfil the credentials requirement

try {
const req = await fetch(`/githubapp/state?id=${app?.id}&domain=${app?.domain}`)
const req = await fetch(
`/githubapp/state?id=${app?.id}&domain=${app?.domain}&kind=${GitHubAppKind.USER_CREDENTIAL}`
Copy link
Member

Choose a reason for hiding this comment

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

Q: why did this change? Does adding the kind here still work for site admin setup?

}

export const GitHubAppsPage: React.FC<Props> = ({ batchChangesEnabled, telemetryRecorder }) => {
export const GitHubAppsPage: React.FC<Props> = ({ batchChangesEnabled, telemetryRecorder, isSiteAdmin }) => {
Copy link
Member

Choose a reason for hiding this comment

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

nit: non-blocking, but given the amount of branching here, it kinda feels like this should just be a separate component

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I disagree. The flag isSiteAdmin is used a couple times, but only in ternary statements. I find it still easy to read and understand how we're switching things around. If you feel strongly about this, I'm happy to change it.

Comment on lines 77 to 80
<>
Personal GitHub Apps are currently only used for Batch Changes, but this feature is not
enabled on your instance.
</>
Copy link
Member

Choose a reason for hiding this comment

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

If batch changes is not enabled, should we just hide the personal github apps page entirely?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This already happens via a condition in routes.tsx. I added this text here in case the other condition breaks, and we accidentally render this page. Customers shouldn't see it, but I thought it'd be nicer to display a helpful message if that assumption breaks.

AppID: int(id64),
Domain: domain,
BaseURL: baseURL,
Kind: kind,
Copy link
Member

Choose a reason for hiding this comment

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

Were we accidentally omitting kind before?

@bahrmichael
Copy link
Contributor Author

bahrmichael commented Aug 1, 2024

This PR is on hold until we fix SRCH-802 Done

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

4 participants