Skip to content

fix(cloud): exclude config-shaped files from flow discovery - #114

Merged
finalerock44 merged 1 commit into
devfrom
fix/99-exclude-config-shaped-files
Aug 10, 2026
Merged

fix(cloud): exclude config-shaped files from flow discovery#114
finalerock44 merged 1 commit into
devfrom
fix/99-exclude-config-shaped-files

Conversation

@finalerock44

@finalerock44 finalerock44 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Flow discovery excluded config files by filename: literally config.yaml / config.yml, plus the exact --config target. A second workspace config sharing the folder (config_build.yml alongside config_update.yml, as when one folder serves several CI workflows) survived discovery, got parsed as a flow, and failed with "Expected an array of steps".

Add isWorkspaceConfigFile(), which classifies by shape rather than filename: no --- separator, a top-level map, and at least one workspace-config-only key. Requiring a recognised key keeps a flow that is merely missing its --- separator loud rather than silently dropped. Applied in plan() after applyFlowGlobs so it covers both the glob and default branches, and in planSingleFile so a custom-named config passed as the input gets the existing "pass the workspace folder path" error.

Also fixes the sibling path-matching bugs in applyFlowGlobs, which are the same defect family. --config is now resolved once in plan() and both branches compare normalised absolute paths:

  • the default branch used file.endsWith(configFile), so --config ./x.yml failed to match and --config g.yml would have dropped flow-config.yml
  • the glob branch compared a workspace-relative match against path.basename(configFile), which only matched when the config sat at the workspace root
  • the config.yaml / config.yml name checks are anchored to the basename, so a genuine flow named my-config.yaml is no longer dropped; a real config with that name is still excluded, by shape

The --exclude-flows workaround is no longer needed. The hand-rolled extension and .app-bundle checks in the glob branch are replaced with the existing isFlowFile helper, which does exactly that.

Closes #99

What & why

Type of change

  • fix — bug fix
  • feat — new feature
  • perf — performance improvement
  • refactor — code change that's neither a fix nor a feature
  • docs — documentation only
  • chore / ci / build / test — tooling, no user-facing change
  • Breaking change (title has ! or PR notes a BREAKING CHANGE:)

Checklist

  • PR title follows the Conventional Commits format (see comment above)
  • pnpm lint passes
  • pnpm typecheck passes
  • pnpm build passes
  • I have not bumped the version or edited CHANGELOG.md (release-please handles this)
  • I have signed the CLA (the bot will prompt on first contribution)
  • Docs / README.md / STYLE_GUIDE.md updated if behaviour or output changed

How to test


View with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is enabled.

Flow discovery excluded config files by filename: literally config.yaml /
config.yml, plus the exact --config target. A second workspace config sharing
the folder (config_build.yml alongside config_update.yml, as when one folder
serves several CI workflows) survived discovery, got parsed as a flow, and
failed with "Expected an array of steps".

Add isWorkspaceConfigFile(), which classifies by shape rather than filename: no
`---` separator, a top-level map, and at least one workspace-config-only key.
Requiring a recognised key keeps a flow that is merely missing its `---`
separator loud rather than silently dropped. Applied in plan() after
applyFlowGlobs so it covers both the glob and default branches, and in
planSingleFile so a custom-named config passed as the input gets the existing
"pass the workspace folder path" error.

Also fixes the sibling path-matching bugs in applyFlowGlobs, which are the same
defect family. --config is now resolved once in plan() and both branches compare
normalised absolute paths:

- the default branch used `file.endsWith(configFile)`, so `--config ./x.yml`
  failed to match and `--config g.yml` would have dropped `flow-config.yml`
- the glob branch compared a workspace-relative match against
  `path.basename(configFile)`, which only matched when the config sat at the
  workspace root
- the config.yaml / config.yml name checks are anchored to the basename, so a
  genuine flow named my-config.yaml is no longer dropped; a real config with
  that name is still excluded, by shape

The `--exclude-flows` workaround is no longer needed. The hand-rolled extension
and .app-bundle checks in the glob branch are replaced with the existing
isFlowFile helper, which does exactly that.

Closes #99
@finalerock44 finalerock44 self-assigned this Aug 10, 2026
@claude

claude Bot commented Aug 10, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@finalerock44
finalerock44 merged commit 13d01ee into dev Aug 10, 2026
11 checks passed
@finalerock44
finalerock44 deleted the fix/99-exclude-config-shaped-files branch August 10, 2026 17:49
finalerock44 added a commit that referenced this pull request Aug 10, 2026
Retargets the pending dev beta release from 5.2.0-beta.5 to 5.3.1-beta.1.

The beta line is still numbered off 5.2.0 because the stable 5.3.0 release never
completed: the promote PR (#108) merged with `Release-As: 5.3.0`, but the
release-please PR it generated (#109) is still open, so no v5.3.0 tag exists and
`.release-please-manifest-beta.json` sat at 5.2.0-beta.4. Release-please
therefore proposed 5.2.0-beta.5 (#115) for the flow-discovery fix in #114, which
is behind the stable line rather than ahead of it.

The stable line is 5.3.0, so the next beta belongs on the 5.3.1 patch series.

This commit is intentionally empty — the payload is the footer below, which
release-please reads to pin the exact version of the next dev release. It
applies once and needs no follow-up cleanup, unlike a `release-as` key in
release-please-config-beta.json, which would pin every subsequent dev release
until removed.

Release-As: 5.3.1-beta.1
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.

dcd cloud: --config doesn't exclude other config-shaped files in the same flow folder

1 participant