Skip to content

Commit f7eb1b7

Browse files
Copilotvobu
andauthored
feat: enhance deployment results with file paths, hierarchical grouping, and resource type indicators (#30)
* Initial plan * feat: enhance deployment logging with file paths and building block indicators Co-authored-by: vobu <6573426+vobu@users.noreply.github.com> * test(deploy): add comprehensive tests for deployment logging enhancements Co-authored-by: vobu <6573426+vobu@users.noreply.github.com> * refactor: use logger.info consistently instead of console.log Co-authored-by: vobu <6573426+vobu@users.noreply.github.com> * refactor: move file paths to deployment results table Per feedback, file names and paths now appear as a column in the results table after successful deployment, rather than being listed before deployment. Building block indicators (🧱) are preserved in the File column. Co-authored-by: vobu <6573426+vobu@users.noreply.github.com> * refactor: simplify redundant ternary operators Cleaned up unnecessary ternary checks - Map.get() already returns undefined for missing keys. Co-authored-by: vobu <6573426+vobu@users.noreply.github.com> * test: add batched deployment test for process application Added comprehensive test that verifies batched deployment behavior when .process-application file is present. The test verifies: - Batch deployment note is shown - All resources in the directory are deployed together (2 files) - Deployment attempt is made with all resources as a batch Co-authored-by: vobu <6573426+vobu@users.noreply.github.com> * refactor: improve test code quality and robustness - Increased timeout to 10s for slower CI environments - Extracted executeDeployment helper to reduce code duplication - Improved error handling for successful deployment scenario Co-authored-by: vobu <6573426+vobu@users.noreply.github.com> * refactor: group process application resources in table instead of note Per feedback, removed the general "(batch deployment from process application)" note and instead mark process application resources with 📦 emoji in the results table, grouped alongside building blocks and standalone resources. - Added isProcessApplication field to ResourceFile interface - Detect .process-application files during resource collection - Updated sorting to group: building blocks → process apps → regular - Show 📦 emoji for process application resources in table - Updated tests to reflect new behavior (no more batch note) - Updated documentation with new output examples Co-authored-by: vobu <6573426+vobu@users.noreply.github.com> * test: add mixed resources sample * test: add simple BPMN process definition * fix: properly group nested resources in building blocks and process applications Resources are now correctly grouped based on their folder hierarchy, not just immediate parent. All resources in a folder with _bb-* or .process-application (including nested subdirectories) are grouped together. - Added findGroupRoot() to traverse up directory tree - Added groupPath field to track which group a resource belongs to - Updated sorting to group by groupPath within BB and PA categories - Added test for mixed resources with nested structure - Updated documentation to explain hierarchical grouping Co-authored-by: vobu <6573426+vobu@users.noreply.github.com> * refactor: improve cross-platform path handling and type safety - Use relative() for cross-platform path comparison instead of startsWith() - Improve type safety with discriminated union for findGroupRoot return type - Ensures proper behavior on Windows with different drive letters Co-authored-by: vobu <6573426+vobu@users.noreply.github.com> * docs: update README to include deployment from multiple paths * refactor: enhance deployment log output by grouping resources and normalizing structure * chore: update version to 2.0.0-alpha.4 in package.json --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: vobu <6573426+vobu@users.noreply.github.com> Co-authored-by: Volker Buzek <dev@metalodge.com>
1 parent 8ad122a commit f7eb1b7

File tree

13 files changed

+498
-40
lines changed

13 files changed

+498
-40
lines changed

EXAMPLES.md

Lines changed: 70 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,76 @@ c8 deploy
224224
# Deploys all BPMN/DMN/Form files in specified directory and subdirectories
225225
c8 deploy ./my-project
226226

227-
# Building block folders (containing _bb- in name) are prioritized
228-
# Order: _bb-* folders first, then other files
229-
```
227+
# Building block folders (containing _bb- in name) are prioritized and marked with 🧱
228+
# Process applications (folders with .process-application file) are marked with 📦
229+
# Example output:
230+
# Deploying 4 resource(s)...
231+
# ✓ Deployment successful [Key: 123456789]
232+
#
233+
# File | Type | ID | Version | Key
234+
# ----------------------------------|---------|-----------------|---------|-------------------
235+
# 🧱 _bb-shared/common-process.bpmn | Process | common-process | 1 | 2251799813685249
236+
# 📦 my-app/process.bpmn | Process | my-proc | 1 | 2251799813685250
237+
# 📦 my-app/decision.dmn | Decision| my-dec | 1 | 2251799813685251
238+
# processes/order-process.bpmn | Process | order-process | 1 | 2251799813685252
239+
```
240+
241+
### Process Application Deployment
242+
243+
If a directory contains a `.process-application` file, **all resources in that directory and its subdirectories** are marked with the 📦 emoji in the deployment results table. Resources are grouped together based on their location:
244+
245+
```bash
246+
# Directory structure:
247+
# my-project/
248+
# _bb-shared/
249+
# common.bpmn
250+
# nested/
251+
# util.bpmn # Also part of _bb-shared group
252+
# my-app/
253+
# .process-application
254+
# process.bpmn
255+
# subfolder/
256+
# form.form # Also part of my-app group
257+
# standalone.bpmn
258+
259+
c8 deploy ./my-project
260+
261+
# Output shows resources grouped by their folder hierarchy:
262+
# Deploying 5 resource(s)...
263+
# ✓ Deployment successful [Key: 123456789]
264+
#
265+
# File | Type | ID | Version | Key
266+
# --------------------------------|---------|---------------|---------|-------------------
267+
# 🧱 _bb-shared/common.bpmn | Process | common | 1 | 2251799813685249
268+
# 🧱 _bb-shared/nested/util.bpmn | Process | util | 1 | 2251799813685250
269+
# 📦 my-app/process.bpmn | Process | my-proc | 1 | 2251799813685251
270+
# 📦 my-app/subfolder/form.form | Form | form-id | 1 | 2251799813685252
271+
# standalone.bpmn | Process | standalone | 1 | 2251799813685253
272+
```
273+
274+
### Resource Grouping Rules
275+
276+
Resources are automatically grouped based on their folder hierarchy:
277+
278+
1. **Building Block Groups** - All resources in a folder with `_bb-` in the name (and its subdirectories) belong to the same group and are marked with 🧱
279+
2. **Process Application Groups** - All resources in a folder containing `.process-application` file (and its subdirectories) belong to the same group and are marked with 📦
280+
3. **Standalone Resources** - Resources not in a building block or process application folder are treated as standalone
281+
282+
In the deployment output:
283+
- Building block groups are listed first, grouped together
284+
- Process application groups are listed next, grouped together
285+
- Standalone resources are listed last
286+
287+
### Deployment Output Details
288+
289+
The deployment results table shows:
290+
- **File column** - Shows the file name with relative path
291+
- 🧱 emoji indicates building block resources (from `_bb-*` folders, including nested files)
292+
- 📦 emoji indicates process application resources (from folders with `.process-application` file, including nested files)
293+
- **Type column** - Resource type (Process, Decision, or Form)
294+
- **ID column** - The process/decision/form ID
295+
- **Version column** - Version number assigned by Camunda
296+
- **Key column** - Unique key assigned by Camunda
230297

231298
### Important: Duplicate Process IDs
232299

IMPLEMENTATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ All requirements from the plan have been successfully implemented and tested.
4343
- **Jobs** (`jobs.ts`): list, activate, complete, fail
4444
- **Messages** (`messages.ts`): publish, correlate
4545
- **Topology** (`topology.ts`): get cluster topology
46-
- **Deployments** (`deployments.ts`): deploy with `_bb-` folder prioritization and duplicate ID validation
46+
- **Deployments** (`deployments.ts`): deploy with `_bb-` folder prioritization, duplicate ID validation, results table with file paths, building block indicators (🧱), and process application indicators (📦 for folders with `.process-application` file)
4747
- **Run** (`run.ts`): deploy + create process instance
4848
- **Profiles** (`profiles.ts`): list, add, remove
4949
- **Session** (`session.ts`): use profile/tenant, output format

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ A minimal-dependency CLI for Camunda 8 operations built on top of `@camunda8/orc
99
- **Profile Management**: Store and manage multiple cluster configurations
1010
- **Camunda Modeler Integration**: Automatically import and use profiles from Camunda Modeler
1111
- **Plugin System**: Extend c8ctl with custom commands via npm packages
12-
- **Building Block Deployment**: Automatic prioritization of `*_bb-*` folders during deployment
12+
- **Building Block Deployment**: Automatic prioritization of `*_bb-*` folders during deployment, marked with 🧱 in results
13+
- **Process Application Support**: Resources in folders with `.process-application` file marked with 📦 in results
14+
- **Enhanced Deployment Results**: Table view showing file paths, visual indicators, resource details, and versions
1315
- **Watch Mode**: Monitors a folder for changes to `*.{bpmn,dmn,form}` and auto-redeploys
1416
- **Flexible Output**: Switch between human-readable text and JSON output modes
1517

@@ -101,6 +103,9 @@ c8ctl deploy ./my-process.bpmn
101103
# Deploy current directory
102104
c8ctl deploy
103105

106+
# Deploy from multiple paths
107+
c8ctl deploy ./processes ./forms ./building-blocks
108+
104109
# Watch mode (using alias 'w')
105110
c8ctl w
106111
c8ctl watch

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@camunda8/cli",
3-
"version": "2.0.0-alpha.2",
3+
"version": "2.0.0-alpha.4",
44
"description": "Camunda 8 CLI - minimal-dependency CLI for Camunda 8 operations",
55
"type": "module",
66
"engines": {

0 commit comments

Comments
 (0)