abapgit-agent 1.8.1 → 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/abap/CLAUDE.md +130 -33
- package/package.json +1 -1
package/abap/CLAUDE.md
CHANGED
|
@@ -73,30 +73,38 @@ The folder is configured in `.abapGitAgent` (property: `folder`):
|
|
|
73
73
|
|
|
74
74
|
**Each ABAP object requires an XML metadata file for abapGit to understand how to handle it.**
|
|
75
75
|
|
|
76
|
-
| Object Type | ABAP File (if folder=/src/) | XML File |
|
|
77
|
-
|
|
78
|
-
| Class | `src/zcl_*.clas.abap` | `src/zcl_*.clas.xml` |
|
|
79
|
-
| Interface | `src/zif_*.intf.abap` | `src/zif_*.intf.xml` |
|
|
80
|
-
| Program | `src/z*.prog.abap` | `src/z*.prog.xml` |
|
|
81
|
-
| Table | `src/z*.tabl.abap` | `src/z*.tabl.xml` |
|
|
82
|
-
| CDS View | `src/zc_*.ddls.asddls` | `src/zc_*.ddls.xml` |
|
|
76
|
+
| Object Type | ABAP File (if folder=/src/) | XML File | Details |
|
|
77
|
+
|-------------|------------------------------|----------|---------|
|
|
78
|
+
| Class | `src/zcl_*.clas.abap` | `src/zcl_*.clas.xml` | See `guidelines/08_abapgit.md` |
|
|
79
|
+
| Interface | `src/zif_*.intf.abap` | `src/zif_*.intf.xml` | See `guidelines/08_abapgit.md` |
|
|
80
|
+
| Program | `src/z*.prog.abap` | `src/z*.prog.xml` | See `guidelines/08_abapgit.md` |
|
|
81
|
+
| Table | `src/z*.tabl.abap` | `src/z*.tabl.xml` | See `guidelines/08_abapgit.md` |
|
|
82
|
+
| **CDS View Entity** | `src/zc_*.ddls.asddls` | `src/zc_*.ddls.xml` | **Use by default** - See `guidelines/04_cds.md` |
|
|
83
|
+
| CDS View (legacy) | `src/zc_*.ddls.asddls` | `src/zc_*.ddls.xml` | Only if explicitly requested - See `guidelines/04_cds.md` |
|
|
83
84
|
|
|
84
|
-
**
|
|
85
|
+
**IMPORTANT: When user says "create CDS view", create CDS View Entity by default.**
|
|
86
|
+
|
|
87
|
+
**Why:** Modern S/4HANA standard, simpler (no SQL view), no namespace conflicts.
|
|
88
|
+
|
|
89
|
+
**For complete XML templates, DDL examples, and detailed comparison:**
|
|
90
|
+
- **CDS Views**: `guidelines/04_cds.md`
|
|
91
|
+
- **XML templates**: `guidelines/08_abapgit.md`
|
|
85
92
|
|
|
86
93
|
---
|
|
87
94
|
|
|
88
|
-
### 4. Use Syntax Command Before Commit (for CLAS, INTF, PROG)
|
|
95
|
+
### 4. Use Syntax Command Before Commit (for CLAS, INTF, PROG, DDLS)
|
|
89
96
|
|
|
90
97
|
```
|
|
91
98
|
❌ WRONG: Make changes → Commit → Push → Pull → Find errors → Fix → Repeat
|
|
92
99
|
✅ CORRECT: Make changes → Run syntax → Fix locally → Commit → Push → Pull → Done
|
|
93
100
|
```
|
|
94
101
|
|
|
95
|
-
**For CLAS, INTF, PROG files**: Run `syntax` command BEFORE commit to catch errors early.
|
|
102
|
+
**For CLAS, INTF, PROG, DDLS files**: Run `syntax` command BEFORE commit to catch errors early.
|
|
96
103
|
|
|
97
104
|
```bash
|
|
98
105
|
# Check syntax of local code (no commit/push needed)
|
|
99
106
|
abapgit-agent syntax --files src/zcl_my_class.clas.abap
|
|
107
|
+
abapgit-agent syntax --files src/zc_my_view.ddls.asddls
|
|
100
108
|
|
|
101
109
|
# Check multiple INDEPENDENT files
|
|
102
110
|
abapgit-agent syntax --files src/zcl_utils.clas.abap,src/zcl_logger.clas.abap
|
|
@@ -260,15 +268,15 @@ abapgit-agent unit --files src/zcl_test1.clas.testclasses.abap,src/zcl_test2.cla
|
|
|
260
268
|
3. Write code → place in correct folder (e.g., src/zcl_*.clas.abap)
|
|
261
269
|
│
|
|
262
270
|
▼
|
|
263
|
-
4. Syntax check (for CLAS, INTF, PROG only)
|
|
271
|
+
4. Syntax check (for CLAS, INTF, PROG, DDLS only)
|
|
264
272
|
│
|
|
265
|
-
├─► CLAS/INTF/PROG → abapgit-agent syntax --files <file>
|
|
273
|
+
├─► CLAS/INTF/PROG/DDLS → abapgit-agent syntax --files <file>
|
|
266
274
|
│ │
|
|
267
275
|
│ ├─► Errors? → Fix locally (no commit needed), re-run syntax
|
|
268
276
|
│ │
|
|
269
277
|
│ └─► Clean ✅ → Proceed to commit
|
|
270
278
|
│
|
|
271
|
-
└─► Other types (
|
|
279
|
+
└─► Other types (FUGR, TABL, etc.) → Skip syntax, go to commit
|
|
272
280
|
│
|
|
273
281
|
▼
|
|
274
282
|
5. Commit and push → git add . && git commit && git push
|
|
@@ -301,34 +309,88 @@ abapgit-agent unit --files src/zcl_test1.clas.testclasses.abap,src/zcl_test2.cla
|
|
|
301
309
|
|
|
302
310
|
**IMPORTANT**:
|
|
303
311
|
- **Use `syntax` BEFORE commit** for CLAS/INTF/PROG/DDLS - catches errors early, no git pollution
|
|
304
|
-
- **Syntax checks files INDEPENDENTLY** -
|
|
305
|
-
- **For dependent files** (interface + class
|
|
312
|
+
- **Syntax checks files INDEPENDENTLY** - syntax checker doesn't have access to uncommitted files
|
|
313
|
+
- **For dependent files** (interface + class): Create/activate underlying object FIRST, then dependent object (see workflow below)
|
|
306
314
|
- **DDLS requires proper annotations** - CDS views need `@AbapCatalog.sqlViewName`, view entities don't
|
|
307
315
|
- **ALWAYS push to git BEFORE running pull** - abapGit reads from git
|
|
308
316
|
- **Use `inspect` AFTER pull** for unsupported types or if pull fails
|
|
309
317
|
|
|
318
|
+
**Working with dependent objects (RECOMMENDED APPROACH):**
|
|
319
|
+
|
|
320
|
+
When creating objects with dependencies (e.g., interface → class), create and activate the underlying object FIRST:
|
|
321
|
+
|
|
322
|
+
```bash
|
|
323
|
+
# Step 1: Create interface, syntax check, commit, activate
|
|
324
|
+
vim src/zif_my_interface.intf.abap
|
|
325
|
+
abapgit-agent syntax --files src/zif_my_interface.intf.abap # ✅ Works (no dependencies)
|
|
326
|
+
git add src/zif_my_interface.intf.abap src/zif_my_interface.intf.xml
|
|
327
|
+
git commit -m "feat: add interface"
|
|
328
|
+
git push
|
|
329
|
+
abapgit-agent pull --files src/zif_my_interface.intf.abap # Interface now activated
|
|
330
|
+
|
|
331
|
+
# Step 2: Create class, syntax check, commit, activate
|
|
332
|
+
vim src/zcl_my_class.clas.abap
|
|
333
|
+
abapgit-agent syntax --files src/zcl_my_class.clas.abap # ✅ Works (interface already activated)
|
|
334
|
+
git add src/zcl_my_class.clas.abap src/zcl_my_class.clas.xml
|
|
335
|
+
git commit -m "feat: add class implementing interface"
|
|
336
|
+
git push
|
|
337
|
+
abapgit-agent pull --files src/zcl_my_class.clas.abap
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
**Benefits:**
|
|
341
|
+
- ✅ Syntax checking works for both objects
|
|
342
|
+
- ✅ Each step is validated independently
|
|
343
|
+
- ✅ Easier to debug if something fails
|
|
344
|
+
- ✅ Cleaner workflow
|
|
345
|
+
|
|
346
|
+
**Alternative approach (when interface design is uncertain):**
|
|
347
|
+
|
|
348
|
+
If the interface might need changes while implementing the class, commit both together:
|
|
349
|
+
|
|
350
|
+
```bash
|
|
351
|
+
# Create both files
|
|
352
|
+
vim src/zif_my_interface.intf.abap
|
|
353
|
+
vim src/zcl_my_class.clas.abap
|
|
354
|
+
|
|
355
|
+
# Skip syntax (files depend on each other), commit together
|
|
356
|
+
git add src/zif_my_interface.intf.abap src/zif_my_interface.intf.xml
|
|
357
|
+
git add src/zcl_my_class.clas.abap src/zcl_my_class.clas.xml
|
|
358
|
+
git commit -m "feat: add interface and implementing class"
|
|
359
|
+
git push
|
|
360
|
+
|
|
361
|
+
# Pull both together
|
|
362
|
+
abapgit-agent pull --files src/zif_my_interface.intf.abap,src/zcl_my_class.clas.abap
|
|
363
|
+
|
|
364
|
+
# Use inspect if errors occur
|
|
365
|
+
abapgit-agent inspect --files src/zcl_my_class.clas.abap
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
**Use this approach when:**
|
|
369
|
+
- ❌ Interface design is still evolving
|
|
370
|
+
- ❌ Multiple iterations expected
|
|
371
|
+
|
|
310
372
|
**Working with mixed file types:**
|
|
311
373
|
When modifying multiple files of different types (e.g., 1 class + 1 CDS view):
|
|
312
|
-
1. Run `syntax` on supported files
|
|
374
|
+
1. Run `syntax` on independent supported files (CLAS, INTF, PROG, DDLS)
|
|
313
375
|
2. Commit ALL files together (including unsupported types)
|
|
314
376
|
3. Push and pull ALL files together
|
|
315
377
|
|
|
316
378
|
Example:
|
|
317
379
|
```bash
|
|
318
|
-
# Check syntax on independent
|
|
319
|
-
abapgit-agent syntax --files src/zcl_my_class.clas.abap,src/
|
|
380
|
+
# Check syntax on independent files only
|
|
381
|
+
abapgit-agent syntax --files src/zcl_my_class.clas.abap,src/zc_my_view.ddls.asddls
|
|
320
382
|
|
|
321
|
-
# Commit and push all files
|
|
322
|
-
git add src/zcl_my_class.clas.abap src/
|
|
323
|
-
git commit -m "feat: add class
|
|
383
|
+
# Commit and push all files
|
|
384
|
+
git add src/zcl_my_class.clas.abap src/zc_my_view.ddls.asddls
|
|
385
|
+
git commit -m "feat: add class and CDS view"
|
|
324
386
|
git push
|
|
325
387
|
|
|
326
388
|
# Pull all files together
|
|
327
|
-
abapgit-agent pull --files src/zcl_my_class.clas.abap,src/
|
|
389
|
+
abapgit-agent pull --files src/zcl_my_class.clas.abap,src/zc_my_view.ddls.asddls
|
|
328
390
|
```
|
|
329
391
|
|
|
330
392
|
**When to use syntax vs inspect vs view**:
|
|
331
|
-
- **syntax**: Check LOCAL code BEFORE commit (CLAS, INTF, PROG
|
|
393
|
+
- **syntax**: Check LOCAL code BEFORE commit (CLAS, INTF, PROG, DDLS)
|
|
332
394
|
- **inspect**: Check ACTIVATED code AFTER pull (all types, runs Code Inspector)
|
|
333
395
|
- **view**: Understand object STRUCTURE (not for debugging errors)
|
|
334
396
|
|
|
@@ -338,21 +400,29 @@ abapgit-agent pull --files src/zcl_my_class.clas.abap,src/zif_my_intf.intf.abap,
|
|
|
338
400
|
|
|
339
401
|
```
|
|
340
402
|
1. Identify file extension(s) AND dependencies
|
|
341
|
-
├─ .clas.abap or .clas.testclasses.abap → CLAS ✅ syntax supported
|
|
342
|
-
├─ .intf.abap → INTF ✅ syntax supported
|
|
403
|
+
├─ .clas.abap or .clas.testclasses.abap → CLAS ✅ syntax supported
|
|
404
|
+
├─ .intf.abap → INTF ✅ syntax supported
|
|
343
405
|
├─ .prog.abap → PROG ✅ syntax supported
|
|
344
406
|
├─ .ddls.asddls → DDLS ✅ syntax supported (requires proper annotations)
|
|
345
407
|
└─ All other extensions → ❌ syntax not supported
|
|
346
408
|
|
|
347
409
|
2. Check for dependencies:
|
|
348
|
-
├─ Interface + implementing class? →
|
|
349
|
-
├─ Class A uses class B? →
|
|
350
|
-
├─
|
|
351
|
-
└─ Unrelated bug fixes across files? →
|
|
410
|
+
├─ Interface + implementing class? → DEPENDENT (interface is underlying)
|
|
411
|
+
├─ Class A uses class B? → DEPENDENT (class B is underlying)
|
|
412
|
+
├─ CDS view uses table? → INDEPENDENT (table already exists)
|
|
413
|
+
└─ Unrelated bug fixes across files? → INDEPENDENT
|
|
352
414
|
|
|
353
415
|
3. For SUPPORTED types (CLAS/INTF/PROG/DDLS):
|
|
354
|
-
├─
|
|
355
|
-
|
|
416
|
+
├─ INDEPENDENT files → Run syntax → Fix errors → Commit → Push → Pull
|
|
417
|
+
│
|
|
418
|
+
└─ DEPENDENT files (NEW objects):
|
|
419
|
+
├─ RECOMMENDED: Create underlying object first (interface, base class, etc.)
|
|
420
|
+
│ 1. Create underlying object → Syntax → Commit → Push → Pull
|
|
421
|
+
│ 2. Create dependent object → Syntax (works!) → Commit → Push → Pull
|
|
422
|
+
│ ✅ Benefits: Both syntax checks work, cleaner workflow
|
|
423
|
+
│
|
|
424
|
+
└─ ALTERNATIVE: If interface design uncertain, commit both together
|
|
425
|
+
→ Skip syntax → Commit both → Push → Pull → (if errors: inspect)
|
|
356
426
|
|
|
357
427
|
4. For UNSUPPORTED types (FUGR, TABL, etc.):
|
|
358
428
|
Write code → Skip syntax → Commit → Push → Pull → (if errors: inspect)
|
|
@@ -361,6 +431,32 @@ abapgit-agent pull --files src/zcl_my_class.clas.abap,src/zif_my_intf.intf.abap,
|
|
|
361
431
|
Write all code → Run syntax on independent supported files ONLY → Commit ALL → Push → Pull ALL
|
|
362
432
|
```
|
|
363
433
|
|
|
434
|
+
**Example workflows:**
|
|
435
|
+
|
|
436
|
+
**Scenario 1: Interface + Class (RECOMMENDED)**
|
|
437
|
+
```bash
|
|
438
|
+
# Step 1: Interface first
|
|
439
|
+
vim src/zif_calculator.intf.abap
|
|
440
|
+
abapgit-agent syntax --files src/zif_calculator.intf.abap # ✅ Works
|
|
441
|
+
git commit -am "feat: add calculator interface" && git push
|
|
442
|
+
abapgit-agent pull --files src/zif_calculator.intf.abap # Interface activated
|
|
443
|
+
|
|
444
|
+
# Step 2: Class next
|
|
445
|
+
vim src/zcl_calculator.clas.abap
|
|
446
|
+
abapgit-agent syntax --files src/zcl_calculator.clas.abap # ✅ Works (interface exists!)
|
|
447
|
+
git commit -am "feat: implement calculator" && git push
|
|
448
|
+
abapgit-agent pull --files src/zcl_calculator.clas.abap
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
**Scenario 2: Multiple independent classes**
|
|
452
|
+
```bash
|
|
453
|
+
# All syntax checks work (no dependencies)
|
|
454
|
+
vim src/zcl_class1.clas.abap src/zcl_class2.clas.abap
|
|
455
|
+
abapgit-agent syntax --files src/zcl_class1.clas.abap,src/zcl_class2.clas.abap
|
|
456
|
+
git commit -am "feat: add utility classes" && git push
|
|
457
|
+
abapgit-agent pull --files src/zcl_class1.clas.abap,src/zcl_class2.clas.abap
|
|
458
|
+
```
|
|
459
|
+
|
|
364
460
|
**Error indicators after pull:**
|
|
365
461
|
- ❌ **"Error updating where-used list"** → SYNTAX ERROR - run `inspect` for details
|
|
366
462
|
- ❌ **Objects in "Failed Objects Log"** → SYNTAX ERROR - run `inspect`
|
|
@@ -370,9 +466,10 @@ abapgit-agent pull --files src/zcl_my_class.clas.abap,src/zif_my_intf.intf.abap,
|
|
|
370
466
|
### Commands
|
|
371
467
|
|
|
372
468
|
```bash
|
|
373
|
-
# 1. Syntax check LOCAL code BEFORE commit (CLAS, INTF, PROG
|
|
469
|
+
# 1. Syntax check LOCAL code BEFORE commit (CLAS, INTF, PROG, DDLS)
|
|
374
470
|
abapgit-agent syntax --files src/zcl_my_class.clas.abap
|
|
375
|
-
abapgit-agent syntax --files src/
|
|
471
|
+
abapgit-agent syntax --files src/zc_my_view.ddls.asddls
|
|
472
|
+
abapgit-agent syntax --files src/zcl_class1.clas.abap,src/zif_intf1.intf.abap,src/zc_view.ddls.asddls
|
|
376
473
|
|
|
377
474
|
# 2. Pull/activate AFTER pushing to git
|
|
378
475
|
abapgit-agent pull --files src/zcl_class1.clas.abap,src/zcl_class2.clas.abap
|