fix(cli): use wmill.yaml key consistently for workspace-specific items (#8900)

* fix(cli): use wmill.yaml key (not branch name) for workspace-specific filenames

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(cli): resolve --workspace as config key even with --base-url

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* test(integration): assert workspace config key drives filename suffix in git-sync

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Revert "test(integration): assert workspace config key drives filename suffix in git-sync"

This reverts commit 528993fe29.

* fix(cli): filter reserved keys and preserve validation-skip on non-config --workspace

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
hugocasa
2026-04-23 16:31:41 +00:00
committed by GitHub
co-authored by Claude Opus 4.7
parent d6c642b170
commit 1722a7a2af
5 changed files with 265 additions and 35 deletions
+10 -5
View File
@@ -180,20 +180,25 @@ export async function findResourceFile(path: string) {
let contentBasePathJSON = splitPath[0] + "." + splitPath[1] + ".json";
let contentBasePathYAML = splitPath[0] + "." + splitPath[1] + ".yaml";
// Check for branch-specific metadata files first
// Check for workspace-specific metadata files first, using the wmill.yaml
// config key for the current git branch as the filename suffix (falls back
// to the branch name when no matching workspace entry exists).
const currentBranch = getCurrentGitBranch();
const wsName = currentBranch
? await specificItems.resolveWsNameForGitBranch(currentBranch)
: null;
const candidates = [contentBasePathJSON, contentBasePathYAML];
if (currentBranch) {
// Add branch-specific candidates at the beginning (higher priority)
if (wsName) {
// Add workspace-specific candidates at the beginning (higher priority)
const branchSpecificJSON = specificItems.toWorkspaceSpecificPath(
contentBasePathJSON,
currentBranch
wsName
);
const branchSpecificYAML = specificItems.toWorkspaceSpecificPath(
contentBasePathYAML,
currentBranch
wsName
);
candidates.unshift(branchSpecificJSON, branchSpecificYAML);
}