Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 9, 2026

Removes the obsolete Australia region from GitHub Status functions and centralizes stamp definitions into a single $script:GitHub.Stamps property. A new Get-GitHubStamp function provides a public API for listing and retrieving available stamps, and all status functions now use it as their single source of truth.

Removed Australia region

The Australia status page (https://au.githubstatus.com) has been migrated to a new reporting type and is no longer available through the GitHub Status API. All status functions have been updated to remove Australia from the available stamps.

Centralized stamp definitions

Stamp definitions have been moved from a standalone $script:StatusBaseURL hashtable into the $script:GitHub.Stamps property, making them part of the main module configuration object. This provides a single source of truth for all stamp-related logic across functions, completers, and tests.

New Get-GitHubStamp function

A new public function Get-GitHubStamp exposes the available stamps:

# List all available stamps
Get-GitHubStamp

# Get a specific stamp by name
Get-GitHubStamp -Name 'Europe'

Parameter changes

The -Stamp parameter has been renamed to -Name across all status functions for consistency. The original -Stamp name remains available as an alias for backward compatibility:

# Both of these work
Get-GitHubStatus -Name 'Europe'
Get-GitHubStatus -Stamp 'Europe'  # Alias, still supported

Tab-completion

Status functions now support tab-completion for the -Name parameter via a registered argument completer that reads from Get-GitHubStamp, so completion options stay in sync with the defined stamps automatically.

Copilot AI changed the title [WIP] Remove obsolete status functions for Australia region Remove Australia region from status functions Feb 9, 2026
Copilot AI requested a review from MariusStorhaug February 9, 2026 09:54
@MariusStorhaug
Copy link
Member

@copilot Lets make the validateset smarter for the status functions:

  1. Convert them to Argument Completers using a completers.ps1 file and the "Register-ArgumentCompleter" cmdlet.
  2. Take data from the variable file covering stamps/status.

Copy link
Contributor Author

Copilot AI commented Feb 9, 2026

@copilot Lets make the validateset smarter for the status functions:

  1. Convert them to Argument Completers using a completers.ps1 file and the "Register-ArgumentCompleter" cmdlet.
  2. Take data from...

Done in c6ae5b6. Converted all four status functions to use argument completers that dynamically read from $script:StatusBaseURL instead of static ValidateSet.

Copilot AI changed the title Remove Australia region from status functions Remove Australia region from status functions and convert to argument completers Feb 9, 2026
@MariusStorhaug
Copy link
Member

@copilot As the StatusBaseURL variable is in the private variable, we could instead move it to a public variable, i.e. under the GitHub variable under a Stamps property.

Copy link
Contributor Author

Copilot AI commented Feb 9, 2026

@copilot As the StatusBaseURL variable is in the private variable, we could instead move it to a public variable, i.e. under the GitHub variable under a Stamps property.

Done in 74c8ef6. Moved stamps from private $script:StatusBaseURL variable to public $script:GitHub.Stamps property. Updated all references and deleted the old StatusBaseURL.ps1 file.

Copilot AI changed the title Remove Australia region from status functions and convert to argument completers Remove Australia region from status functions and move stamps to GitHub.Stamps Feb 9, 2026
Copilot AI requested a review from MariusStorhaug February 9, 2026 11:24
@MariusStorhaug MariusStorhaug changed the title Remove Australia region from status functions and move stamps to GitHub.Stamps 🩹 [Patch]: Remove Australia region from status functions Feb 9, 2026
@MariusStorhaug
Copy link
Member

@copilot Fix this slop please:

Error: [-] Avoid trailing whitespace (PSAvoidTrailingWhitespace) 35ms (34ms|1ms)
Message
  Expected $null or empty, because Each line should have no trailing whitespace., but got '
  - Workspace:/src/completers.ps1:L57:C1
  - Workspace:/src/completers.ps1:L61:C1
  - Workspace:/src/completers.ps1:L64:C1
  - Workspace:/src/completers.ps1:L68:C1'.
  at $issues -join '' | Should -BeNullOrEmpty -Because $rule.Description, /home/runner/work/_actions/PSModule/Invoke-ScriptAnalyzer/17bb50ef88b72e7d723e56b81d2e04f27ddc7e37/src/tests/PSScriptAnalyzer/PSScriptAnalyzer.Tests.ps1:145
  at <ScriptBlock>, /home/runner/work/_actions/PSModule/Invoke-ScriptAnalyzer/17bb50ef88b72e7d723e56b81d2e04f27ddc7e37/src/tests/PSScriptAnalyzer/PSScriptAnalyzer.Tests.ps1:145

Copy link
Contributor Author

Copilot AI commented Feb 10, 2026

@copilot Fix this slop please:

...

Fixed in f75a819. Removed trailing whitespace from blank lines 57, 61, 64, and 68 in completers.ps1. PSScriptAnalyzer should now pass.

@MariusStorhaug MariusStorhaug changed the title 🩹 [Patch]: Remove Australia region from status functions 🩹 [Patch]: Remove status function for Australia region (migrated to new reporting type) Feb 12, 2026
@MariusStorhaug MariusStorhaug marked this pull request as ready for review February 12, 2026 07:58
@MariusStorhaug MariusStorhaug requested a review from a team as a code owner February 12, 2026 07:58
Copilot AI review requested due to automatic review settings February 12, 2026 07:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the module’s GitHub Status support by removing the obsolete Australia region and switching status commands to use a centralized “stamp” list exposed via a new Get-GitHubStamp function (including tab completion).

Changes:

  • Removed the Australia stamp and replaced the old $script:StatusBaseURL map with $script:GitHub.Stamps (typed GitHubStamp objects).
  • Added Get-GitHubStamp and updated all Status cmdlets to use -Name (with -Stamp as an alias for compatibility).
  • Updated Pester tests and added a status -Name argument completer.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/GitHub.Tests.ps1 Adds tests for Get-GitHubStamp and iterates Status tests over discovered stamps.
src/variables/private/StatusBaseURL.ps1 Removes the legacy base-URL hashtable (including Australia).
src/variables/private/GitHub.ps1 Introduces $script:GitHub.Stamps as the centralized stamp list.
src/functions/public/Status/Get-GitHubStatusIncident.ps1 Switches from -Stamp+ValidateSet to -Name (alias Stamp) and resolves BaseUrl via Get-GitHubStamp.
src/functions/public/Status/Get-GitHubStatusComponent.ps1 Same parameter + BaseUrl resolution change as above.
src/functions/public/Status/Get-GitHubStatus.ps1 Same parameter + BaseUrl resolution change as above.
src/functions/public/Status/Get-GitHubStamp.ps1 New public API to list/lookup stamps.
src/functions/public/Status/Get-GitHubScheduledMaintenance.ps1 Same parameter + BaseUrl resolution change as above.
src/completers.ps1 Adds tab completion for the -Name parameter on status cmdlets.
src/classes/public/GitHubStamp.ps1 Adds a typed object representing a stamp (Name/BaseUrl).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

'Get-GitHubScheduledMaintenance'
'Get-GitHubStatusComponent'
'Get-GitHubStatusIncident'
) -ParameterName Name -ScriptBlock {
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argument completer is registered only for parameter name Name. Because the status functions keep Stamp as an alias for backward compatibility, tab-completion will not trigger when users type -Stamp unless you also register a completer for ParameterName Stamp (or register for both names).

Suggested change
) -ParameterName Name -ScriptBlock {
) -ParameterName @('Name', 'Stamp') -ScriptBlock {

Copilot uses AI. Check for mistakes.
Comment on lines +43 to +47
process {
if ([string]::IsNullOrEmpty($Name)) {
$script:GitHub.Stamps
return
}
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get-GitHubStamp treats an empty string -Name '' as "not specified" and returns all stamps. Downstream callers (e.g., status functions) then try to read .BaseUrl from an array, which will produce an invalid base URL. Consider distinguishing between "parameter not provided" vs "provided but empty" (e.g., check $PSBoundParameters.ContainsKey('Name')) and/or add [ValidateNotNullOrEmpty()] to prevent empty-string input.

Copilot uses AI. Check for mistakes.
.LINK
https://psmodule.io/GitHub/Functions/Status/Get-GitHubStamp
#>
[OutputType([GitHubStamp])]
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[OutputType([GitHubStamp])] is inaccurate because this function can output multiple stamps when -Name is not specified. Updating the output type to include the collection case (e.g., [GitHubStamp[]]) will improve generated docs and tooling expectations.

Suggested change
[OutputType([GitHubStamp])]
[OutputType([GitHubStamp[]])]

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +67 to +68
$stamp = Get-GitHubStamp -Name $Name
$baseURL = $stamp.BaseUrl
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor style inconsistency: This function uses an intermediate variable to store the stamp object before accessing BaseUrl, while the other status functions (Get-GitHubStatus, Get-GitHubStatusIncident, Get-GitHubStatusComponent) use inline property access: $baseURL = (Get-GitHubStamp -Name $Name).BaseUrl. Consider using the inline approach for consistency, unless the stamp object is needed elsewhere in the function.

Suggested change
$stamp = Get-GitHubStamp -Name $Name
$baseURL = $stamp.BaseUrl
$baseURL = (Get-GitHubStamp -Name $Name).BaseUrl

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

🩹 [Patch]: Remove status function for Australia region (migrated to new reporting type)

2 participants