You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This attempts to rectify some improper verb usage in the module based on the explanations of intended verb usage from [previous PowerShell documentation](https://web.archive.org/web/20171222220053/https://msdn.microsoft.com/en-us/library/windows/desktop/ms714428(v=vs.85).aspx).
* We're standardizing on the following pattern for most object actions:
`Get` / `Set` / `New` / `Remove`
* We will continue to alias `Remove-*` as `Delete-*`.
* When possible, this change attempts to avoid breaking changes by re-aliasing the newly named functions with their previous names. This was not possible in one instance, hence this is still a breaking change (although based on telemetry, it should be minimally impacting).
Result:
* `Update-GitHubCurrentUser` -> `Set-GitHubProfile` `[Alias('Update-GitHubCurrentUser')]`
* `Update-GitHubIssue` -> `Set-GitHubIssue` `[Alias('Update-GitHubIssue')]`
* `Update-GitHubRepository` -> `Set-GitHubRepository` `[Alias('Update-GitHubRepository')]`
* `New-GitHubAssignee` -> `Add-GitHubAssignee` `[Alias('New-GitHubAssignee')]`
* [breaking] `Update-GitHubLabel` -> `Set-GitHubLabel` `[Alias('Update-GitHubLabel')]`
* [breaking] `Set-GitHubLabel` -> `Initialize-GitHubLabel` `<no alias due to above>`
Changing an existing label has much more regular usage than replacing all of the labels in a repository, hence allowing the _new_ `Set-GitHubLabel` to keep the alias of `Update-GitHubLabel`.
Our usage of the `Set-*` verb in general is a bit arguable based on the documentation ... in theory `Edit-*` might be a better fit since we're _editing_ aspects of an object as opposed to _replacing_ the entire content of an object. However, I think `Set-*` _feels_ ok in this module. We're _setting_ the state of these objects. Again...arguable, but this is a much smaller breaking change to get to a consistent terminology state.
Additionally assigns the usernames in $assignee to Issue #1
322
322
from the microsoft\PowerShellForGitHub project.
@@ -325,14 +325,14 @@ function New-GitHubAssignee
325
325
$assignees = @('octocat')
326
326
Get-GitHubRepository -OwnerName microsoft -RepositoryName PowerShellForGitHub |
327
327
Get-GitHubIssue -Issue 1 |
328
-
New-GitHubAssignee -Assignee $assignee
328
+
Add-GitHubAssignee -Assignee $assignee
329
329
330
330
Additionally assigns the usernames in $assignee to Issue #1
331
331
from the microsoft\PowerShellForGitHub project.
332
332
333
333
.EXAMPLE
334
334
$octocat = Get-GitHubUser -UserName 'octocat'
335
-
$octocat | New-GitHubAssignee -OwnerName microsoft -RepositoryName PowerShellForGitHub -Issue 1
335
+
$octocat | Add-GitHubAssignee -OwnerName microsoft -RepositoryName PowerShellForGitHub -Issue 1
336
336
337
337
Additionally assigns the user 'octocat' to Issue #1
338
338
from the microsoft\PowerShellForGitHub project.
@@ -341,6 +341,7 @@ function New-GitHubAssignee
341
341
SupportsShouldProcess,
342
342
DefaultParameterSetName='Elements')]
343
343
[OutputType({$script:GitHubIssueTypeName})]
344
+
[Alias('New-GitHubAssignee')] # Non-standard usage of the New verb, but done to avoid a breaking change post 0.14.0
344
345
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess","", Justification="Methods called within here make use of PSShouldProcess, and the switch is passed on to them inherently.")]
345
346
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSReviewUnusedParameter","", Justification="One or more parameters (like NoStatus) are only referenced by helper methods which get access to it from the stack via Get-Variable -Scope 1.")]
[Alias('Update-GitHubIssue')] # Non-standard usage of the Update verb, but done to avoid a breaking change post 0.14.0
753
754
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess","", Justification="Methods called within here make use of PSShouldProcess, and the switch is passed on to them inherently.")]
Updates the existing label called TestLabel in the PowerShellForGitHub project to be called
561
561
'NewTestLabel' and be colored yellow.
@@ -564,6 +564,7 @@ filter Update-GitHubLabel
564
564
SupportsShouldProcess,
565
565
DefaultParameterSetName='Elements')]
566
566
[OutputType({$script:GitHubLabelTypeName})]
567
+
[Alias('Update-GitHubLabel')] # Non-standard usage of the Update verb, but done to avoid a breaking change post 0.14.0
567
568
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess","", Justification="Methods called within here make use of PSShouldProcess, and the switch is passed on to them inherently.")]
[Alias('Update-GitHubRepository')] # Non-standard usage of the Update verb, but done to avoid a breaking change post 0.14.0
1149
1150
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess","", Justification="Methods called within here make use of PSShouldProcess, and the switch is passed on to them inherently.")]
Updates the current user to indicate that their location is "Seattle, WA" and that they
353
353
are not currently hireable.
354
354
#>
355
355
[CmdletBinding(SupportsShouldProcess)]
356
356
[OutputType({$script:GitHubUserTypeName})]
357
+
[Alias('Update-GitHubCurrentUser')] # Non-standard usage of the Update verb, but done to avoid a breaking change post 0.14.0
357
358
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess","", Justification="Methods called within here make use of PSShouldProcess, and the switch is passed on to them inherently.")]
0 commit comments