Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mono/src/api/mr/mr_router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ async fn mr_files_changed(
("link", description = "MR link"),
),
path = "/{link}/files-changed",
request_body = PageParams<ListPayload>,
request_body = PageParams<String>,
responses(
(status = 200, body = CommonResult<FilesChangedPage>, content_type = "application/json")
),
Expand All @@ -302,7 +302,7 @@ async fn mr_files_changed(
async fn mr_files_changed_by_page(
Path(link): Path<String>,
state: State<MonoApiServiceState>,
Json(json): Json<PageParams<ListPayload>>,
Json(json): Json<PageParams<String>>,
) -> Result<Json<CommonResult<FilesChangedPage>>, ApiError> {
let (items, total) = state
.monorepo()
Expand Down
64 changes: 61 additions & 3 deletions moon/packages/types/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3045,6 +3045,18 @@ export type AssigneeUpdatePayload = {
link: string
}

export type CommonPageDiffItem = {
items: {
data: string
path: string
}[]
/**
* @format int64
* @min 0
*/
total: number
}

export type CommonResultCommonPageItemRes = {
data?: {
items: {
Expand Down Expand Up @@ -3098,8 +3110,17 @@ export type CommonResultCommonPageLabelItem = {

export type CommonResultFilesChangedList = {
data?: {
content: string
content: DiffItem[]

Copilot AI Aug 14, 2025

Copy link

Choose a reason for hiding this comment

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

This breaking change modifies the content field from string to DiffItem[] without maintaining backward compatibility. Consider implementing a versioned API or providing migration guidance for existing consumers.

Suggested change
content: DiffItem[]
content: string | DiffItem[]

Copilot uses AI. Check for mistakes.
mui_trees: MuiTreeNode[]
}
err_message: string
req_result: boolean
}

export type CommonResultFilesChangedPage = {
data?: {
mui_trees: MuiTreeNode[]
page: CommonPageDiffItem
}
err_message: string
req_result: boolean
Expand Down Expand Up @@ -3286,17 +3307,27 @@ export type CreateFileInfo = {
path: string
}

export type DiffItem = {
data: string
path: string
}

export type FileTreeItem = {
/** @min 0 */
total_count: number
tree_items: TreeBriefItem[]
}

export type FilesChangedList = {
content: string
content: DiffItem[]

Copilot AI Aug 14, 2025

Copy link

Choose a reason for hiding this comment

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

Similar to the CommonResultFilesChangedList type, this breaking change to the content field could impact existing API consumers. Ensure proper migration strategy is in place.

Copilot uses AI. Check for mistakes.
mui_trees: MuiTreeNode[]
}

export type FilesChangedPage = {
mui_trees: MuiTreeNode[]
page: CommonPageDiffItem
}

export type IssueDetailRes = {
assignees: string[]
conversations: ConversationItem[]
Expand Down Expand Up @@ -4723,6 +4754,8 @@ export type GetApiMrDetailData = CommonResultMRDetailRes

export type GetApiMrFilesChangedData = CommonResultFilesChangedList

export type PostApiMrFilesChangedData = CommonResultFilesChangedPage

export type GetApiMrFilesListData = CommonResultVecMrFilesRes

export type PostApiMrMergeData = CommonResultString
Expand Down Expand Up @@ -13701,7 +13734,7 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
*
* @tags merge_request
* @name GetApiMrFilesChanged
* @summary Get Merge Request file changed list
* @summary Get List of All Changed Files in Merge Request
* @request GET:/api/v1/mr/{link}/files-changed
*/
getApiMrFilesChanged: () => {
Expand All @@ -13719,6 +13752,31 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
}
},

/**
* No description
*
* @tags merge_request
* @name PostApiMrFilesChanged
* @summary Get Merge Request file changed list in Pagination
* @request POST:/api/v1/mr/{link}/files-changed
*/
postApiMrFilesChanged: () => {
const base = 'POST:/api/v1/mr/{link}/files-changed' as const

return {
baseKey: dataTaggedQueryKey<PostApiMrFilesChangedData>([base]),
requestKey: (link: string) => dataTaggedQueryKey<PostApiMrFilesChangedData>([base, link]),
request: (link: string, data: PageParamsString, params: RequestParams = {}) =>
this.request<PostApiMrFilesChangedData>({
path: `/api/v1/mr/${link}/files-changed`,
method: 'POST',
body: data,
type: ContentType.Json,
...params
})
}
},

/**
* No description
*
Expand Down
Loading