-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
feat(platform): Add support for JetBrains Space platform #29151
base: main
Are you sure you want to change the base?
Conversation
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.
Thanks for this PR! The most important point would be to adopt Zod for validating all responses from the Space API. Right now you are casting any
to typed values, which is risky for runtime faults. Instead we want to use Zod for all new code like this: https://github.com/renovatebot/renovate/blob/main/docs/development/zod.md
@@ -60,7 +60,7 @@ async function closedPrExists(config: RenovateConfig): Promise<Pr | null> { | |||
} | |||
|
|||
export async function isOnboarded(config: RenovateConfig): Promise<boolean> { | |||
logger.debug('isOnboarded()'); | |||
logger.debug(`isOnboarded(${JSON.stringify(config)})`); |
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.
Needs reverting
existingPrBodyHash, | ||
newPrBodyHash, |
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.
Is this actually helpful to the user? We don't intend for these hashes to be meaningful to anyone
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.
No, I added it when was debugging, removed
case 'Opened': | ||
return 'open'; | ||
case 'Closed': | ||
if (canBeReopened) { |
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.
Is this a kind of "hack" to determine whether a closed PR was merged or not? Would be good to document it so that others don't need to guess in future
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.
Added a comment explaining why need this flag
lib/modules/platform/space/index.ts
Outdated
logger.debug( | ||
`SPACE findPr(${JSON.stringify(findPRConfig)}, ${refreshCache})`, | ||
); |
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.
Just a general note that logging like this will need to be lowered or removed before merge
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.
Right, I'll clean up most of the debug logs, thanks
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.
Replaced most of logs with trace or simply removed, kept a couple that might be useful for general user debugging
@rarkins thank you for checking it out! Will read about ZOD and make required changes. |
I think |
type SpaceMergeRequestRecordPredicate, | ||
} from './code-review-read'; | ||
|
||
const spaceEndpointUrl = 'https://myorg.jetbrains.space'; |
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 think something like jetbrainsSpaceEndpointUrl
is easier to understand.
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.
@@ -26,6 +26,7 @@ const resolvers = { | |||
github, | |||
gitlab, | |||
local: null, | |||
space: local, // TODO: not sure what this means |
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.
space: local, // TODO: not sure what this means | |
space: local, |
loading presets from local platform
@@ -0,0 +1,169 @@ | |||
export interface SpacePaginatedResult {} |
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.
Use zod schema for types
https://github.com/renovatebot/renovate/blob/main/docs/development/zod.md#L1
@viceice that's very unfortunate lol, I chose the perfect time to start building this integration :) |
it's already in preview, so you can check it. |
The API feels mostly the same, looks like they removed chats, but some chat-related APIs are still there. |
I found some more info about the differences between the old Space and the upcoming SpaceCode. The Jetbrain docs, migrate from Space to SpaceCode, what will not stay in SpaceCode says:
I'll let the maintainers decide if it's worth it to support a now deprecated platform. |
Changes
Hi All,
I implemented integration with the JetBrains Space platform.
Features supported:
rebase!
to the title)Not everything is covered with tests yet, but, say, 70% of the new code. I would like to get some feedback on my code, please, before proceeding with the remaining tests. My background is in JVM world and, perhaps, some things were not implemented idiomatically.
Unfortunately, Space doesn't have public repositories, but I'm happy to give access for interested to my test environment.
Minimal config for testing would look like this:
Context
I was using Renovate for long time and wanted to contribute in some way, as well as to play with JetBrains Space.
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via: