Skip to content

Commit f893538

Browse files
Rename parameters in Repair-PullRequestTest
Renamed the 'PRNumber' parameter to 'PullRequest' and 'MaxPRs' to 'Limit' in Repair-PullRequestTest.ps1 for clarity and consistency. Updated all references and documentation in both the script and README accordingly.
1 parent 6f07f99 commit f893538

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

.aitools/module/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ All helper functions are automatically imported but not exported publicly. They
9696
Repair-PullRequestTest
9797
9898
# Fix tests in a specific PR with auto-commit
99-
Repair-PullRequestTest -PRNumber 1234 -AutoCommit
99+
Repair-PullRequestTest -PullRequest 1234 -AutoCommit
100100
101101
# Show AppVeyor build status
102102
Show-AppVeyorBuildStatus -BuildId 12345

.aitools/module/Repair-PullRequestTest.ps1

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ function Repair-PullRequestTest {
88
and replaces failing tests with working versions from the Development branch, then runs
99
Update-PesterTest to migrate them properly.
1010
11-
.PARAMETER PRNumber
11+
.PARAMETER PullRequest
1212
Specific PR number to process. If not specified, processes all open PRs with failures.
1313
1414
.PARAMETER AutoCommit
1515
If specified, automatically commits the fixes made by the repair process.
1616
17-
.PARAMETER MaxPRs
17+
.PARAMETER Limit
1818
Maximum number of PRs to process. Default: 5
1919
2020
.PARAMETER BuildId
@@ -41,19 +41,19 @@ function Repair-PullRequestTest {
4141
Checks all open PRs and fixes failing tests using Claude.
4242
4343
.EXAMPLE
44-
PS C:\> Repair-PullRequestTest -PRNumber 9234 -AutoCommit
44+
PS C:\> Repair-PullRequestTest -PullRequest 9234 -AutoCommit
4545
Fixes failing tests in PR #9234 and automatically commits the changes.
4646
4747
.EXAMPLE
48-
PS C:\> Repair-PullRequestTest -PRNumber 9234 -BuildId 12345
48+
PS C:\> Repair-PullRequestTest -PullRequest 9234 -BuildId 12345
4949
Fixes failing tests in PR #9234 using AppVeyor build #12345 instead of the latest build.
5050
5151
.EXAMPLE
5252
PS C:\> Repair-PullRequestTest -BuildId 12345
5353
Fixes failing tests from AppVeyor build #12345 across all relevant PRs.
5454
5555
.EXAMPLE
56-
PS C:\> Repair-PullRequestTest -PRNumber 9234 -Pattern "Remove-Dba"
56+
PS C:\> Repair-PullRequestTest -PullRequest 9234 -Pattern "Remove-Dba"
5757
Fixes failing tests in PR #9234, but only processes failures matching "Remove-Dba".
5858
5959
.EXAMPLE
@@ -62,9 +62,9 @@ function Repair-PullRequestTest {
6262
#>
6363
[CmdletBinding(SupportsShouldProcess)]
6464
param (
65-
[int]$PRNumber,
65+
[int]$PullRequest,
6666
[switch]$AutoCommit,
67-
[int]$MaxPRs = 5,
67+
[int]$Limit = 5,
6868
[int]$BuildId,
6969
[switch]$CopyOnly,
7070
[string]$Pattern
@@ -120,10 +120,10 @@ function Repair-PullRequestTest {
120120
Write-Verbose "Fetching open pull requests..."
121121
Write-Progress -Activity "Repairing Pull Request Tests" -Status "Fetching open PRs..." -PercentComplete 0
122122

123-
if ($PRNumber) {
124-
$prsJson = gh pr view $PRNumber --json "number,title,headRefName,state,statusCheckRollup,files" 2>$null
123+
if ($PullRequest) {
124+
$prsJson = gh pr view $PullRequest --json "number,title,headRefName,state,statusCheckRollup,files" 2>$null
125125
if (-not $prsJson) {
126-
throw "Could not fetch PR #$PRNumber"
126+
throw "Could not fetch PR #$PullRequest"
127127
}
128128
$prs = @($prsJson | ConvertFrom-Json)
129129
} else {
@@ -136,7 +136,7 @@ function Repair-PullRequestTest {
136136
$prs = @($currentBranchPR | ConvertFrom-Json)
137137
} else {
138138
Write-Verbose "No PR found for current branch, fetching all open PRs"
139-
$prsJson = gh pr list --state open --limit $MaxPRs --json "number,title,headRefName,state,statusCheckRollup" 2>$null
139+
$prsJson = gh pr list --state open --limit $Limit --json "number,title,headRefName,state,statusCheckRollup" 2>$null
140140
$prs = $prsJson | ConvertFrom-Json
141141

142142
# For each PR, get the files changed (since pr list doesn't include files)
@@ -175,7 +175,7 @@ function Repair-PullRequestTest {
175175

176176
# Use the first PR for branch operations (or current branch if no PR specified)
177177
$selectedPR = $prs | Select-Object -First 1
178-
if (-not $selectedPR -and -not $PRNumber) {
178+
if (-not $selectedPR -and -not $PullRequest) {
179179
# No PR context, stay on current branch
180180
$selectedPR = @{
181181
number = "current"

0 commit comments

Comments
 (0)