Skip to content

feat(PipelineInitialize): add additionalcountries warning - #44

Closed
ChrisBlankDe wants to merge 1 commit into
mainfrom
warningOnAdditionalCountries
Closed

ChrisBlankDe wants to merge 1 commit into
mainfrom
warningOnAdditionalCountries

Conversation

@ChrisBlankDe

@ChrisBlankDe ChrisBlankDe commented Apr 13, 2026 •

Copy link
Copy Markdown
Contributor

This pull request adds a validation step for the additionalCountries parameter in the PipelineInitialize.ps1 script. Now, if additional countries are specified, the script will output a debug message listing them and a warning that this feature is not supported, with a link to relevant documentation.

Validation and warnings for additional countries:

  • Added logic to parse and validate the additionalCountries parameter, displaying a debug message with the specified countries and a warning that this feature is not supported by COSMO Alpaca, including a documentation link.

part of AB#4538

Copilot AI review requested due to automatic review settings April 13, 2026 11:54
@ChrisBlankDe
ChrisBlankDe requested a review from a team as a code owner April 13, 2026 11:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a settings check to PipelineInitialize.ps1 to detect additionalCountries usage and emit diagnostic output indicating the feature is unsupported in COSMO Alpaca.

Changes:

  • Parse additionalCountries when provided as a comma-separated string.
  • Emit a debug line listing specified additional countries.
  • Emit a warning that additionalCountries is not supported, pointing to documentation.

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

if ($additionalCountries -is [String]) { $additionalCountries = @($additionalCountries.Split(',').Trim() | Where-Object { $_ }) }
if ($additionalCountries.Length -gt 0) {
Write-AlpacaDebug "Additional countries specified: $($additionalCountries -join ', ')"
Write-AlpacaWarning "AdditionalCountries are not supported by COSMO Alpaca. Use BuildModes to validate additional countries. https://docs.cosmoconsult.com/en-en/cloud-service/alpaca/github/" #TODO update link when site is published.

Copilot AI Apr 13, 2026

Copy link

Choose a reason for hiding this comment

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

The warning message uses AdditionalCountries (PascalCase) while the setting/variable is additionalCountries, and the phrasing is a bit inconsistent (e.g., “AdditionalCountries are not supported…”). Aligning the casing with the actual setting name and tightening the wording will make the warning clearer/searchable.

Suggested change
Write-AlpacaWarning "AdditionalCountries are not supported by COSMO Alpaca. Use BuildModes to validate additional countries. https://docs.cosmoconsult.com/en-en/cloud-service/alpaca/github/" #TODO update link when site is published.
Write-AlpacaWarning "The setting 'additionalCountries' is not supported by COSMO Alpaca. Use BuildModes to validate additional countries. https://docs.cosmoconsult.com/en-en/cloud-service/alpaca/github/" #TODO update link when site is published.

Copilot uses AI. Check for mistakes.


# Check Settings
if ($additionalCountries -is [String]) { $additionalCountries = @($additionalCountries.Split(',').Trim() | Where-Object { $_ }) }

Copilot AI Apr 13, 2026

Copy link

Choose a reason for hiding this comment

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

$additionalCountries is only split/trimmed when it's a single string. If it’s already an array (e.g., coming from settings as a JSON array), entries won’t be trimmed/filtered consistently and the debug output can include leading/trailing spaces. Consider normalizing the value for both string and array inputs (trim each entry, drop empty) before checking/counting.

Suggested change
if ($additionalCountries -is [String]) { $additionalCountries = @($additionalCountries.Split(',').Trim() | Where-Object { $_ }) }
if ($additionalCountries -is [String]) {
$additionalCountries = @($additionalCountries.Split(','))
}
else {
$additionalCountries = @($additionalCountries)
}
$additionalCountries = @(
$additionalCountries |
ForEach-Object { "$_".Trim() } |
Where-Object { $_ }
)

Copilot uses AI. Check for mistakes.
@ChrisBlankDe

Copy link
Copy Markdown
Contributor Author

Moved to new repo: https://github.com/cosmoconsult/alpaca-al-go/pull/6

@ChrisBlankDe
ChrisBlankDe deleted the warningOnAdditionalCountries branch June 22, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants