Skip to content

fix: apply workspace-scoped override properties - #311

Merged
Alexander Zaslonov (azaslonov) merged 3 commits into
mainfrom
copilot/fix-workspace-scoped-overrides
Oct 10, 2026
Merged

Alexander Zaslonov (azaslonov) merged 3 commits into
mainfrom
copilot/fix-workspace-scoped-overrides

Conversation

Copilot AI commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

The CLI already parsed child sections nested under a workspaces entry in environment override files, but the override merger ignored them. Only the workspace container's own properties were applied. As a result, workspace APIs, backends, loggers and other child resources were published with source-environment values.

workspaces:
  - name: my-workspace
    apis:
      - name: my-api
        properties:
          serviceUrl: "https://prod.example.com"   # previously ignored

Changes

  • Scope resolution (override-merger.ts)
    • New resolveOverrideScope(): if descriptor.workspace is set (and the resource is not the Workspace container itself), it finds the workspace entry (case-insensitive) and builds an OverrideConfig from that entry's children. Only the 11 child sections the config loader accepts are included.
    • applyOverrides resolves this scope first, then reuses the existing direct, child and grandchild lookups. This covers workspace API diagnostics, operations, policies and releases, operation policies, and product policies with no duplicated logic.
  • Behavior change: top-level sections (e.g. top-level apis) no longer apply to workspace-scoped resources with the same name. This matches the Toolkit's parent-chain resolution. Workspace overrides likewise never apply to service-level resources.
  • Named values: hasNamedValueOverride(name, overrides, workspace?) now checks the workspace's namedValues section. Its callers in publish-service.ts and secret-redaction-guard.ts pass descriptor.workspace. Auto-generated workspace named values with an explicit override are therefore published and scanned instead of skipped.
  • Docs: replaced the Workspace-scoped override properties not applied #118 known-limitation note in environment-overrides.md with a description of the scoping rules.
  • Tests: added a workspace-scoped overrides suite to override-merger.test.ts. It covers the container itself, top-level child resources, nested API and product sub-resources, isolation between service and workspace scope in both directions, and hasNamedValueOverride.

Reviewer notes

  • Workspace-level policies are still not overridable: the config loader doesn't accept a policies section under a workspace, and the issue didn't ask for one.
  • Code review against the constitution (.squad/identity/constitution.md) is requested, as required for changes under src/.

Copilot AI balanced review requested due to automatic review settings October 2, 2026 23:04

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.

Copilot wasn't able to review any files in this pull request. Check if the Files changed in this pull request are included in default exclusions.

Closes #118

Co-authored-by: azaslonov <2320302+azaslonov@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 2, 2026 23:08
Copilot AI changed the title [WIP] Fix workspace-scoped override properties not applied fix: apply workspace-scoped override properties Oct 2, 2026

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

Review effort: Lite
Findings: 2 Medium severity · 2 Low severity

Open (4)

Comment thread src/services/override-merger.ts Resolved
Comment thread src/services/override-merger.ts Resolved
Comment thread docs/guides/environment-overrides.md Resolved
@azaslonov

Copy link
Copy Markdown
Member

Copilot resolve the merge conflicts in this pull request

…-scoped-overrides

# Conflicts:
#	docs/guides/environment-overrides.md
#	src/services/override-merger.ts
#	tests/unit/services/override-merger.test.ts

Co-authored-by: azaslonov <2320302+azaslonov@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 9, 2026 23:49

Copilot AI commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Copilot resolve the merge conflicts in this pull request

Resolved the merge conflicts, committed, and pushed the merge as 87cebd5.

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.

@azaslonov
Alexander Zaslonov (azaslonov) marked this pull request as ready for review October 10, 2026 00:04
@azaslonov
Alexander Zaslonov (azaslonov) merged commit ab99be6 into main Oct 10, 2026
7 checks passed
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.

Workspace-scoped override properties not applied

4 participants