feat(adt): add INCL (PROG/I) write support for WriteSource, EditSource, CLI#121
Draft
frd1201 wants to merge 2 commits into
Draft
feat(adt): add INCL (PROG/I) write support for WriteSource, EditSource, CLI#121frd1201 wants to merge 2 commits into
frd1201 wants to merge 2 commits into
Conversation
…e, CLI Closes oisee#116. ABAP program includes were read-only — GetSource worked but WriteSource, EditSource, and CLI `source edit/write` rejected object_type=INCL. Core feature: - pkg/adt/workflows.go: new WriteInclude() — SyntaxCheck→Lock→UpdateSource→Unlock→Activate - pkg/adt/workflows_source.go: INCL in whitelist, existence check, create/update routing - pkg/adt/fileparser.go: .incl.abap extension → ObjectTypeInclude - internal/mcp/handlers_source.go: INCL in routeSourceAction, WriteSource/ImportFromFile/ExportToFile descriptions - cmd/vsp/devops.go: INCL in buildObjectURL() + CLI source edit/test/atc commands Bug fixes (program includes share /includes/ URL segment with class includes, causing three functions to misidentify them as class sub-resources): - pkg/adt/client.go: normalizeObjectURLForPackageCheck — don't strip /includes/NAME when prefix ends with /programs (was returning /sap/bc/adt/programs → SearchObject("PROGRAMS") → "package metadata not found") - pkg/adt/devtools.go: SyntaxCheck artifactURI — append /source/main for program includes (was sending object descriptor URL → SAP returned wrong content-type) - pkg/adt/workflows_edit.go: EditSourceWithOptions isClassInclude — require /oo/classes/ in URL (was setting sourceURL without /source/main → GET/PUT to XML endpoint → HTTP 406) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two bugs in INCL deploy flow (ImportFromFile / vsp deploy): 1. fileparser.go: .incl.abap files have no declaration statement, so the name must be extracted from the filename (same pattern as class includes). Without this, ParseABAPFile failed with "could not parse object name from file". 2. workflows_deploy.go: SyntaxCheck is stateless and was running after Lock (stateful), which broke the SAP session and caused HTTP 423 ExceptionResourceInvalidLockHandle. Moved SyntaxCheck to before Lock so the stateful session is established cleanly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
c7890ea to
8f6c030
Compare
frd1201
added a commit
to frd1201/vibing-steampunk
that referenced
this pull request
Apr 23, 2026
Merges PR oisee#121 (pending upstream) into fork/main so the fix is available locally. Will be removed from fork/main once upstream merges the PR. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Closes #116
Summary
WriteInclude()workflow — full SyntaxCheck → Lock → UpdateSource → Unlock → Activate cycle for ABAP program includesobject_type="INCL"(MCP tools and CLIvsp source write/edit)vsp source edit INCL— CLI surgical string replacement for includesDeployFromFile/ImportFromFile—.incl.abapfile extension recognized; object name extracted from filename (includes have no declaration statement)/includes/URL segment that caused program includes to be misidentified as class sub-resources:normalizeObjectURLForPackageCheck: was stripping/includes/NAMEfrom program include URLs →SearchObject("PROGRAMS")→ "package metadata not found"SyntaxCheckartifactURI: was missing/source/mainfor program includes → SAP returned wrong content-typeEditSourceWithOptionsisClassInclude: was missing/source/mainin sourceURL → GET/PUT to XML object descriptor endpoint → HTTP 406UpdateFromFile— stateless SyntaxCheck between stateful Lock/Write broke the SAP session (HTTP 423 ExceptionResourceInvalidLockHandle)Test plan
GetSource(object_type="INCL", name="ZZ_FABD1_DUSH8_CICD2")— read worksWriteSource(object_type="INCL", name="ZZ_FABD1_DUSH8_CICD2", source="...", mode="upsert")— create and update worksEditSource(object_url="/sap/bc/adt/programs/includes/ZZ_FABD1_DUSH8_CICD2", old_string="...", new_string="...")— surgical edit worksvsp source read INCL ZZ_FABD1_DUSH8_CICD2— CLI read worksvsp source write INCL ZZ_FABD1_DUSH8_CICD2 < file.abap— CLI write worksvsp source edit INCL ZZ_FABD1_DUSH8_CICD2 --old "..." --new "..."— CLI edit worksImportFromFile(file_path="zz_test.incl.abap")— deploy from file works (Updated PROG/I ZZ_FABD1_DUSH8_CICD2, activated)