-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
refactor(gitlab): ensure getPrList() runtime integrity #32291
base: main
Are you sure you want to change the base?
refactor(gitlab): ensure getPrList() runtime integrity #32291
Conversation
lib/modules/platform/gitlab/index.ts
Outdated
const updatedPr: Pr = massagePr({ | ||
number: updatedPrInfo.iid, | ||
state: updatedPrInfo.state === 'opened' ? 'open' : updatedPrInfo.state, | ||
title: updatedPrInfo.title, | ||
createdAt: updatedPrInfo.created_at, | ||
sourceBranch: updatedPrInfo.source_branch, | ||
}); |
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.
Similar code to this seems duplicated throughout this gitlab module. Can any of it be consolidated?
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.
lib/modules/platform/gitlab/index.ts
Outdated
await gitlabApi.putJson<{ | ||
iid: number; | ||
source_branch: string; | ||
title: string; | ||
state: string; | ||
created_at: string; | ||
}>(`projects/${config.repository}/merge_requests/${iid}`, { body }) |
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.
Create a type for that generic.
Can we use Zod here?
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.
Yes, I think this is necessary can we can start with Gitlab as the types are messy here. A task for another PR though as we need to also handle the other functions like createPr, getPrList, getPr, getBranchPr, and findPr.
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.
see open conversations
Blocked by: #32428 |
Changes
Update the runtime pr list when a pr is updated
Context
Ref: #32040
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via: