🔍 Duplicate Code Detected: Repo layout config duplication
Analysis of commit 58a9758
Assignee: @copilot
Summary
The repository/workspace layout (release group names → directories + independent package locations) is duplicated in two separate configuration files:
fluidBuild.config.cjs (repoPackages)
_buildProject.config.cjs (buildProject.workspaces)
These two blocks describe the same underlying repo topology (client/build-tools/server/gitrest/historian + common/tools packages) in two different schemas, creating a drift risk and requiring parallel updates.
Duplication Details
Pattern: Duplicated repo/workspace layout mapping
Impact Analysis
- Maintainability: Any workspace/release-group directory change (or addition/removal of an independent package workspace) must be made twice, with no automated consistency enforcement.
- Bug Risk: Drift between these configs can cause build-tooling to disagree about workspace membership, leading to confusing CI/build behavior.
- Code Bloat: This is effectively two parallel sources-of-truth for the same repo topology.
Refactoring Recommendations
-
Introduce a single canonical repo-layout module
- Extract the shared repo layout definition into a dedicated file (e.g.
repoLayout.config.cjs), then have both fluidBuild.config.cjs and _buildProject.config.cjs import/derive their specific shapes from it.
- Estimated effort: Medium
- Benefits: Eliminates drift risk; a single edit updates both configs.
-
Add a lightweight consistency check
- Add a build/policy check that validates both configs resolve to the same set of directories/workspaces.
- Estimated effort: Low–Medium
- Benefits: Prevents future divergence even if full refactor is deferred.
Implementation Checklist
Analysis Metadata
- Analyzed Files: 5 (only
.cjs/.mjs present in this checkout)
- Detection Method: Serena semantic code analysis + manual verification
- Commit: 58a9758
- Analysis Date: 2026-03-12T08:00:19.626Z
AI generated by Duplicate Code Detector
To add this workflow in your repository, run gh aw add github/gh-aw/.github/workflows/duplicate-code-detector.md@94662b1dee8ce96c876ba9f33b3ab8be32de82a4. See usage guide.
🔍 Duplicate Code Detected: Repo layout config duplication
Analysis of commit 58a9758
Assignee:
@copilotSummary
The repository/workspace layout (release group names → directories + independent package locations) is duplicated in two separate configuration files:
fluidBuild.config.cjs(repoPackages)_buildProject.config.cjs(buildProject.workspaces)These two blocks describe the same underlying repo topology (client/build-tools/server/gitrest/historian + common/tools packages) in two different schemas, creating a drift risk and requiring parallel updates.
Duplication Details
Pattern: Duplicated repo/workspace layout mapping
Severity: Medium
Occurrences: 2
Locations:
fluidBuild.config.cjs(lines 260-294)_buildProject.config.cjs(lines 33-205)Code Sample (excerpt from
fluidBuild.config.cjs):Code Sample (excerpt from
_buildProject.config.cjs):Impact Analysis
Refactoring Recommendations
Introduce a single canonical repo-layout module
repoLayout.config.cjs), then have bothfluidBuild.config.cjsand_buildProject.config.cjsimport/derive their specific shapes from it.Add a lightweight consistency check
Implementation Checklist
_buildProject.config.cjsmay be renamed torepoLayout.config.cjsin the future)Analysis Metadata
.cjs/.mjspresent in this checkout)