chore(integrations): Add canonical way to determine the external id for a repo#112327
chore(integrations): Add canonical way to determine the external id for a repo#112327
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
59f330b to
f466517
Compare
02bee7a to
b6936f6
Compare
This comment was marked as outdated.
This comment was marked as outdated.
…or a repo This is prep work for a pr to genericise the automatic repo syncing pr. To make it easy to genericise, I needed a way to easily get the external id for a repo from the client. As part of adding this, I ran into a bunch of type errors, so this pr also improves typing in this area.
b6936f6 to
8799c00
Compare
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 64fc2df. Configure here.
|
I think it would be useful to have When working on SCM onboarding I needed to match a repo from OrganizationIntegrationReposEndpoint to a repo from OrganizationRepositoriesEndpoint, and there wasn't an obvious shared key between the two responses. externalId (already returned by RepositorySerializer) would solve that. Ended up using IntegrationRepository.identifier === Repository.name, which works, but the relationship isn't obvious. |
Ok, I can return that, I'll add it as a follow up |
| default_branch: NotRequired[str | None] # GitHub, GitHub Enterprise | ||
| project: NotRequired[str] # Bitbucket Server | ||
| repo: NotRequired[str] # Bitbucket Server |
There was a problem hiding this comment.
it's no longer common with these here now right 😬
There was a problem hiding this comment.
Wondering if we should have a extended version of this type with a discriminate field, so github and ghe get the default_branch and then bitbucket server gets project and repo
There was a problem hiding this comment.
Yeah, this is just what we already pass around... I might merge it as is and try to improve it in follow ups, because this stuff is hairy in general
…eposEndpoint As requested in #112327 (comment)
…eposEndpoint (#112529) As requested in #112327 (comment) <!-- Describe your PR here. -->

This is prep work for a pr to genericise the automatic repo syncing pr. To make it easy to genericise, I needed a way to easily get the external id for a repo from the client. As part of adding this, I ran into a bunch of type errors, so this pr also improves typing in this area.