Skip to content

Commit 383e5ad

Browse files
oblomov-devclaude
andauthored
Add renaming smoke test and fix broken README badge (#689)
The README linked a 'renaming' badge to a non-existent rename_test.yaml workflow, so the badge never rendered. The samples repo had no renaming check at all. Add the missing renaming function, mirroring the abap2UI5 framework repo: - .github/workflows/test_rename.yaml runs it on every pull request - npm run rename runs abaplint --rename with the checked-in config - .github/abaplint/rename_test.jsonc renames the z2ui5 namespace to a placeholder and syntax-checks the result, scoped to the portable src/01 set (basic samples plus the abap2UI5 framework dependency) Point the README badge at the real workflow file (test_rename.yaml), matching the framework repo's naming. Claude-Session: https://claude.ai/code/session_014F3nMzDVeUx9vcz97797hw Co-authored-by: Claude <noreply@anthropic.com>
1 parent 2105812 commit 383e5ad

4 files changed

Lines changed: 92 additions & 1 deletion

File tree

.github/abaplint/rename_test.jsonc

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
// Rename smoke test for the test_rename workflow: renames every sample
3+
// (and the abap2UI5 framework it references) from the z2ui5 namespace to
4+
// the placeholder zabap2ui5 and syntax-checks the result. This proves the
5+
// basic samples stay renameable for a parallel installation alongside a
6+
// renamed abap2UI5 (see https://abap2ui5.github.io/docs/advanced/renaming.html).
7+
// Scoped to the portable src/01 set - it is the only namespace-clean,
8+
// dependency-free-of-src/00 area (src/00 is stripped from the cloud/702
9+
// builds and carries non-ABAP objects that are out of scope for renaming).
10+
// Runs standalone as well:
11+
// npx abaplint .github/abaplint/rename_test.jsonc --rename
12+
"global": {
13+
"files": "/../../src/01/**/*.*"
14+
},
15+
"dependencies": [
16+
{
17+
"url": "https://github.com/abapedia/steampunk-2305-api-intersect-702",
18+
"files": "/src/**/*.*"
19+
},
20+
{
21+
"url": "https://github.com/abap2UI5/abap2UI5",
22+
"files": "/src/**/*.*"
23+
}
24+
],
25+
"rename": {
26+
"output": "output",
27+
"patterns": [
28+
{
29+
"type": "CLAS|INTF|TABL",
30+
"oldName": "^z2ui5(.*)$",
31+
"newName": "zabap2ui5$1"
32+
}
33+
]
34+
},
35+
"syntax": {
36+
"version": "v750",
37+
"errorNamespace": "."
38+
},
39+
"rules": {
40+
"allowed_object_types": {
41+
"allowed": [
42+
"CLAS",
43+
"DEVC",
44+
"INTF",
45+
"TABL"
46+
]
47+
},
48+
"allowed_object_naming": true,
49+
"begin_end_names": true,
50+
"check_ddic": true,
51+
"check_include": true,
52+
"check_syntax": true,
53+
"global_class": true,
54+
"implement_methods": true,
55+
"method_implemented_twice": true,
56+
"parser_error": true,
57+
"superclass_final": true,
58+
"unknown_types": true,
59+
"xml_consistency": true
60+
}
61+
}

.github/workflows/test_rename.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: test_rename
2+
3+
# Smoke test that the basic samples (and the abap2UI5 framework they
4+
# reference) can be renamed from the z2ui5 namespace to another one for a
5+
# parallel installation - runs the abaplint rename with the checked-in
6+
# config .github/abaplint/rename_test.jsonc and syntax-checks the result.
7+
8+
on:
9+
pull_request:
10+
11+
permissions:
12+
contents: read
13+
14+
concurrency:
15+
group: test_rename-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
test_rename:
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 10
22+
steps:
23+
- uses: actions/checkout@v7
24+
- uses: actions/setup-node@v6
25+
with:
26+
node-version: '22'
27+
cache: 'npm'
28+
- run: npm ci
29+
- run: npm run rename

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![auto_cloud](https://github.com/abap2UI5/samples/actions/workflows/auto_cloud.yaml/badge.svg)](https://github.com/abap2UI5/samples/actions/workflows/auto_cloud.yaml)
66
[![auto_downport](https://github.com/abap2UI5/samples/actions/workflows/auto_downport.yaml/badge.svg)](https://github.com/abap2UI5/samples/actions/workflows/auto_downport.yaml)
77
<br>
8-
[![renaming](https://github.com/abap2UI5/samples/actions/workflows/rename_test.yaml/badge.svg)](https://github.com/abap2UI5/samples/actions/workflows/rename_test.yaml)
8+
[![test_rename](https://github.com/abap2UI5/samples/actions/workflows/test_rename.yaml/badge.svg)](https://github.com/abap2UI5/samples/actions/workflows/test_rename.yaml)
99

1010
# abap2UI5-samples
1111

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"description": "Learn how to code with abap2UI5.",
66
"scripts": {
77
"launchpad": "node scripts/generate-launchpad.js",
8+
"rename": "abaplint .github/abaplint/rename_test.jsonc --rename",
89
"check:agents": "node scripts/check-agents-structure.js",
910
"syfixes": "find . -type f -name '*.abap' -exec sed -i -e 's/ RAISE EXCEPTION TYPE cx_sy_itab_line_not_found/ ASSERT 1 = 0/g' {} + ",
1011
"abaplintpathfix": "sed -i 's|\"files\": \"/\\.\\.\\/\\.\\.\\/src\\/\\*\\*\\/\\*\\.\\*\"|\"files\": \"/src/**/*.*\"|g' abaplint.jsonc",

0 commit comments

Comments
 (0)