Skip to content

v0.6.0 — 代码修改 / Code modification, ST22 dumps, universal source reading

Latest

Choose a tag to compare

@github-actions github-actions released this 05 Sep 08:47
· 1 commit to main since this release

Code modification (v0.6.0) — the headline

The gateway can now edit ABAP code, not just read it. Three endpoints for programs, classes and function modules ({type} = prog / class / func):

# AI-style editing: unique find-and-replace + activate
curl -X POST http://127.0.0.1:3000/api/objects/prog/ZMY_REPORT/replace \
  -H "Content-Type: application/json" \
  -d '{"old_string":"WRITE '\''old'\''.","new_string":"WRITE '\''new'\''."}'

# Full-source write
curl -X PUT http://127.0.0.1:3000/api/objects/class/ZCL_FOO/source \
  -H "Content-Type: application/json" -d '{"source":"CLASS zcl_foo ..."}'

# Syntax check WITHOUT writing (source sent inline, nothing stored)
curl -X POST http://127.0.0.1:3000/api/objects/prog/ZMY_REPORT/syntax \
  -H "Content-Type: application/json" -d '{"source":"REPORT z.\nWRITE 1."}'
  • The full ADT write sequence — stateful session → LOCK → PUT → UNLOCK → activate — runs inside one gateway request; the lock handle never crosses requests (ADT locks are bound to the ABAP session).
  • Activation failure is a logical result: HTTP 200 with activated.problems[] ("Line N: text"), not a transport error.
  • replace enforces a unique match (0 or >1 hits → 400 with guidance); \r\n/\n differences are normalized. Function-module groups are resolved automatically.
  • Known ADT semantics documented: FM parameter blocks are metadata-owned (anchor edits in the function body); lock conflicts return 409 with SAP's own message.
  • Robustness: panic=abort removed from the release profile — a panicking handler now only drops that connection instead of killing the process.

Structured ST22 dump analysis (v0.5.0)

  • GET /api/dumps — structured short-dump list (error type, terminated program, user, time, message, key) parsed from the ADT Atom feed.
  • GET /api/dumps/grouped — dumps collapsed by (error type, program): what keeps failing, with latest_key plugging straight into the detail endpoint.
  • GET /api/dumps/{key}/detail — one dump's header, termination point (include/line/procedure) and full call stack — a few KB of JSON instead of the 45KB–1MB raw ST22 text.
  • GET /api/functions/{name}/source?prologue=true — source plus a dependency prologue: every CALL FUNCTION 'X' target inlined as a compact signature block. One round trip = code + the contracts of what it calls.

Universal source reading (v0.5.1)

  • /api/functions/{name}/source and /api/programs/{name}/source now fall back to ADT automatically when the RPY RFCs fail (e.g. FL 180 Source wider than 72 char, common in modern ABAP). The response's source_via field says which channel served it.

Also in this release

  • Connection-pool fix: RFC_INVALID_HANDLE(13) added to the discard list — a dead SAP-side session no longer poisons the pool (#d619a25).
  • Homepage (EN/中文) and AI docs (/agents.md) updated with all new endpoints; AGENTS.md gained a "Code modification" chapter and new pitfalls (activation semantics, FM parameter block).

Full changelog: compare v0.4.11...v0.6.0