Skip to content

Cut 4960 eu tenant support#715

Merged
gweinjc merged 49 commits into
masterfrom
CUT-4960_EUTenantSupport
Dec 3, 2025
Merged

Cut 4960 eu tenant support#715
gweinjc merged 49 commits into
masterfrom
CUT-4960_EUTenantSupport

Conversation

@gweinjc
Copy link
Copy Markdown
Contributor

@gweinjc gweinjc commented Nov 21, 2025

Issues

What does this solve?

This pull request focuses on improving consistency, clarity, and maintainability across the CI workflow, editor configuration, and PowerShell scripts. The most significant changes include standardizing naming conventions, specifying dependency versions, enhancing support for EU testing, updating editor and formatting settings, and refactoring PowerShell scripts for better readability and reliability.

Main Changes:

  • Added -JCEnvironment param to Connect-JCOnline and Set-JCSettingsFile functions to allow for admins to change their environment from 'STANDARD' to 'EU'
  • Updated the Settings file to include a configurable JCEnvironment.Location value

Other Changes:

CI Workflow and Dependency Management:

  • Standardized naming from Dependancies to Dependencies throughout the .github/workflows/powershell-module-ci.yml file, including job names, cache keys, and dependencies lists. This improves clarity and consistency in the CI pipeline. [1] [2] [3] [4] [5] [6] [7] [8] [9]
  • Updated required versions for JumpCloud.SDK.V1, JumpCloud.SDK.V2, and JumpCloud.SDK.DirectoryInsights modules from latest to 0.1.1, ensuring reproducible builds and reducing risk of breaking changes from upstream updates.

EU Testing Support:

  • Added new environment variables (PESTER_EU_APIKEY, PESTER_EU_ORGID) and corresponding PowerShell global variables to enable Pester testing for EU organizations, expanding test coverage. [1] [2]

Editor and Formatting Configuration:

  • Updated .vscode/settings.json to use the correct cSpell.enabledFileTypes format and added extensive PowerShell formatting options, improving code quality and consistency for contributors. [1] [2]

PowerShell Script Refactoring:

  • Refactored Build-HelpFiles.ps1 to use consistent lowercase keywords (param, try, catch, if, switch, foreach, default), added status output for help file generation steps, and enabled PlatyPS logging for better traceability and error handling. [1] [2] [3] [4] [5] [6] [7] [8] [9]
  • Improved filtering logic in jcapiToSupportSync.ps1 to exclude additional unwanted parameters (apiHost, consoleHost), and standardized PowerShell keyword casing for better readability and maintainability. [1] [2] [3]

Is there anything particularly tricky?

  • This requires the v0.1.1 versions of the SDKs, which are currently hidden

How should this be tested?

  1. Install the latest versions of the SDKs
Install-Module -Name JumpCloud.SDK.DirectoryInsights -RequiredVersion 0.1.1 -Force
Install-Module -Name JumpCloud.SDK.V1 -RequiredVersion 0.1.1 -Force
Install-Module -Name JumpCloud.SDK.V2 -RequiredVersion 0.1.1 -Force
  1. Import the Module
Import-Module /Users/USERNAME/Documents/GitHub/support/PowerShell/JumpCloud Module/JumpCloud.psd1 -force
  1. Attempt to connect to an EU organization via Connect-JCOnline
### Connect to EU Org
Connect-JCOnline -JumpCloudApiKey 'EUAPIKEY' -JCEnvironment 'EU'

### Get a user to validate that it works
Get-JCUser | Select -First 1
  1. Close your terminal and reopen and run Connect-JCOnline as you would normally
Import-Module /Users/USERNAME/Documents/GitHub/support/PowerShell/JumpCloud Module/JumpCloud.psd1 -force
Connect-JCOnline -JumpCloudApiKey 'EUAPIKEY'

### Get a user to validate that it works
Get-JCUser | Select -First 1
  1. Close your terminal again and reopen and run the following to change to standard
Import-Module /Users/USERNAME/Documents/GitHub/support/PowerShell/JumpCloud Module/JumpCloud.psd1 -force
Set-JCSettingsFile -JCEnvironmentLocation 'STANDARD'
Connect-JCOnline -JumpCloudApiKey 'USAPIKEY'

### Get a user to validate that it works
Get-JCUser | Select -First 1

Expanded the JCEnvironment parameter to accept 'EU' and 'US' values, updated help message, and added corresponding URL base path for the EU region. This allows users to connect to JumpCloud organizations in the EU region.
Added detailed PowerShell code formatting options to .vscode/settings.json, including whitespace, brace, indentation, and alias correction preferences for improved code consistency and readability.
Introduces a new 'JCEnvironment' section to the settings file to support EU-based organizations. Updates the module banner message to inform users about EU environment support and relevant configuration commands.
Changed region values from 'US' to 'STANDARD' and updated help messages and default values accordingly. Improved environment variable assignment and ensured compatibility with new region naming conventions.
Get-JCReport now checks the JCEnvironment variable and uses the EU API endpoint for report artifact retrieval if set to 'EU'. This improves compatibility for organizations hosted in the EU region.
Added checks to verify JCEnvironment.location changes in addition to parallelOverride. Ensures both settings are properly updated and tested in Set-JCSettingsFile.
@gweinjc gweinjc added minor minor version release PowerShell Module Release for JumpCloud PowerShell Module labels Nov 21, 2025
@gweinjc gweinjc requested a review from a team as a code owner November 21, 2025 18:28
@gweinjc gweinjc requested a review from kmaranionjc November 21, 2025 18:28
gweinjc and others added 16 commits November 21, 2025 11:58
Changed the environment location comparison from 'US' to 'STANDARD' in Connect-JCOnline.ps1 to align with updated environment naming conventions.
Replaces dynamic assignment of JCEnvironment Location with a static value of 'STANDARD' in New-JCSettingsFile.ps1. This simplifies the logic and ensures consistent default behavior.
The JCEnvironment value in the generated config file now reflects the JCEnvironment environment variable if set, defaulting to 'STANDARD' otherwise. This allows for dynamic configuration based on environment settings.
Updated Connect-JCOnline.ps1 to set PSDefaultParameterValues in the global scope for API and Console hosts. Also switched to using $env:JCEnvironment in the environment switch statement for consistency.
Refactored environment variable assignment to prioritize JCConfig.JCEnvironment.Location when not 'STANDARD'. Added fallback logic for setting JCEnvironment to 'STANDARD' if no value is provided, improving reliability and clarity in environment configuration.
Introduces PESTER_EU_APIKEY and PESTER_EU_ORGID as environment variables in the PowerShell module CI workflow. These are set as global variables for use in the CI process, supporting EU-specific testing or deployment.
Introduced a new test context for EU organization scenarios, verifying connection using EU-specific API key and Org ID parameters. Also standardized conditional statements to use lowercase 'if', 'elseif', and 'else' for consistency.
Separated JCEnvironment location change tests into a dedicated test case and added assertions for both environment and global variables. This improves clarity and coverage of the Set-JCSettingsFile functionality.
@jworkmanjc jworkmanjc added major and removed minor minor version release labels Dec 2, 2025
@gweinjc gweinjc requested a review from jworkmanjc December 2, 2025 17:53
Comment thread .github/workflows/powershell-module-ci.yml
Comment thread PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1
Comment thread PowerShell/Deploy/Build-HelpFiles.ps1
Comment thread PowerShell/JumpCloud Module/Docs/PlatyPS.log Outdated
@jworkmanjc jworkmanjc self-requested a review December 3, 2025 16:02
Copy link
Copy Markdown
Contributor

@kmaranionjc kmaranionjc left a comment

Choose a reason for hiding this comment

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

Looks good on my end. Great work here!

@gweinjc gweinjc merged commit e6fc67b into master Dec 3, 2025
48 of 52 checks passed
@gweinjc gweinjc deleted the CUT-4960_EUTenantSupport branch December 3, 2025 17:45
@gweinjc gweinjc temporarily deployed to PublishToPSGallery December 3, 2025 17:47 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

major PowerShell Module Release for JumpCloud PowerShell Module

Development

Successfully merging this pull request may close these issues.

3 participants