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

Add additional commands #6

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

johlju
Copy link
Member

@johlju johlju commented Aug 25, 2024

Pull Request (PR) description

This Pull Request (PR) fixes the following issues

Task list

  • Added an entry to the change log under the Unreleased section of the
    file CHANGELOG.md. Entry should say what was changed and how that
    affects users (if applicable), and reference the issue being resolved
    (if applicable).
  • Documentation added/updated in README.md and source/WikiSource.
  • Comment-based help added/updated for all new/changed functions.
  • Localization strings added/updated in all localization files as appropriate.
  • Examples appropriately added/updated.
  • Unit tests added/updated. See DSC Community Testing Guidelines.
  • Integration tests added/updated (where applicable). See
    DSC Community Testing Guidelines.
  • New/changed code adheres to DSC Community Style Guidelines.

This change is Reviewable

@johlju johlju changed the title F/add additional commands Add additional commands Aug 25, 2024

if ($LASTEXITCODE -ne 0) # cSpell: ignore LASTEXITCODE
{
if($PSBoundParameters.ContainsKey('BranchName'))

Check warning

Code scanning / PSScriptAnalyzer

If a keyword is followed by a parenthesis, there should be single space between the keyword and the parenthesis. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-after-opening-brace Warning

If a keyword is followed by a parenthesis, there should be single space between the keyword and the parenthesis. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-after-opening-brace

if ($LASTEXITCODE -ne 0) # cSpell: ignore LASTEXITCODE
{
if($PSBoundParameters.ContainsKey('BranchName'))

Check warning

Code scanning / PSScriptAnalyzer

Use space before open parenthesis. Warning

Use space before open parenthesis.
Copy link

codecov bot commented Aug 25, 2024

Codecov Report

Attention: Patch coverage is 58.21918% with 61 lines in your changes missing coverage. Please review.

Project coverage is 77%. Comparing base (b654967) to head (ae80566).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
source/Public/Update-GitLocalBranch.ps1 0% 21 Missing ⚠️
source/Public/Get-GitBranchCommit.ps1 29% 17 Missing ⚠️
source/Public/New-SamplerGitHubReleaseTag.ps1 64% 6 Missing ⚠️
source/Public/Test-GitRemoteBranch.ps1 0% 6 Missing ⚠️
source/Public/Get-GitLocalBranchName.ps1 54% 5 Missing ⚠️
source/Public/Switch-GitLocalBranch.ps1 50% 3 Missing ⚠️
source/Public/Assert-GitLocalChanges.ps1 50% 2 Missing ⚠️
source/Public/Test-GitLocalChanges.ps1 80% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@         Coverage Diff         @@
##           main    #6    +/-   ##
===================================
- Coverage    98%   77%   -21%     
===================================
  Files         9    22    +13     
  Lines       215   370   +155     
===================================
+ Hits        212   288    +76     
- Misses        3    82    +79     
Flag Coverage Δ
unit 77% <58%> (-21%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
source/Public/Assert-GitRemote.ps1 100% <100%> (ø)
source/Public/ConvertTo-AnsiSequence.ps1 100% <100%> (ø)
source/Public/ConvertTo-DifferenceString.ps1 100% <100%> (ø)
source/Public/Test-GitRemote.ps1 100% <100%> (ø)
source/Public/Update-RemoteTrackingBranch.ps1 100% <100%> (ø)
source/Public/Test-GitLocalChanges.ps1 80% <80%> (ø)
source/Public/Assert-GitLocalChanges.ps1 50% <50%> (ø)
source/Public/Switch-GitLocalBranch.ps1 50% <50%> (ø)
source/Public/Get-GitLocalBranchName.ps1 54% <54%> (ø)
source/Public/New-SamplerGitHubReleaseTag.ps1 70% <64%> (ø)
... and 3 more

... and 1 file with indirect coverage changes

#>
$remoteExists = Test-GitRemote -Name $Name

if (-not $remoteExists)

Check warning

Code scanning / PSScriptAnalyzer

Opening brace on if-statements should only be followed by one new line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-after-opening-brace Warning

Opening brace on if-statements should only be followed by one new line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-after-opening-brace
}

$switchedToDefaultBranch = $true
Write-Error -ErrorRecord $_ -ErrorAction 'Stop'

Check warning

Code scanning / PSScriptAnalyzer

Write-Error is used to create a terminating error. throw or $pscmdlet.ThrowTerminatingError should be used. Warning

Write-Error is used to create a terminating error. throw or $pscmdlet.ThrowTerminatingError should be used.
)
)
}
Write-Error -ErrorRecord $_ -ErrorAction 'Stop'

Check warning

Code scanning / PSScriptAnalyzer

Write-Error is used to create a terminating error. throw or $pscmdlet.ThrowTerminatingError should be used. Warning

Write-Error is used to create a terminating error. throw or $pscmdlet.ThrowTerminatingError should be used.
$errorMessage = $script:localizedData.New_SamplerGitHubReleaseTag_FailedGetTagsOrMissingTagsInLocalRepository
$errorCode = 'NSGRT0008' # cspell: disable-line
}
Write-Error @errorMessageParameters -ErrorAction 'Stop'

Check warning

Code scanning / PSScriptAnalyzer

Write-Error is used to create a terminating error. throw or $pscmdlet.ThrowTerminatingError should be used. Warning

Write-Error is used to create a terminating error. throw or $pscmdlet.ThrowTerminatingError should be used.
}

Write-Error @errorMessageParameters -ErrorAction 'Stop'

Check warning

Code scanning / PSScriptAnalyzer

Write-Error is used to create a terminating error. throw or $pscmdlet.ThrowTerminatingError should be used. Warning

Write-Error is used to create a terminating error. throw or $pscmdlet.ThrowTerminatingError should be used.
$DatabaseName
)
)
Write-Error -ErrorRecord $_ -ErrorAction 'Stop'

Check warning

Code scanning / PSScriptAnalyzer

Write-Error is used to create a terminating error. throw or $pscmdlet.ThrowTerminatingError should be used. Warning

Write-Error is used to create a terminating error. throw or $pscmdlet.ThrowTerminatingError should be used.
Switch-GitLocalBranch -BranchName $currentLocalBranchName -Verbose:$VerbosePreference -ErrorAction 'Stop'
}

Write-Error -ErrorRecord $_ -ErrorAction 'Stop'

Check warning

Code scanning / PSScriptAnalyzer

Write-Error is used to create a terminating error. throw or $pscmdlet.ThrowTerminatingError should be used. Warning

Write-Error is used to create a terminating error. throw or $pscmdlet.ThrowTerminatingError should be used.
This function returns a Boolean value indicating whether the branch exists in
the remote repository.
#>
function Test-GitRemoteBranch

Check warning

Code scanning / PSScriptAnalyzer

Example 1 in function Test-GitRemoteBranch uses invalid parameter BranchName. Warning

Example 1 in function Test-GitRemoteBranch uses invalid parameter BranchName.
Copy link

Labeling this pull request (PR) as abandoned since it has gone 14 days or more since the last update. An abandoned PR can be continued by another contributor. The abandoned label will be removed if work on this PR is taken up again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Receive-GitBranch: New command proposal
1 participant