Skip to content
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

MergeRequestSchema.detailed_merge_status is inconsistent with Gitlab API documentation #3681

Closed
2 tasks done
jack-liu-personio opened this issue Jan 31, 2025 · 1 comment
Closed
2 tasks done

Comments

@jack-liu-personio
Copy link

jack-liu-personio commented Jan 31, 2025

Description

  • Node.js version: N/A
  • Gitbeaker version: 42.1.0
  • Gitbeaker release (cli, rest, core, requester-utils): core
  • OS & version: N/A

The attribute detail_merge_status in MergeRequestSchema here is inconsistent with what's available in Gitlab's MergeRequest API documentation

Steps to reproduce

When using gitbreaker in code, the following switch statement will not work even though need_rebase is a legitimate response from gitlab API for the field detailed_merge_status.

const mergeRequestDetail: MergeRequestSchema = await gitlabClient.MergeRequests.show(projectId, mergeRequestIid);

switch (mergeRequestDetail.detailed_merge_status) {
    // ...
    case 'need_rebase':
        // rebase logic
    break;
    // ...
}

Expected behaviour

I expect to be able to use all available statuses in my code, for example, I should be able to write logic for the following case

switch (mergeRequestDetail.detailed_merge_status) {
    // ...
    case 'need_rebase':
        // rebase logic
    break;
    // ...
}

Actual behaviour

The following logic gives an error because need_rebase is not a literal in detailed_merge_status here

switch (mergeRequestDetail.detailed_merge_status) {
    // ...
    case 'need_rebase':
        // rebase logic
    break;
    // ...
}

See screenshot below

Image

Possible fixes

Add the missing status in the literal union here

Full list of available statuses here

Checklist

  • I have checked that this is not a duplicate issue.
  • I have read the documentation.
@jack-liu-personio
Copy link
Author

jack-liu-personio commented Feb 3, 2025

Didn't realize gitbeaker only cover up to 16.5. Closing as the doc referenced points to 17.9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant