Skip to content
This repository was archived by the owner on Aug 22, 2022. It is now read-only.

Addition: GitLab Issues #175

Merged
merged 3 commits into from
Jun 23, 2018
Merged

Conversation

robinmalik
Copy link
Contributor

This branch is to support querying for GitLab issues with Get-GitLabIssue. If deemed ok I can look to expand this portion of the API further.

Tested with API version 3 and 4, against GitLab 10.7.3.

@it-praktyk
Copy link
Collaborator

@robinmalik, can you verify the SYNTAX section in the help file?

To update it you can run

Import-Module PlatyPS
Update-MarkdownHelp -Path .\docs

Additionally please check a code style rules what will be introduced after merging PR #172.

[ValidateSet('all','created-by-me','assigned-to-me','created_by_me','assigned_to_me')]
[Parameter(ParameterSetName='User')]
[Parameter(ParameterSetName='GroupID')]
[ValidateSet('created-by-me','assigned-to-me','created_by_me','assigned_to_me')]
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not a fan of values with dashes on underscores. IMHO, it should be AssingedToMe, CreatedByMe - they are more "PowerShell kosher".

Copy link
Owner

Choose a reason for hiding this comment

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

I agree with @it-praktyk on the case for validate set. Pascal Case is generally the preferred case for PowerShell.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I too prefer Pascal Case :) The reason I'd used this was because they matched the actual API values, saving for internal translation within the function (and tab completion is easy enough for the user but I appreciate it might not always be a user doing this!). Happy to change of course!

There is an issue though; Official docs say For versions before 11.0, use the now deprecated created-by-me or assigned-to-me scopes instead. and I can confirm this is the case for me with version 10.7.3: snake_case doesn't work (yet).

The function thus either needs to ascertain the GitLab version in order to know whether to use snake or kebab case (e.g. created-by-me or created_by_me), or we only support kebab case until v11 is released.

Thoughts?

Copy link
Owner

Choose a reason for hiding this comment

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

I think translating would be best. An example from New-GitLabUser.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Or a private function like GetAccessLevel.ps1.

@ngetchell
Copy link
Owner

Great stuff. Fix the validate set casing and consider this accepted!

@robinmalik
Copy link
Contributor Author

@it-praktyk - Update-MarkdownHelp -Path .\docs updated all 59 markdown files so I reverted that. @ngetchell thinks there has been a platyps schema update. Maybe best to do all the doc files together in a separate branch?

@ngetchell
Copy link
Owner

Only commit the docs you've worked on. I'll do the grunt work of updating the rest.

@it-praktyk
Copy link
Collaborator

A bug for PlatyPS reported PowerShell/platyPS#371

@it-praktyk
Copy link
Collaborator

@robinmalik, I've found (I just skimmed it) that in the Syntax section parameter sets are not described correctly (?) Can you check once again?

@ngetchell ngetchell merged commit ddf19bb into ngetchell:master Jun 23, 2018
@robinmalik robinmalik deleted the support-issues branch October 2, 2018 16:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants