Skip to content

Fix env var expansion skipping maps inside arrays#199

Merged
intel352 merged 3 commits intomainfrom
copilot/fix-env-var-expansion-bug
Feb 27, 2026
Merged

Fix env var expansion skipping maps inside arrays#199
intel352 merged 3 commits intomainfrom
copilot/fix-env-var-expansion-bug

Conversation

Copy link
Contributor

Copilot AI commented Feb 27, 2026

  • Fix expandConfigStrings to recurse into map[string]any items inside []any slices
  • Add test for maps-inside-arrays env var expansion (multiple clients, deeply nested scopes)

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix env var expansion in workflow engine Fix env var expansion skipping maps inside arrays Feb 27, 2026
@intel352 intel352 marked this pull request as ready for review February 27, 2026 13:20
Copilot AI review requested due to automatic review settings February 27, 2026 13:20
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 pull request fixes a bug in the expandConfigStrings function where environment variable placeholders like ${VAR} were not being expanded in map[string]any elements inside []any slices. This affected real-world configurations such as OAuth client arrays where credentials are stored as environment variables.

Changes:

  • Added recursive expansion support for maps inside arrays by adding an else if branch in the array iteration logic
  • Added comprehensive test coverage with TestExpandConfigStrings_ArrayOfMaps to verify the fix works correctly

Reviewed changes

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

File Description
engine.go Added else if branch (lines 1000-1001) to recursively expand strings in maps found inside arrays, matching the existing pattern for top-level nested maps
engine_secrets_test.go Added TestExpandConfigStrings_ArrayOfMaps test case (lines 118-142) to verify env var expansion works correctly for maps inside arrays, using OAuth client configuration as a realistic example

@intel352
Copy link
Contributor

@copilot apply changes based on the comments in this thread

…of-maps

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
@intel352 intel352 merged commit 6af33cc into main Feb 27, 2026
14 checks passed
@intel352 intel352 deleted the copilot/fix-env-var-expansion-bug branch February 27, 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.

3 participants