feat: bgRFC/FM 支撑能力 + ADT 后缀剥离与 CLAS 激活修复(B1 配套)
CI / test (3.10) (push) Waiting to run
CI / test (3.11) (push) Waiting to run
CI / test (3.12) (push) Waiting to run

新增能力:
- remote-enable 子命令:设置函数模块处理类型为远程启用(bgRFC/RFC 执行体必需)。
  实现要点均按实机验证:PUT fmodule:processingType="rfc"(枚举值仅小写 rfc 有效,
  remoteEnabled/remote/RFC 等均 400);lockHandle 走 query 参数(放 header 报
  ParameterNotFound);PUT 后 GET 复核回显;DDIC 结构参数才可远程启用(类本地类型
  报"针对 RFC 不允许使用类或接口的类型")。
- create --type functiongroup 透传 --package / --corr_nr(此前 package 被静默写成 $TMP,
  导致函数组无法归目标包)。

修复:
- activate 请求体补重复引用:ADT CLAS 激活端点对 objectReferences 只有 1 个引用时
  返回 HTTP 200 + 空 body 且不执行激活;引用数 ≥2 才真正激活(同对象重复亦可)。
- scanner 剥离 ADT 文件后缀(xxx.clas.abap 解析错误)。

守卫测试:
- tests/unit/test_bgrfc_support.py(17 例):函数组 package 透传、processingType 助手、
  remote-enable 命令(含 lockHandle 走 query/小写 rfc/错误透传/复核失配判失败)、
  函数 URI 组装不得用组名冒充模块名。
- test_activate.py 增加激活请求体引用数守卫;test_repo_guards.py 增加后缀剥离守卫。

测试:tests/unit 676 + tests/test_sapcli.py 69 = 745 全绿
(PYTHONPATH=assets python -m unittest discover -s tests/unit -t tests)
This commit is contained in:
吴让宇
2026-09-15 22:51:35 +08:00
parent 04efa7388a
commit c06e350f6d
13 changed files with 697 additions and 4 deletions
+2
View File
@@ -42,6 +42,7 @@ from sapcli.commands import (
cmd_history,
cmd_clone,
cmd_enhancement,
cmd_remote_enable,
)
from sapcli.auth import cmd_auth_login, cmd_auth_logout, cmd_auth_status
from sapcli.exceptions import SapCliError, ConfigError
@@ -164,6 +165,7 @@ def main() -> None:
"unit-test": cmd_unit_test,
"history": cmd_history,
"enhancement": cmd_enhancement,
"remote-enable": cmd_remote_enable,
}
# 批量 sync 参数校验
+5
View File
@@ -292,4 +292,9 @@ CDS View:
sp_enh.add_argument("--name", required=True, help="对象名称")
sp_enh.add_argument("--type", required=True, help="对象类型")
# ── remote-enable (函数模块远程启用,bgRFC/RFC 执行体) ──
sp_remote = subparsers.add_parser("remote-enable", help="远程启用函数模块(bgRFC/RFC 执行体)")
sp_remote.add_argument("--name", required=True, help="函数模块名 (函数组/函数模块 格式)")
sp_remote.add_argument("--corr_nr", default=None, help="传输请求编号")
return parser