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

Unify Label parameter names to singular form in New-/Set-JiraIssue #522

Merged

Conversation

hmmwhatsthisdo
Copy link
Contributor

@hmmwhatsthisdo hmmwhatsthisdo commented Sep 24, 2024

Description

This PR aligns the naming convention for label parameters between New-JiraIssue and Set-JiraIssue.

Motivation and Context

Resolves #521.

New-JiraIssue takes -Labels, whereas Set-JiraIssue takes -Label. This PR updates both to be -Label with -Labels as an alias for backwards compatibility.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • I have added Pester Tests that describe what my changes should do.
  • I have updated the documentation accordingly.

@hmmwhatsthisdo hmmwhatsthisdo requested a review from a team as a code owner September 24, 2024 23:48
Copy link
Member

@lipkau lipkau left a comment

Choose a reason for hiding this comment

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

Thank you for the PR.

My first impression is that -Labels (in plural) would be better, as one would expect a list.
Even the jql uses plural labels = api.

Do you agree?

@hmmwhatsthisdo
Copy link
Contributor Author

hmmwhatsthisdo commented Sep 25, 2024

Thank you for the PR.

My first impression is that -Labels (in plural) would be better, as one would expect a list. Even the jql uses plural labels = api.

Do you agree?

I went back and forth on this a bit. I agree that the Jira API uses the plural form and that, from the perspective of "we should match the behavior of the API", the plural form makes the most sense.

OTOH, PowerShell's development guidelines strongly recommend singular-noun parameter names, even for params that can take multivalued/array-type arguments. If you look at builtins like Add-LocalGroupMember, the -Member param also accepts multivalued data and is also the singular-noun form.

Looking at prior art within the module, -FixVersion is in a similar situation. The API uses fixVersions, whereas #103 added the singular noun -FixVersion with alias FixVersions.

I would posit that singular noun is best (as it's more closely aligned with best practices for the language) with [Alias()]es for the plural form in case users are expecting name alignment with the API.

@lipkau
Copy link
Member

lipkau commented Sep 25, 2024

Agreed.
Do you mind creating an issue so we keep in mind to clean this up/get it consistent in all cases at some point?

@lipkau lipkau merged commit 19476cc into AtlassianPS:release/2.15-alpha Sep 25, 2024
6 checks passed
@hmmwhatsthisdo
Copy link
Contributor Author

Agreed. Do you mind creating an issue so we keep in mind to clean this up/get it consistent in all cases at some point?

Done: #523

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 this pull request may close these issues.

2 participants