Skip to content

Commit c5ff8bd

Browse files
authored
Merge branch 'master' into issue-#96-gitrefs-implement
2 parents 0b1aad9 + 8e55f5a commit c5ff8bd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+3846
-810
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
- [ ] Comment-based help added/updated, including examples.
3535
- [ ] [Static analysis](https://github.com/microsoft/PowerShellForGitHub/blob/master/CONTRIBUTING.md#static-analysis) is reporting back clean.
3636
- [ ] New/changed code adheres to our [coding guidelines](https://github.com/microsoft/PowerShellForGitHub/blob/master/CONTRIBUTING.md#coding-guidelines).
37+
- [ ] [Formatters were created](https://github.com/microsoft/PowerShellForGitHub/blob/master/CONTRIBUTING.md#formatters) for any new types being added.
3738
- [ ] New/changed code continues to [support the pipeline](https://github.com/microsoft/PowerShellForGitHub/blob/master/CONTRIBUTING.md#pipeline-support).
3839
- [ ] Changes to the manifest file follow the [manifest guidance](https://github.com/microsoft/PowerShellForGitHub/blob/master/CONTRIBUTING.md#module-manifest).
3940
- [ ] Unit tests were added/updated and are all passing. See [testing guidelines](https://github.com/microsoft/PowerShellForGitHub/blob/master/CONTRIBUTING.md#testing). This includes making sure that all pipeline input variations have been covered.

CONTRIBUTING.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Looking for information on how to use this module? Head on over to [README.md](
2424
* [Code Comments](#code-comments)
2525
* [Debugging Tips](#debugging-tips)
2626
* [Pipeline Support](#pipeline-support)
27+
* [Formatters](#formatters)
2728
* [Testing](#testing)
2829
* [Installing Pester](#installing-pester)
2930
* [Configuring Your Environment](#configuring-your-environment)
@@ -348,6 +349,28 @@ new functionality added to the module embraces this design.
348349

349350
----------
350351

352+
### Formatters
353+
354+
[Our goal](https://github.com/microsoft/PowerShellForGitHub/issues/27) is to have automattic
355+
formatting for all `GitHub.*` types that this project defines.
356+
357+
Formatting was first introduced to the project with [#205](https://github.com/microsoft/PowerShellForGitHub/pull/205),
358+
and succcesive PR's which introduce new types have added their additional formatters as well.
359+
Eventually we will get Formatters for all previously introduced types as well.
360+
361+
Formatter files can be found in [/Formatters](https://github.com/microsoft/PowerShellForGitHub/tree/master/Formatters).
362+
363+
When adding a new formatter file, keep the following in mind:
364+
365+
* One formatter file per PowerShell module file, and name them similarly
366+
(e.g. `GitHubRepositories.ps1` gets a `Formatters\GitHubRepositories.Format.ps1xml` file)
367+
* Be sure to add the formatter file to the manifest (common mistake to forget this).
368+
* Don't display all the type's properties ...just choose the most relevant pieces of information;
369+
sometimes this might mean using a script block to grab an inner-property or to perform a
370+
calculation.
371+
372+
----------
373+
351374
### Testing
352375
[![Build status](https://dev.azure.com/ms/PowerShellForGitHub/_apis/build/status/PowerShellForGitHub-CI?branchName=master)](https://dev.azure.com/ms/PowerShellForGitHub/_build/latest?definitionId=109&branchName=master)
353376
[![Azure DevOps tests](https://img.shields.io/azure-devops/tests/ms/PowerShellForGitHub/109/master)](https://dev.azure.com/ms/PowerShellForGitHub/_build/latest?definitionId=109&branchName=master)
@@ -554,6 +577,7 @@ Thank you to all of our contributors, no matter how big or small the contributio
554577
- **[Jess Pomfret (@jpomfret)](https://github.com/jpomfret)**
555578
- **[Giuseppe Campanelli (@themilanfan)](https://github.com/themilanfan)**
556579
- **[Christoph Bergmeister (@bergmeister)](https://github.com/bergmeister)**
580+
- **[Simon Heather (@X-Guardian)](https://github.com/X-Guardian)**
557581

558582
----------
559583

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<Configuration>
3+
<ViewDefinitions>
4+
<!--================== GitHub.Repository Type View =================-->
5+
<View>
6+
<Name>GitHub.Repository</Name>
7+
<ViewSelectedBy>
8+
<TypeName>GitHub.Repository</TypeName>
9+
</ViewSelectedBy>
10+
<TableControl>
11+
<TableRowEntries>
12+
<TableRowEntry>
13+
<TableColumnItems>
14+
<TableColumnItem>
15+
<PropertyName>full_name</PropertyName>
16+
</TableColumnItem>
17+
<TableColumnItem>
18+
<PropertyName>visibility</PropertyName>
19+
</TableColumnItem>
20+
<TableColumnItem>
21+
<PropertyName>description</PropertyName>
22+
</TableColumnItem>
23+
</TableColumnItems>
24+
</TableRowEntry>
25+
</TableRowEntries>
26+
</TableControl>
27+
</View>
28+
<!--=============== GitHub.RepositoryTopic Type View ===============-->
29+
<View>
30+
<Name>GitHub.RepositoryTopic</Name>
31+
<ViewSelectedBy>
32+
<TypeName>GitHub.RepositoryTopic</TypeName>
33+
</ViewSelectedBy>
34+
<ListControl>
35+
<ListEntries>
36+
<ListEntry>
37+
<ListItems>
38+
<ListItem>
39+
<PropertyName>names</PropertyName>
40+
</ListItem>
41+
<ListItem>
42+
<PropertyName>RepositoryUrl</PropertyName>
43+
</ListItem>
44+
</ListItems>
45+
</ListEntry>
46+
</ListEntries>
47+
</ListControl>
48+
</View>
49+
<!--=============== GitHub.RepositoryContributor Type View ===============-->
50+
<View>
51+
<Name>GitHub.RepositoryContributor</Name>
52+
<ViewSelectedBy>
53+
<TypeName>GitHub.RepositoryContributor</TypeName>
54+
</ViewSelectedBy>
55+
<TableControl>
56+
<TableRowEntries>
57+
<TableRowEntry>
58+
<TableColumnItems>
59+
<TableColumnItem>
60+
<PropertyName>UserName</PropertyName>
61+
</TableColumnItem>
62+
<TableColumnItem>
63+
<PropertyName>type</PropertyName>
64+
</TableColumnItem>
65+
<TableColumnItem>
66+
<PropertyName>contributions</PropertyName>
67+
</TableColumnItem>
68+
</TableColumnItems>
69+
</TableRowEntry>
70+
</TableRowEntries>
71+
</TableControl>
72+
</View>
73+
<!--========== GitHub.RepositoryContributorStatistics Type View ==========-->
74+
<View>
75+
<Name>GitHub.RepositoryContributorStatistics</Name>
76+
<ViewSelectedBy>
77+
<TypeName>GitHub.RepositoryContributorStatistics</TypeName>
78+
</ViewSelectedBy>
79+
<TableControl>
80+
<TableHeaders>
81+
<TableColumnHeader>
82+
<Label>author.UserName</Label>
83+
</TableColumnHeader>
84+
<TableColumnHeader />
85+
<TableColumnHeader />
86+
</TableHeaders>
87+
<TableRowEntries>
88+
<TableRowEntry>
89+
<TableColumnItems>
90+
<TableColumnItem>
91+
<ScriptBlock>
92+
$_.author.UserName
93+
</ScriptBlock>
94+
</TableColumnItem>
95+
<TableColumnItem>
96+
<PropertyName>total</PropertyName>
97+
</TableColumnItem>
98+
<TableColumnItem>
99+
<PropertyName>weeks</PropertyName>
100+
</TableColumnItem>
101+
</TableColumnItems>
102+
</TableRowEntry>
103+
</TableRowEntries>
104+
</TableControl>
105+
</View>
106+
<!--=============== GitHub.RepositoryCollaborator Type View ===============-->
107+
<View>
108+
<Name>GitHub.RepositoryCollaborator</Name>
109+
<ViewSelectedBy>
110+
<TypeName>GitHub.RepositoryCollaborator</TypeName>
111+
</ViewSelectedBy>
112+
<TableControl>
113+
<TableHeaders>
114+
<TableColumnHeader />
115+
<TableColumnHeader>
116+
<Label>permissions.admin</Label>
117+
</TableColumnHeader>
118+
<TableColumnHeader>
119+
<Label>permissions.push</Label>
120+
</TableColumnHeader>
121+
<TableColumnHeader>
122+
<Label>permissions.pull</Label>
123+
</TableColumnHeader>
124+
</TableHeaders>
125+
<TableRowEntries>
126+
<TableRowEntry>
127+
<TableColumnItems>
128+
<TableColumnItem>
129+
<PropertyName>UserName</PropertyName>
130+
</TableColumnItem>
131+
<TableColumnItem>
132+
<ScriptBlock>
133+
$_.permissions.admin
134+
</ScriptBlock>
135+
</TableColumnItem>
136+
<TableColumnItem>
137+
<ScriptBlock>
138+
$_.permissions.push
139+
</ScriptBlock>
140+
</TableColumnItem>
141+
<TableColumnItem>
142+
<ScriptBlock>
143+
$_.permissions.pull
144+
</ScriptBlock>
145+
</TableColumnItem>
146+
</TableColumnItems>
147+
</TableRowEntry>
148+
</TableRowEntries>
149+
</TableControl>
150+
</View>
151+
<!--=============== GitHub.RepositoryTag Type View ===============-->
152+
<View>
153+
<Name>GitHub.RepositoryTag</Name>
154+
<ViewSelectedBy>
155+
<TypeName>GitHub.RepositoryTag</TypeName>
156+
</ViewSelectedBy>
157+
<TableControl>
158+
<TableHeaders>
159+
<TableColumnHeader />
160+
<TableColumnHeader>
161+
<Label>commit.sha</Label>
162+
</TableColumnHeader>
163+
</TableHeaders>
164+
<TableRowEntries>
165+
<TableRowEntry>
166+
<TableColumnItems>
167+
<TableColumnItem>
168+
<PropertyName>name</PropertyName>
169+
</TableColumnItem>
170+
<TableColumnItem>
171+
<ScriptBlock>
172+
$_.commit.sha
173+
</ScriptBlock>
174+
</TableColumnItem>
175+
</TableColumnItems>
176+
</TableRowEntry>
177+
</TableRowEntries>
178+
</TableControl>
179+
</View>
180+
</ViewDefinitions>
181+
</Configuration>

GitHubAssignees.ps1

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ filter Get-GitHubAssignee
4444
GitHub.Project
4545
GitHub.ProjectCard
4646
GitHub.ProjectColumn
47+
GitHub.Reaction
4748
GitHub.Release
4849
GitHub.Repository
4950
GitHub.User
@@ -156,6 +157,7 @@ filter Test-GitHubAssignee
156157
GitHub.Project
157158
GitHub.ProjectCard
158159
GitHub.ProjectColumn
160+
GitHub.Reaction
159161
GitHub.Release
160162
GitHub.Repository
161163
GitHub.User
@@ -247,7 +249,7 @@ filter Test-GitHubAssignee
247249
}
248250
}
249251

250-
function New-GitHubAssignee
252+
function Add-GitHubAssignee
251253
{
252254
<#
253255
.DESCRIPTION
@@ -299,6 +301,7 @@ function New-GitHubAssignee
299301
GitHub.Project
300302
GitHub.ProjectCard
301303
GitHub.ProjectColumn
304+
GitHub.Reaction
302305
GitHub.Release
303306
GitHub.Repository
304307
GitHub.User
@@ -308,15 +311,15 @@ function New-GitHubAssignee
308311
309312
.EXAMPLE
310313
$assignees = @('octocat')
311-
New-GitHubAssignee -OwnerName microsoft -RepositoryName PowerShellForGitHub -Issue 1 -Assignee $assignee
314+
Add-GitHubAssignee -OwnerName microsoft -RepositoryName PowerShellForGitHub -Issue 1 -Assignee $assignee
312315
313316
Additionally assigns the usernames in $assignee to Issue #1
314317
from the microsoft\PowerShellForGitHub project.
315318
316319
.EXAMPLE
317320
$assignees = @('octocat')
318321
$repo = Get-GitHubRepository -OwnerName microsoft -RepositoryName PowerShellForGitHub
319-
$repo | New-GitHubAssignee -Issue 1 -Assignee $assignee
322+
$repo | Add-GitHubAssignee -Issue 1 -Assignee $assignee
320323
321324
Additionally assigns the usernames in $assignee to Issue #1
322325
from the microsoft\PowerShellForGitHub project.
@@ -325,14 +328,14 @@ function New-GitHubAssignee
325328
$assignees = @('octocat')
326329
Get-GitHubRepository -OwnerName microsoft -RepositoryName PowerShellForGitHub |
327330
Get-GitHubIssue -Issue 1 |
328-
New-GitHubAssignee -Assignee $assignee
331+
Add-GitHubAssignee -Assignee $assignee
329332
330333
Additionally assigns the usernames in $assignee to Issue #1
331334
from the microsoft\PowerShellForGitHub project.
332335
333336
.EXAMPLE
334337
$octocat = Get-GitHubUser -UserName 'octocat'
335-
$octocat | New-GitHubAssignee -OwnerName microsoft -RepositoryName PowerShellForGitHub -Issue 1
338+
$octocat | Add-GitHubAssignee -OwnerName microsoft -RepositoryName PowerShellForGitHub -Issue 1
336339
337340
Additionally assigns the user 'octocat' to Issue #1
338341
from the microsoft\PowerShellForGitHub project.
@@ -341,6 +344,7 @@ function New-GitHubAssignee
341344
SupportsShouldProcess,
342345
DefaultParameterSetName='Elements')]
343346
[OutputType({$script:GitHubIssueTypeName})]
347+
[Alias('New-GitHubAssignee')] # Non-standard usage of the New verb, but done to avoid a breaking change post 0.14.0
344348
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess", "", Justification="Methods called within here make use of PSShouldProcess, and the switch is passed on to them inherently.")]
345349
[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.")]
346350
param(
@@ -475,6 +479,7 @@ function Remove-GitHubAssignee
475479
GitHub.Project
476480
GitHub.ProjectCard
477481
GitHub.ProjectColumn
482+
GitHub.Reaction
478483
GitHub.Release
479484
GitHub.Repository
480485

0 commit comments

Comments
 (0)