-
Notifications
You must be signed in to change notification settings - Fork 8
🩹 [Patch]: Remove status function for Australia region (migrated to new reporting type) #548
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
Open
Copilot
wants to merge
15
commits into
main
Choose a base branch
from
copilot/remove-status-functions-australia
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
6011414
Initial plan
Copilot a022de5
Remove Australia region from status functions
Copilot c6ae5b6
Convert Stamp parameter ValidateSet to argument completers
Copilot 74c8ef6
Move Stamps from private variable to GitHub.Stamps property
Copilot a667432
Use array syntax for Register-ArgumentCompleter CommandName
Copilot 282d8bd
Use dynamic reference to GitHub.Stamps.Keys in tests
Copilot f75a819
Remove trailing whitespace from completers.ps1
Copilot 006ece3
🩹 [Refactor]: Remove Australia region from status functions and updat…
MariusStorhaug 9eaab64
Merge branch 'copilot/remove-status-functions-australia' of https://g…
MariusStorhaug 6cdbd62
🩹 [Refactor]: Improve Get-GitHubStamp function logic and enhance test…
MariusStorhaug 0e0d784
🩹 [Refactor]: Update PSModule.yml to enable skipping of tests and doc…
MariusStorhaug 352ae48
🩹 [Refactor]: Add skip option for CodeCoverage in PSModule.yml
MariusStorhaug 6475871
🩹 [Refactor]: Ensure 'Skip' option is set for Module tests in PSModul…
MariusStorhaug 4a6e784
🩹 [Refactor]: Comment out deprecated skip options for various test ca…
MariusStorhaug 5a8335b
[Refactor]: Comment out Build section in PSModule.yml to remove depre…
MariusStorhaug File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| class GitHubStamp { | ||
| # The name of the stamp (region). | ||
| # Example: 'Public' | ||
| [string] $Name | ||
|
|
||
| # The base URL of the status page for this stamp. | ||
| # Example: 'https://www.githubstatus.com' | ||
| [string] $BaseUrl | ||
|
|
||
| GitHubStamp() {} | ||
|
|
||
| GitHubStamp([string]$Name, [string]$BaseUrl) { | ||
| $this.Name = $Name | ||
| $this.BaseUrl = $BaseUrl | ||
| } | ||
|
|
||
| [string] ToString() { | ||
| return $this.Name | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| function Get-GitHubStamp { | ||
| <# | ||
| .SYNOPSIS | ||
| Gets the available GitHub Status page stamps (regions). | ||
|
|
||
| .DESCRIPTION | ||
| Returns the available GitHub Status page stamps, which represent different regional status pages. | ||
| Each stamp includes the name and base URL of the status page. | ||
|
|
||
| .EXAMPLE | ||
| ```powershell | ||
| Get-GitHubStamp | ||
| ``` | ||
|
|
||
| Gets all available GitHub Status page stamps. | ||
|
|
||
| .EXAMPLE | ||
| ```powershell | ||
| Get-GitHubStamp -Name 'Europe' | ||
| ``` | ||
|
|
||
| Gets the GitHub Status page stamp for 'Europe'. | ||
|
|
||
| .NOTES | ||
| [GitHub Status API](https://www.githubstatus.com/api) | ||
|
|
||
| .LINK | ||
| https://psmodule.io/GitHub/Functions/Status/Get-GitHubStamp | ||
| #> | ||
| [OutputType([GitHubStamp[]])] | ||
| [CmdletBinding()] | ||
| param( | ||
| # The name of the stamp to get. If not specified, all stamps are returned. | ||
| [Parameter()] | ||
| [ValidateNotNullOrEmpty()] | ||
| [Alias('Stamp')] | ||
| [string] $Name | ||
| ) | ||
|
|
||
| begin { | ||
| $stackPath = Get-PSCallStackPath | ||
| Write-Debug "[$stackPath] - Start" | ||
| } | ||
|
|
||
| process { | ||
| if ([string]::IsNullOrEmpty($Name)) { | ||
| $script:GitHub.Stamps | ||
| return | ||
| } | ||
MariusStorhaug marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| $stamp = $script:GitHub.Stamps | Where-Object { $_.Name -eq $Name } | ||
| if (-not $stamp) { | ||
| $available = $script:GitHub.Stamps.Name -join ', ' | ||
| throw "Stamp '$Name' not found. Available stamps: $available" | ||
| } | ||
| $stamp | ||
| } | ||
|
|
||
| end { | ||
| Write-Debug "[$stackPath] - End" | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| Register-ArgumentCompleter -CommandName @( | ||
| 'Get-GitHubScheduledMaintenance' | ||
| 'Get-GitHubStamp' | ||
| 'Get-GitHubStatus' | ||
| 'Get-GitHubStatusComponent' | ||
| 'Get-GitHubStatusIncident' | ||
| ) -ParameterName Name -ScriptBlock { | ||
| param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters) | ||
| $null = $commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters | ||
|
|
||
| $stamps = Get-GitHubStamp | ||
| if (-not $stamps) { | ||
| return $null | ||
| } | ||
|
|
||
| $pattern = switch (Get-GitHubConfig -Name CompletionMode) { 'Contains' { "*$wordToComplete*" } default { "$wordToComplete*" } } | ||
| $filteredOptions = $stamps | Where-Object { $_.Name -like $pattern } | ||
|
|
||
| if (-not $filteredOptions) { | ||
| return $null | ||
| } | ||
|
|
||
| $filteredOptions | ForEach-Object { | ||
| [System.Management.Automation.CompletionResult]::new($_.Name, $_.Name, 'ParameterValue', $_.Name) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.