-
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: MariusStorhaug <[email protected]>
|
@copilot Lets make the validateset smarter for the status functions:
|
Co-authored-by: MariusStorhaug <[email protected]>
Done in c6ae5b6. Converted all four status functions to use argument completers that dynamically read from |
|
@copilot As the |
Co-authored-by: MariusStorhaug <[email protected]>
Done in 74c8ef6. Moved stamps from private |
Co-authored-by: MariusStorhaug <[email protected]>
Co-authored-by: MariusStorhaug <[email protected]>
|
@copilot Fix this slop please: |
Co-authored-by: MariusStorhaug <[email protected]>
…e parameter names for consistency
…ithub.com/PSModule/GitHub into copilot/remove-status-functions-australia
… output formatting
There was a problem hiding this 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:StatusBaseURLmap with$script:GitHub.Stamps(typedGitHubStampobjects). - Added
Get-GitHubStampand updated all Status cmdlets to use-Name(with-Stampas an alias for compatibility). - Updated Pester tests and added a status
-Nameargument 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 { |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
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).
| ) -ParameterName Name -ScriptBlock { | |
| ) -ParameterName @('Name', 'Stamp') -ScriptBlock { |
| process { | ||
| if ([string]::IsNullOrEmpty($Name)) { | ||
| $script:GitHub.Stamps | ||
| return | ||
| } |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
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.
| .LINK | ||
| https://psmodule.io/GitHub/Functions/Status/Get-GitHubStamp | ||
| #> | ||
| [OutputType([GitHubStamp])] |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
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.
| [OutputType([GitHubStamp])] | |
| [OutputType([GitHubStamp[]])] |
There was a problem hiding this 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.
| $stamp = Get-GitHubStamp -Name $Name | ||
| $baseURL = $stamp.BaseUrl |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
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.
| $stamp = Get-GitHubStamp -Name $Name | |
| $baseURL = $stamp.BaseUrl | |
| $baseURL = (Get-GitHubStamp -Name $Name).BaseUrl |
Removes the obsolete Australia region from GitHub Status functions and centralizes stamp definitions into a single
$script:GitHub.Stampsproperty. A newGet-GitHubStampfunction 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:StatusBaseURLhashtable into the$script:GitHub.Stampsproperty, 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-GitHubStampfunctionA new public function
Get-GitHubStampexposes the available stamps:Parameter changes
The
-Stampparameter has been renamed to-Nameacross all status functions for consistency. The original-Stampname remains available as an alias for backward compatibility:Tab-completion
Status functions now support tab-completion for the
-Nameparameter via a registered argument completer that reads fromGet-GitHubStamp, so completion options stay in sync with the defined stamps automatically.