batches: supportsCommitSigning field to BatchChangesCodeHosts#52473
Conversation
|
Codenotify: Notifying subscribers in CODENOTIFY files for diff 98bc90f...8dc039f.
|
Bundle size report 📦
Look at the Statoscope report for a full comparison between the commits 8dc039f and 60d130d or learn more. Open explanation
|
There was a problem hiding this comment.
Code looks fine, but I have a bit of feedback regarding intentions for adding this field! I admit on first read, I thought hasCommitSigning had to do with whether or not a code host had a GH App already configured for it for commit signing, but it's clear to me now from your PR description and changes that it's actually referring to whether or not a code host type can support commit signing today. With that in mind, two questions:
- Could we name the field
supportsCommitSigninginstead, to clear up what it refers to? - Do you mind just briefly walking me through how we intend to use this field on the frontend? I could make some guesses, and I may have some feedback based on those guesses, but I'd rather hear from you (or Bolaji) first. 🙂
|
Yes I can definitely rename it. I was aiming to match the
Sure thing - The train of thought is because we will allow a GH App for each GH instance, we'll show each code host connection, this keeps the same format as our code host tokens too for uniformity. The frontend will read if Later on, say if we support commit signing through SSH keys for GitLab/BitBucket, we can determine on the frontend node whether to show |
Co-authored-by: Kelli Rockwell <kelli@sourcegraph.com>
courier-new
left a comment
There was a problem hiding this comment.
Got it, thanks for that explanation. I was thinking about alternative ways to surface this information but ultimately I think I like the flexibility that this simple boolean property affords us for the future. To reiterate what I said in Slack in a more public forum, I like that this field is completely agnostic to the actual underlying method we use to sign commits. On top of that, I was thinking about how we'd practically pair this property on the frontend with some sort of joint query for the GH App, and I settled on this proposal for that, which I think pairs nicely with this property. 🙂 So 👍
| externalServiceURL | ||
| requiresSSH | ||
| requiresUsername | ||
| supportsCommitSigning |
There was a problem hiding this comment.
Thank you for validating the property appears in the network request as part of your test plan! For now, it might make more sense to drop it and only push the backend changes in this PR. Otherwise, the TS compiler starts to expect this property to be required everywhere we're mocking a code host (e.g. in storybook stories) and grows quite angry when it's not there. 😬 I don't want you to have to bloat this PR with all those mock data changes!
There was a problem hiding this comment.
Oh good call. Yea I'll leave that bloat for the FE consumption of this PR 😁 Removed ✅
hasCommitSigning field to BatchChangesCodeHostssupportsCommitSigning field to BatchChangesCodeHosts
…52473) Closes #[52465](https://github.com/sourcegraph/sourcegraph/issues/52465), setup for #[52220](https://github.com/sourcegraph/sourcegraph/issues/52220) Adds new `supportsCommitSigning ` field to the `BatchChangesCodeHosts` resolver. Only GitHub external services have commit signing for now. Later on we will support more code hosts. Even though different mechanisms will support the commit signing (ie SSH keys), that will be handled downstream. ## Test plan  - Nav to `/site-admin/batch-changes` - Ensure `/graphql?GlobalBatchChangesCodeHosts` returns the correct value for `supportsCommitSigning ` --------- Co-authored-by: Kelli Rockwell <kelli@sourcegraph.com>
Closes #52465, setup for #52220
Adds new
supportsCommitSigningfield to theBatchChangesCodeHostsresolver. Only GitHub external services have commit signing for now. Later on we will support more code hosts. Even though different mechanisms will support the commit signing (ie SSH keys), that will be handled downstream.Test plan
/site-admin/batch-changes/graphql?GlobalBatchChangesCodeHostsreturns the correct value forsupportsCommitSigning