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

Create Issue Board List by Milestone #519

Closed
arsdehnel opened this issue Dec 26, 2019 · 9 comments · Fixed by #1768
Closed

Create Issue Board List by Milestone #519

arsdehnel opened this issue Dec 26, 2019 · 9 comments · Fixed by #1768

Comments

@arsdehnel
Copy link
Contributor

Description

I am trying to automate the management of some milestone-based GitLab boards and found a situation where I need to create a list based on the milestone_id and not the label_id but the current implementation: https://github.com/jdalrymple/gitbeaker/blob/master/src/core/templates/ResourceIssueBoards.ts#L26 doesn't allow me to leave off the label_id. The GitLab API won't allow both to be passed and I don't want both to be passed.

Steps to reproduce

Call GroupIssueBoards.createList( groupId, boardId, null, { milestoneId: 123 } )

Expected behaviour

I can specify just the milestone_id and it'll work. I have this working using raw got calls but that's not so ideal.

Actual behaviour

The GitLab API will throw an error saying label_id and milestone_id are mutually exclusive.

Possible fixes

I think probably the easiest solution is to move the label_id into the options object but worried that'll be hard for users of the library to know to change. Not sure of a better way to get that same functionality without causing some gross workaround stuff. I'm happy to work on the change, just wanting to get some ideas/feedback before I start on anything.

@jdalrymple
Copy link
Owner

I would change it to remove the label_id as a required argument, and just pass it in the options like you suggested. Then release it as a breaking change so users will not be caught off guard if their latest update doesnt work the same way. The change will be documented in the changelog :)

@jdalrymple jdalrymple added the Bug label Dec 30, 2019
@jdalrymple
Copy link
Owner

Was fixing this one up and noticed a small inconsistency. The group issue board docs do not mention milestoneId being a property? https://docs.gitlab.com/ee/api/group_boards.html#new-group-issue-board-list

@jdalrymple
Copy link
Owner

Can anyone verify this to make sure i'm not missing something?

@arsdehnel
Copy link
Contributor Author

You are not missing anything but the docs are. I don't have a reduced test case I can lay out but I have this:

const { body } = await got( `https://${ config.GITLAB_HOSTNAME }/api/v4/groups/${ groupName }/boards/${ boardId }/lists`, {
        method: 'POST',
        headers: {
            'Private-Token': config.GITLAB_API_TOKEN
        },
        responseType: 'json',
        json:  {
            milestone_id: milestoneId
        }
    } );

And it's working with the API to create a list inside my existing board that is defined by a milestone.

@jdalrymple
Copy link
Owner

Ill bring it up with Gitlab as well!

@jdalrymple
Copy link
Owner

Which version of Gitlab are you using?

@arsdehnel
Copy link
Contributor Author

That script runs weekly and last time it ran we were on 12.9. We're on 12.10 now and it'll run tomorrow night so I can confirm it still works there if needed.

@jdalrymple
Copy link
Owner

jdalrymple commented May 5, 2020

Perfect, ill connect the issues as well! Thank you !!

@jdalrymple jdalrymple modified the milestone: next Aug 9, 2020
@jdalrymple
Copy link
Owner

Still awaiting the response from Gitlab on the proper way forward.

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

Successfully merging a pull request may close this issue.

2 participants