From a758c72b5fa954541d56f43e28914215a8a0e9e4 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 21 Jul 2026 09:49:22 +0000 Subject: [PATCH] Add renaming smoke test and fix broken README badge 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. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_014F3nMzDVeUx9vcz97797hw --- .github/abaplint/rename_test.jsonc | 61 ++++++++++++++++++++++++++++++ .github/workflows/test_rename.yaml | 29 ++++++++++++++ README.md | 2 +- package.json | 1 + 4 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 .github/abaplint/rename_test.jsonc create mode 100644 .github/workflows/test_rename.yaml diff --git a/.github/abaplint/rename_test.jsonc b/.github/abaplint/rename_test.jsonc new file mode 100644 index 000000000..5872309a5 --- /dev/null +++ b/.github/abaplint/rename_test.jsonc @@ -0,0 +1,61 @@ +{ + // Rename smoke test for the test_rename workflow: renames every sample + // (and the abap2UI5 framework it references) from the z2ui5 namespace to + // the placeholder zabap2ui5 and syntax-checks the result. This proves the + // basic samples stay renameable for a parallel installation alongside a + // renamed abap2UI5 (see https://abap2ui5.github.io/docs/advanced/renaming.html). + // Scoped to the portable src/01 set - it is the only namespace-clean, + // dependency-free-of-src/00 area (src/00 is stripped from the cloud/702 + // builds and carries non-ABAP objects that are out of scope for renaming). + // Runs standalone as well: + // npx abaplint .github/abaplint/rename_test.jsonc --rename + "global": { + "files": "/../../src/01/**/*.*" + }, + "dependencies": [ + { + "url": "https://github.com/abapedia/steampunk-2305-api-intersect-702", + "files": "/src/**/*.*" + }, + { + "url": "https://github.com/abap2UI5/abap2UI5", + "files": "/src/**/*.*" + } + ], + "rename": { + "output": "output", + "patterns": [ + { + "type": "CLAS|INTF|TABL", + "oldName": "^z2ui5(.*)$", + "newName": "zabap2ui5$1" + } + ] + }, + "syntax": { + "version": "v750", + "errorNamespace": "." + }, + "rules": { + "allowed_object_types": { + "allowed": [ + "CLAS", + "DEVC", + "INTF", + "TABL" + ] + }, + "allowed_object_naming": true, + "begin_end_names": true, + "check_ddic": true, + "check_include": true, + "check_syntax": true, + "global_class": true, + "implement_methods": true, + "method_implemented_twice": true, + "parser_error": true, + "superclass_final": true, + "unknown_types": true, + "xml_consistency": true + } +} diff --git a/.github/workflows/test_rename.yaml b/.github/workflows/test_rename.yaml new file mode 100644 index 000000000..70d8a0748 --- /dev/null +++ b/.github/workflows/test_rename.yaml @@ -0,0 +1,29 @@ +name: test_rename + +# Smoke test that the basic samples (and the abap2UI5 framework they +# reference) can be renamed from the z2ui5 namespace to another one for a +# parallel installation - runs the abaplint rename with the checked-in +# config .github/abaplint/rename_test.jsonc and syntax-checks the result. + +on: + pull_request: + +permissions: + contents: read + +concurrency: + group: test_rename-${{ github.ref }} + cancel-in-progress: true + +jobs: + test_rename: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-node@v6 + with: + node-version: '22' + cache: 'npm' + - run: npm ci + - run: npm run rename diff --git a/README.md b/README.md index 559b9864c..8ffc36fca 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![auto_cloud](https://github.com/abap2UI5/samples/actions/workflows/auto_cloud.yaml/badge.svg)](https://github.com/abap2UI5/samples/actions/workflows/auto_cloud.yaml) [![auto_downport](https://github.com/abap2UI5/samples/actions/workflows/auto_downport.yaml/badge.svg)](https://github.com/abap2UI5/samples/actions/workflows/auto_downport.yaml)
-[![renaming](https://github.com/abap2UI5/samples/actions/workflows/rename_test.yaml/badge.svg)](https://github.com/abap2UI5/samples/actions/workflows/rename_test.yaml) +[![test_rename](https://github.com/abap2UI5/samples/actions/workflows/test_rename.yaml/badge.svg)](https://github.com/abap2UI5/samples/actions/workflows/test_rename.yaml) # abap2UI5-samples diff --git a/package.json b/package.json index 6ffa42217..c90ea6fd6 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "description": "Learn how to code with abap2UI5.", "scripts": { "launchpad": "node scripts/generate-launchpad.js", + "rename": "abaplint .github/abaplint/rename_test.jsonc --rename", "check:agents": "node scripts/check-agents-structure.js", "syfixes": "find . -type f -name '*.abap' -exec sed -i -e 's/ RAISE EXCEPTION TYPE cx_sy_itab_line_not_found/ ASSERT 1 = 0/g' {} + ", "abaplintpathfix": "sed -i 's|\"files\": \"/\\.\\.\\/\\.\\.\\/src\\/\\*\\*\\/\\*\\.\\*\"|\"files\": \"/src/**/*.*\"|g' abaplint.jsonc",