Repository navigation
abapgit deploy/export: classic SAP GUI objects from abapGit files - #71
Merged
Merged
Conversation
Copied unchanged from github.com/abapGit-tests (PROG, PROG_dynp_flow, PROG_dynp_modi, PROG_with_text_elmnt, TRAN, TRAN_Report, TRAN_Parameter, DOMA_fixed_values, FUGR_with_parameters, DTEL_with_DOMA). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAJDpDk1M8vPjrLVzAfgnW
Add a strict asXML reader/writer for abapGit's file format: object files (*.prog.xml, *.tran.xml, ...) and .abapgit.xml. Rendering follows abapGit's iXML normalizing renderer (BOM, utf-8 declaration, LF, one-space indent, <X/> for empty elements, & < > " ' in text), so export -> deploy -> export is byte-identical. Also extracts/wraps the compact asXML that SAP's CALL TRANSFORMATION id produces and consumes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAJDpDk1M8vPjrLVzAfgnW
The engine is a real ABAP class (src/abap/zcl_erpl_classic_engine.abap, embedded with CMakeRC) that calls SAP's own workbench function modules. erpl-adt only inserts numbered operation calls; payloads travel base64 encoded, so user data is never quoted into ABAP source. The output is a line protocol (@op RC/EXISTS/META/DATA/MSG/ERR, @EnD) and an incomplete run is never read as success. The helper-class lifecycle moves out of the screen workflow into workflow/classrun_helper: helpers always live in a local package, a helper that fails activation is never run (SAP would run the old active version), and ClassrunEngineRunner deletes its class via RAII. Domain operations (DDIF_DOMA_GET/PUT/ACTIVATE, RS_CORR_INSERT, RS_DD_DELETE_OBJ) verified live on A4H 2025. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAJDpDk1M8vPjrLVzAfgnW
Add a pure, SAP-independent scanner that maps an abapGit repository folder to its objects, their target packages (PREFIX/FULL folder logic) and a dependency-ordered deploy list, plus customer-object and target-package guard rails. File-name, folder and ignore rules follow abapGit's ZCL_ABAPGIT_FILENAME_LOGIC, ZCL_ABAPGIT_FOLDER_LOGIC and ZCL_ABAPGIT_DOT_ABAPGIT->IS_IGNORED. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAJDpDk1M8vPjrLVzAfgnW
New command group 'abapgit' deploys classic objects from abapGit files. The workflow reads all current states in one engine run, compares them with the files in abapGit's exact rendering, and only writes what differs; per-type logic sits behind IClassicTypeHandler. Guard rails run before anything touches the system: customer objects only, and a transportable package requires --transport. Slice 1 (DOMA, fixed values) verified live on A4H: create, unchanged on redeploy, update in place, byte-identical export, delete — checked through ADT REST independently of the engine. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAJDpDk1M8vPjrLVzAfgnW
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAJDpDk1M8vPjrLVzAfgnW
src/abap/engine_<type>.abap files contribute their definitions and implementations to the base helper class, so each object type lives in its own ABAP file next to its C++ handler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAJDpDk1M8vPjrLVzAfgnW
- Drift protection: an existing object is only overwritten when its system version was last changed by the deploying user or equals an earlier committed version of its files (git history). Otherwise the object is refused (exit 6) naming who changed it; --force overrides. - One engine op reads the logon user and the namespaces changeable in the system (TRNSPACE), in the same run as the state reads. - Live guard-rail tests: transportable package without --transport and SAP objects are refused before anything is written. - docs/abapgit-deploy.md, README section, cli-usage for abapgit and screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAJDpDk1M8vPjrLVzAfgnW
… modules DTEL (LCL_OBJECT_DTEL): DDIF_DTEL_GET with abapGit's normalization for the state/export, RS_CORR_INSERT + DDIF_DTEL_PUT + DDIF_DTEL_ACTIVATE for the deploy, RS_DD_DELETE_OBJ for delete. Deploy order DOMA -> DTEL lets a data element activate against a domain deployed in the same run. FUGR (LCL_OBJECT_FUGR): the engine reads what abapGit serializes (RS_FUNCTION_POOL_CONTENTS + ENLFDIR cross-check, RPY_FUNCTIONMODULE_READ_NEW, RS_GET_ALL_INCLUDES with abapGit's include filters, READ_PROGDIR, READ REPORT, generation-comment stripping). Writing goes through ADT like Eclipse: create group / include / function module, lock + PUT the module in signature form, one activation request for everything written. The classic RS_FUNCTIONMODULE_INSERT route fails activation on A4H. BuildFmSignatureSource converts abapGit's interface tables + old-style source to the ADT signature form, mirroring SAP's own builder (CL_FB_DOLLAR_SOURCE_CONVERTER) and its line padding, so the include SAP regenerates is byte-identical to the abapGit file. ActivateObjects activates several objects in one request.
Type handler for abapGit's LCL_OBJECT_TRAN, mirroring ZCL_ABAPGIT_OBJECT_TRAN: reads TSTC/TSTCC via RPY_TRANSACTION_READ plus TSTCT/TSTCP/TSTCA/translations, renders them in abapGit's exact form, and deploys through RPY_TRANSACTION_INSERT (dialog, report, parameter and variant transactions; transaction type from CINFO, TSTCP split into called transaction / skip flag / parameter values as abapGit's split_parameters does). The insert locks the transaction and records it on the transport itself (transport_number, own RS_CORR_INSERT). There is no update API, so an update is RPY_TRANSACTION_DELETE + insert, as in abapGit; the report lists only the parts that differ. Parts only reachable by direct table writes are refused before anything is written instead of being dropped: authorization-object checks (TSTCA, CINFO x'04'), report transactions with variant (CINFO x'10', abapGit UPDATEs TSTC), OO transactions, translations (I18N_TPOOL) and SU22 data. Live tests (test_30_abapgit_tran.py) cover a dialog (ZERPL_VA03), a report (ZERPL_ME2L) and an SE16 parameter transaction (ZERPL_SO_LIST): create, redeploy unchanged, text/GUI-flag change, byte-identical export, delete, SE38 refusal, and an independent check through ADT search and TSTC/TSTCC/TSTCP in HANA. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAJDpDk1M8vPjrLVzAfgnW
During a live outage (stateful ADT sessions failing with 'Session not found') runs could not delete their temporary helper class, and SAP kept the dead session's edit lock. Now: - the helper delete is retried once; - every abapgit command removes the user's own helpers older than two hours (best effort); - 'erpl-adt abapgit cleanup [--older-than N]' does it on demand. Only genuine helper names owned by the logon user are touched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAJDpDk1M8vPjrLVzAfgnW
… status and text pool Type handler for abapGit's LCL_OBJECT_PROG, mirroring ZCL_ABAPGIT_OBJECTS_PROGRAM: PROGDIR (READ_PROGDIR field clearing), DYNPROS (RPY_DYNPRO_READ/_INSERT incl. the foreign-key, '/' force-off and right-box vislength fixes, flow logic in screen_NNNN.abap), CUA (RS_CUA_INTERNAL_FETCH/WRITE state I with AUTO_CORRECT_CUA_ADM and the SE41 hack), TPOOL (SPLIT handling, READ/INSERT TEXTPOOL state I). New programs (any type, module pools included) are created with RPY_PROGRAM_INSERT; the source of existing ones is written over ADT (lock + PUT + unlock, corrNr). Only the parts that differ are written (source / PROGDIR / screen NNNN / CUA / TPOOL) and activated together with RS_WORKING_OBJECTS_ACTIVATE in a separate engine run; checklist errors come back as SAP's text with exit code 5. Screens no longer in the files are deleted (RS_SCRP_DELETE). Native dynpros, VARIS, I18N_TPOOL and LONGTEXTS are refused by name. ObjectState gains `pending`: parts with an inactive version (a deploy whose activation failed) are rewritten and activated even when the files equal the active version, so a repaired redeploy never leaves inactive objects. Fixtures: ZERPL_SO_DISPLAY (VA03-style module pool on EPM: tabstrip, table control, custom control, dialog box, status MAIN/DIALOG, titles) and ZERPL_PO_REPORT (ME2L-style ALV report with selection texts incl. a DDIC reference), both byte-identical after deploy -> export. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAJDpDk1M8vPjrLVzAfgnW
…ctivation failures Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAJDpDk1M8vPjrLVzAfgnW
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAJDpDk1M8vPjrLVzAfgnW
…l mode SetStateful(false) only forgot the sap-contextid locally, so every lock/write cycle left an ABAP session open on the server until rdisp/plugin_auto_logout (30 min). Under load — CI, several parallel runs as one user — the per-user session limit was exhausted and every new stateful request failed with '400 Session not found' (observed live on A4H; locks of the dead sessions then blocked deletes for 30 min). Leaving stateful mode now sends sap-sessioncmd=close (the ICF way to end a stateful session; verified live: the old context id afterwards answers 'Session not found'). Sessions persisted with --session-file are not affected: they never leave stateful mode. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAJDpDk1M8vPjrLVzAfgnW
SPACE is a predefined data object and cannot be a loop variable; the engine headers used ABAP Doc comments outside declarations, which the compiler reported as misplaced. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAJDpDk1M8vPjrLVzAfgnW
- TestRepositoryRoundTrip deploys the whole demo repository (DOMA, DTEL, FUGR, two PROGs, three TRANs) in one call, checks dependency order, redeploy -> all unchanged, and export -> deploy -> export byte equality against the files in git. - The helper-leftover check compares against a snapshot taken when the module starts, so leftovers of earlier interrupted runs do not count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAJDpDk1M8vPjrLVzAfgnW
The abapgit group validates flags against the command's help flags plus the global flags. An unknown flag fails with exit 99 and a "did you mean" hint before anything touches the system. Export no longer lists --transport and documents --dry-run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAJDpDk1M8vPjrLVzAfgnW
Objects and packages are checked against the namespaces changeable in the system (read by the system-info op that opens every engine run) before anything is written, in all three commands. A Z object may now go into a changeable /NS/ package. Delete also refuses an object whose system version differs from the files and was changed by someone else, unless --force. One AbapNamespaceOf; the never-filled customer_namespaces option is removed (the system's SE03 setting is the only source). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAJDpDk1M8vPjrLVzAfgnW
A differing part is overwritten (or deleted) only when the deployer is provably its last changer or the system version is in the file's git history; otherwise refused unless --force. Changers are now per part: FUGR per include / function module include (REPOSRC-UNAM, not SAPL<fg>), PROG per section (source and PROGDIR from REPOSRC, text pool from REPOTEXT, GUI status from EUDB VAUTOR/AUTOR; dynpros record none), and TRAN unknown (TSTC* have no user, SE93 writes no version, the TADIR author is only the creator). Live tests with a second user: a colleague's change is refused (exit 6) and --force overwrites, delete refuses it, and a colleague's edit lock makes the deploy fail with exit 6 without writing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAJDpDk1M8vPjrLVzAfgnW
…olete parts Export takes the scanned objects (key, folder, package, files). A refresh writes each object back into its own folder; an object named with --object goes to the folder of its TADIR package (read with its parent chain by a new tadir_package engine op, composed with FolderForPackage) and is refused when that package is outside the repository's root. After an object's files are written, its other files in that folder (same stem, e.g. a screen deleted in SE51) are removed and reported as "removed <file>". Outcomes carry the real package. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAJDpDk1M8vPjrLVzAfgnW
RS_DD_DELETE_OBJ records the deletion through its own corr_insert, fed by its CHANGING corrnum parameter (read from the FM source on A4H); the engine now passes --transport there instead of leaving SAP to pick or ask. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAJDpDk1M8vPjrLVzAfgnW
…y scan A file under a governing .abapgit.xml is resolved by scanning the whole repository and picking its object, so the folder decides the package (src/sub/zfoo.prog.xml -> ZROOT_SUB) and the starting folder and ignore list apply. A file the scan does not list is refused (NotFound). Outside a repository, --package is used as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAJDpDk1M8vPjrLVzAfgnW
… codes status (F7): in a dry run a missing --transport for a transportable package is a note on the object, not a refusal (--strict restores the refusal, exit 9). Every handler has a non-mutating Validate step (missing files, flow logic without screen, TRAN parts SE93's API cannot write, RFC modules, unsupported FUGR text change, CUA removal) that status and deploy both run before anything is written. Exit codes (F9): engine failures are classified by the engine's "@op KIND LOCK|CTS|AUTH|CHECK" line (set from the FM exception, e.g. RS_CORR_INSERT permission_failure -> AUTH) or by T100 id/number read from T100 on A4H (MC601, EU510, DS068, TK106, ... -> lock; other TK/TR/TO -> CTS), never by translated text. The most severe object decides the exit code (auth/connection > internal > timeout > CTS > lock > activation > check > ... > not found). JSON gets per-object category/exit_code and a top-level exit_code. A session-creation failure returns its own exit code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAJDpDk1M8vPjrLVzAfgnW
When an object fails, later objects whose files name it (a DTEL's
DOMNAME, a TRAN's PGMNA, a program using a type) are reported as
"skipped: dependency DOMA X failed" and not attempted, transitively; the
exit code is the failure's own. Deploy and delete print one progress line
per object ("[3/8] updating PROG ZFOO") on stderr when it is a terminal
and output is not --json.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FAJDpDk1M8vPjrLVzAfgnW
…r inputs - One AbapGitFolderLogic enum; AbapGitLayout and AbapGitRepoConfig alias it, so .abapgit.xml maps to the scanner layout without conversion. - The DOMA op builders move from the public classic_engine.hpp into abapgit_type_doma.cpp, like every other type's. - --transport is validated as a TransportId (upper-cased) before anything runs, and corrNr is URL-encoded in the function group and source URLs. - Git history reads all versions of a file with one `git log -p` process (full-file context) instead of one `git show` per commit, capped at 20, and only for paths whose characters pass a strict allowlist. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAJDpDk1M8vPjrLVzAfgnW
…, exit codes - The drift refusal prints a ready-to-run command with the real repository path: erpl-adt abapgit export '<repo>' --package '<P>' --object TYPE:NAME. - Dry-run output says "would be" only for created/updated/deleted. - status help: it changes no object but runs a $TMP helper and needs S_DEVELOP; transportable packages get a note, --strict refuses. - deploy help lists the exit codes and the most-severe-wins rule. - docs/abapgit-deploy.md: guard-rail phase, per-part drift sources (and which parts SAP keeps no changer for), PR-check usage, JSON fields, export folder/removal behaviour, exit code table with precedence, and the limitations inline (transport recording not verified live, helper run cost measured on A4H, MIXED folder logic). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAJDpDk1M8vPjrLVzAfgnW
Local packages $ZERPL_GIT / $ZERPL_GIT_SUB (created on A4H): a deploy puts src/sub/ objects into the sub-package, export --object writes into src/sub/, a refresh writes back in place and removes an obsolete part file, and single-file mode inside the repo uses the folder's package. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAJDpDk1M8vPjrLVzAfgnW
… by SAP With drift protection on delete, the "start from a clean state" deletes in the live suites must say --force, and the repository round trip now starts from a clean state too. test_broken_flow_logic asserted "nothing was saved", which was never true: RPY_DYNPRO_INSERT saves the screen before it generates it (not_generated), as SE51 does; the old lenient drift rule silently overwrote the leftover. The test now checks that the fixed file is refused until the failed attempt is in git history, then goes through. Documented as a limitation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAJDpDk1M8vPjrLVzAfgnW
…t-a3b1978e372713d0d
… API writes TSTCA Established on A4H: RPY_TRANSACTION_INSERT has no authorization parameter; SE93 (LSEUKF01) and abapGit (SAVE_AUTHORIZATIONS) write TSTCA and the CINFO bit with direct DELETE/INSERT/UPDATE; CL_TRAN_WBI_P (new transaction editor, enabled only in SAP-internal systems) does the same without lock or transport. Per the owner's rule (no direct table writes) the part stays refused; the message now says why and where to maintain it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018txuxGGXbvxbaBZqa3X35C
abapgit deploy/export/status/delete now handle abapGit's default (in-XML) translation format and SE61 documentation for DOMA, DTEL and PROG: DOMA I18N_LANGS, DD01_TEXTS, DD07_TEXTS LONGTEXTS (DO) DTEL I18N_LANGS, DD04_TEXTS LONGTEXTS (DE), LONGTEXTS_DZ (DZ) PROG I18N_TPOOL LONGTEXTS (RE) The engine part src/abap/engine_i18n.abap mirrors abapGit's serializers (SERIALIZE_TEXTS, ZCL_ABAPGIT_LONGTEXTS): DDIF_DOMA/DTEL_GET/PUT per language + DDIF_*_ACTIVATE, READ/INSERT TEXTPOOL ... LANGUAGE (active), DOKIL + DOCU_READ / DOCU_UPDATE / DOCU_DEL, RS_CORR_INSERT on the object. Reads and writes ride in the existing batched engine runs (no extra runs). A deploy manages exactly the languages its files name: translations and documentation languages that exist only in the system are not compared, written or removed (ScopeTranslations), so objects without translations in their files behave as before. A translation the system does not have yet is never drift; SAP records no changer for translations, so a changed one needs the git history / own-deploy record as screens do. Only changed sections are written and reported. Delete removes the documentation too. The erpl_demo fixtures gain German translations (domain fixed values, data element labels, PO report text pool, SO display title) and documentation for ZERPL_E_SO_STATUS (E + D) and ZERPL_PO_REPORT. test_35 deploys ZERPL_I18N_* copies and checks them over ADT in the logon language DE. Not supported (documented): the LXE .po format, TRAN short-text translations (abapGit writes TSTCT directly), FUGR text pool translations and function module docu, dynpro/CUA translations (LXE only in abapGit). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018txuxGGXbvxbaBZqa3X35C
…LDS) A screen with an element the external dynpro format cannot hold (FILL 'X', e.g. a CL_DYNPRO_SPLITTER splitter control) is now read and exported like abapGit does (NAT_HEADER = D020S without generation stamp, NAT_FIELDS from RPY_DYNPRO_READ_NATIVE) and written with RPY_DYNPRO_INSERT_NATIVE, which locks the screen, records it on the request and registers it inactive for the deploy's activation. Unlike abapGit an existing screen is overwritten (suppress_exist_checks - abapGit's call answers ALREADY_EXISTS and ignores it). Field texts (NAT_TEXTS, D021T) are refused (exit 8): abapGit inserts them into D021T directly; no workbench API writes them. Live: test_36 (ZERPL_SO_SPLIT sales order cockpit: splitter screen 0100 with subscreens 0110/0120) green, export byte-identical; fixture in fixtures/abapgit/erpl_native. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018txuxGGXbvxbaBZqa3X35C
…lose ends nothing Measured on A4H with SAP's own session list (TH_USER_LIST, as in SM04): every lock/write/unlock left one ABAP user context open, although the #70 close request (sap-sessioncmd=close) was answered 200 - as a parameter or as a header it ends nothing, and sap-sessioncmd=logoff on an ADT URL neither. Contexts then live until rdisp/plugin_auto_logout (30 min); two agents running the deploy suites reached 400 for DEVELOPER within 15 minutes, after which SAP refused stateful sessions ("400 Service cannot be reached") and then every request ("429 Too Many Logons"). GET /sap/public/bc/icf/logoff ends the logon together with its context. Leaving stateful mode and destroying a session (unless kept for a --session-file) now use it and drop the logon/context cookies and CSRF tokens, so the next request logs on afresh. test_34 now counts the user's sessions around 20 writes and 20 plain commands: before this change 20 writes left 20 sessions (50 -> 70); after it none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018txuxGGXbvxbaBZqa3X35C
…OOL, LONGTEXTS) Conflicts: PROG handler header comment and part changers (variants, native dynpros and translations all kept), docs API table and limitations (both sides kept, the obsolete "not supported" lines dropped). The translations live test is renumbered test_37 (test_35 is the variants test). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018txuxGGXbvxbaBZqa3X35C
…demo The erpl_demo programs now carry German texts and documentation, and an export writes every language the system has: the variants fixture (the same program ZERPL_PO_REPORT plus CUS&OPEN_POS) gets those sections too, and the expected part lists of test_29/test_35 name I18N_TPOOL and LONGTEXTS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018txuxGGXbvxbaBZqa3X35C
Data safety, from the crew review (F1-F3): - i18n_docu_put writes the documentation of the op's own object: DOKIL-ID / OBJECT and THEAD-TDOBJECT / TDNAME / TDID / TDSPRAS are set from the op's id / object, never taken from the file, and DOCU_UPDATE's result (it has neither exceptions nor a return code) is checked through DOKIL. DOMA, DTEL and PROG Validate refuse documentation naming another object or a document type DOCU_UPDATE does not write, before anything is written - a file copied from ZFOO no longer overwrites ZFOO's (or SAP's) documentation. - CollectI18nReads returns a Result: a failed translation or documentation read (rc != 0) fails the object's state instead of reading as "no texts", so export writes nothing and deploy compares nothing it could not read. - delete compares the unscoped system state and refuses (exit 6) when the system holds translation or documentation languages the files lack, unless --force: they would go with the object. - TRAN does not scope translations away (KeepsUnmanagedTranslations): its update is delete + insert and drops TSTCT translations, so system-only translations are drift there. Live: test_37 copied documentation refused, delete refusal (red with the previous binary: the copy was created and its LONGTEXTS written). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018txuxGGXbvxbaBZqa3X35C
…root From the crew review (F4, F5): - ParseDotAbapGit refuses a STARTING_FOLDER with a '..' segment, and an export never writes (or removes obsolete files) in a folder that is not below the repository root, whatever the layout says. A crafted .abapgit.xml could make an --object export write and delete files outside --abapgit-root. - The deploy record directory is injected into RunAbapGit. The CLI keeps today's location (DeployRecordDirectory: the repository's git directory, else the user's cache). The MCP server uses the git directory only when it resolves inside its root; a .git pointer file leading out, a git directory above the root or no work tree use a server-side directory <cache>/mcp-deployed/<repo>-<hash of the canonical path> instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018txuxGGXbvxbaBZqa3X35C
From the crew review (F6, F7), with the lead's decision for F6: - A file that cannot be read or parsed is recorded as the report's local_error; status exits with its code even without --strict (other refusals stay reported, not fatal; --strict unchanged). A pull request that breaks an XML file no longer passes `abapgit status`. - The JSON report's command is "status" for status (it said "deploy"; dry_run: true carries the rest), and the CLI usage line names the verb. - New test/app/ directory for the shared CLI/MCP command layer. Live: test_28 status on a repository with a truncated XML file exits 99, reports command "status", the good object is still compared. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018txuxGGXbvxbaBZqa3X35C
…us plans From the crew review (F8, F10, F12): - Every object that fails, is refused or skipped at any stage (guard rail, local file, system read, namespace, Validate, drift, plan) breaks the objects after it in dependency order that mention it: a data element is no longer written against a domain whose update was refused. Only earlier objects count, so a program is not skipped because a transaction it names failed. status reports the same skips. - Dry runs call Plan() (it writes nothing): status shows the parts a deploy writes and the planning errors it would hit. The FUGR handler selects its includes / function modules in Plan; the ADT phase only executes them. - Activation results are attributed by whole object name (NamesWord, the boundary logic Mentions already used): a message about ZFOO_TOP no longer fails ZFOO. - ExitCode falls back to local_error when no object carries an error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018txuxGGXbvxbaBZqa3X35C
… SQL errors From the testing review (T3). hana_oracle.py replaces the per-file _hana() helpers of test_30/35/36: container from SAP_DOCKER_CONTAINER (default a4h, as bw_activation.py), schema from SAP_HANA_SCHEMA (default SAPA4H), enabled only when SAP_HOST is local, probed once with SELECT 1 FROM DUMMY (skip with the reason when that fails). After a successful probe a failing query fails the test instead of skipping it. Also a session fixture `hana` in conftest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018txuxGGXbvxbaBZqa3X35C
…e per owner
From the crew review (F9, F14) and the testing review (T4):
- tran_put reads TSTC/TSTCC/TSTCT/TSTCP and the TADIR package before the
update's RPY_TRANSACTION_DELETE; when RPY_TRANSACTION_INSERT fails, the
previous version is inserted again into its package ("its previous version
was restored"). The insert is wrapped against dialogs it cannot send from
a classrun (RS_CORR_INSERT's popup for a missing package raised
CX_SY_SEND_DYNPRO_NO_RECEIVER and aborted the op after the delete), and its
edit lock is freed after a failure so the restore can lock again.
Measured on A4H: RPY_TRANSACTION_INSERT accepts a PGMNA that does not
exist, so the live test uses a package that does not exist instead.
- RS_WORKING_OBJECTS_ACTIVATE without popup is all or nothing: one program
with a syntax error left every program of the deploy inactive and failed
them all with its message. activate_objects now activates each owner that
is still inactive on its own, with its messages prefixed by the owner.
- Screen deletions: documented in engine_prog that RS_SCRP_DELETE is called
exactly as abapGit's DESERIALIZE_DYNPROS does (no request parameter; the
R3TR PROG corr_insert comes first). Transport recording stays unverified.
Live test_38 (red before: the valid program failed with the broken one's
message; the transaction was deleted and not restored): valid PROG created
and active, broken PROG fails exit 5 with SAP's message and stays inactive,
its TRAN skipped and absent; a rejected TRAN update leaves the previous
version in TSTC/TADIR and status unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018txuxGGXbvxbaBZqa3X35C
…de, help From the crew review (F13) and the testing review (T2): - export checks creating and writing a new repository's .abapgit.xml; a failure is the report's local_error (exit 99, JSON "error"), not a silent "exported". - A path inside a repository names the repository root to pass instead of "No .abapgit.xml in <path>". - cleanup: --older-than must be a whole number of minutes (from_chars; "10x" is refused with exit 99), and a session failure exits with its own code (1) instead of 99. cleanup is in the group examples, and a helper that could not be deleted points to it. - status --force help (CLI and MCP) says what it does: preview a deploy --force. Live test_39: a helper left with --keep-helper is kept by a default cleanup (fresh), deleted by --older-than 1 once old enough; a colleague's (BWDEVELOPER) helper is kept; "10x" is refused; everything created is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018txuxGGXbvxbaBZqa3X35C
…behaviour From the crew review (F11, F14): cli-usage's status exit contract, --strict, cleanup and --older-than, the JSON fields (command, skipped, category, exit_code, error); README's MCP confinement (absolute paths inside the root accepted, STARTING_FOLDER, where the deploy record lives); abapgit-deploy.md: failed reads, documentation identity, delete refusing languages the files lack, TRAN translations as drift, dependents skipped at any stage, per-owner activation, status planning, TRAN rollback, screen deletions recorded as in abapGit (transport recording still not verified live), exit code 99 for local files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018txuxGGXbvxbaBZqa3X35C
…lations unseen
From the independent review (R2, R3, R4):
- R2: an existing transaction whose system version holds what
RPY_TRANSACTION_INSERT cannot reproduce - an authorization-object check
(TSTCA / CINFO x'04'), the variant flag x'10', an OO type x'08' - is
refused before anything is written (TRAN Validate on the system state;
exit 8, no --force bypass), and tran_put refuses it again before its
delete (second line). A rollback that cannot bring back other-language
short texts says so instead of "restored".
- R3: an update of a type that replaces the whole object (TRAN) and would
drop the system's translations is its own refusal ("would drop its
translations in the system (I18N_TPOOL (D))", exit 6, --force drops them
with a note), not drift with an export hint. An exported file - which
carries the system's I18N_TPOOL as abapGit's does - is deployable
(unchanged); only translations the system does not hold are refused.
TRAN I18N_TPOOL entries are keyed by SPRSL (PROG's by LANGUAGE).
- R4: i18n_docu_put checks every entry's type before writing any, and a
failed DOKIL verification names the languages already written.
Live: test_38 TestTransactionTranslations (a TRAN created with only a
German short text; red with the previous binary: drift refusal with an
export hint), rollback test green with the new message. TSTCA / x'04' /
x'10' / x'08' cannot be set up on A4H without direct table writes
(RPY_TRANSACTION_INSERT has no parameter for them), so R2 is unit-tested.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018txuxGGXbvxbaBZqa3X35C
…ir program From the independent review (R5, R6): - R5: an object's files name the object itself everywhere, so a failed object of another type with the same name (FUGR ZX, PROG ZX) no longer skips it. A same-name object only counts through a reference field: a data element's DOMNAME, a transaction's PGMNA (DependsOn, used for the pre-run skips and the run's guards). - R6: activation messages are attributed to an object by its name and by the parts of it that stayed inactive (INACTIVE lines: "PROG ZFOO<TAB>REPS ZFOO_TOP"), so an include's error is its program's - not everybody's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018txuxGGXbvxbaBZqa3X35C
…ew R1) R1 suspected that the per-owner activation fallback, which goes in payload order, fails a healthy main program ZFOO whose new include ZFOO_TOP comes after it. On A4H it does not reproduce: activating ZERPL_T4_R1 on its own activates it with its inactive include, the include and the transaction follow, and only the broken program stays inactive. Kept as the guard. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018txuxGGXbvxbaBZqa3X35C
…drop Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018txuxGGXbvxbaBZqa3X35C
In the full module an earlier class leaves ZERPL_T4_OK with English texts, which the German repository's deploy then rightly refused as drift. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018txuxGGXbvxbaBZqa3X35C
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018txuxGGXbvxbaBZqa3X35C
…4456) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018txuxGGXbvxbaBZqa3X35C
…eckouts
The Windows runner checks out with core.autocrlf, which turned the
byte-exact abapGit fixtures and the marker-composed ABAP engine parts into
CRLF. Mark them -text. The abapgit_root config test now uses a path that is
absolute on Windows too ("/srv/abapgit" has no drive there).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018txuxGGXbvxbaBZqa3X35C
… -text Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018txuxGGXbvxbaBZqa3X35C
A Windows checkout with core.autocrlf=true already reads as unchanged: LoadObjectFiles runs every repository file through NormalizeFile, which re-renders XML through abapGit's XML reader (XML end-of-line handling: CRLF -> LF, a CR written as is kept) and turns CRLF pairs in ABAP source into LF (a lone CR is left alone). .abapgit.xml goes through the same XML reader. The deploy record and git history are compared in that form too. Tests pin it: LoadObjectFiles, deploy/status (no write, record unchanged), a CRLF change recorded as LF, delete drift, ParseDotAbapGit, and a live test_28 case that deploys a CRLF copy of erpl_demo. The docs' "Line endings" limitation said the opposite; it now describes the behaviour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018txuxGGXbvxbaBZqa3X35C
…lassic-objects # Conflicts: # docs/cli-usage.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
erpl-adt abapgit deploy|status|export|delete|cleanupcreates, updates, reads and deletes classic SAP GUI objects from files kept in git, in abapGit's serialization format. The command reads a folder of abapGit files (.abapgit.xml, PREFIX/FULL folder logic) and works out the dependency order itself. A second deploy of unchanged files is a no-op.exportwrites files byte-identical to whatdeployreads.MCP tools
abapgit_status(read-only) andabapgit_deploy,abapgit_export,abapgit_delete(destructive) are confined to--abapgit-root.Full reference:
docs/abapgit-deploy.md; CLI reference:docs/cli-usage.md.Design
The engine is a temporary
$TMPclassrun helper class (ZCL_ERPLHLP_<hex>). It is composed fromsrc/abap/*.abapand calls the same workbench APIs SE51, SE41, SE93 and SE11 use:There are no direct table writes. abapGit's asXML payload is mapped straight onto the API structures with
CALL TRANSFORMATION id, so every screen element attribute is supported without a C++ model.At most three helper runs per deploy: read, DDIC, then write and activate. The helper is deleted on every path;
abapgit cleanupremoves helpers left behind by interrupted runs.Enterprise workflow:
--transport;--force;.git/erpl-adt/deployed;status/deploy --dry-runshow a per-object diff for PR checks;/XYZ/namespaces that are changeable).Errors:
Session fix along the way: stateful ADT contexts leaked until
rdisp/plugin_auto_logout, becausesap-sessioncmd=closeends nothing. Long runs then failed with "400 Service cannot be reached" and "429 Too Many Logons". Sessions now end throughGET /sap/public/bc/icf/logoff, measured with TH_USER_LIST intest_34.Command lines
Evidence (live, SAP A4H 2025 trial)
test_28–test_39(abapGit, sessions, MCP): 111 passed (33:43)..gitattributes(-text) for the byte-exact fixtures and ABAP engine parts.-m "smoke or screen": 17 passed.Limitations
.pofiles.