Skip to content

Commit 2347dea

Browse files
committed
Merge branch 'main' into generate-fiori-ui-odata-app
* main: (105 commits) chore: apply latest changesets Resolve Transport Request Checks for Download Quick Fiori App Deploy (#3819) test: v4 project builder (#3682) chore: apply latest changesets fix: bump specVersion to v4.0 (#3744) chore: apply latest changesets test: Integration test for fiori MCP using promptfoo (#3705) chore: apply latest changesets fix: move message to store creds prompt, tests, changeset (#3820) chore: apply latest changesets fix: bump fallback versions (#3813) chore: apply latest changesets chore - upgrade ui5 devDeps (#3771) correct publisher to SAPOSS (#3817) chore: apply latest changesets fix: cloud system render logic, message wording, test connection logging (#3811) chore: apply latest changesets chore: bump application insights to 2.9.8 (#3812) chore: apply latest changesets fix(fiori-mcp): instrumentation key replacement (#3810) ...
2 parents 239a876 + c1efd2a commit 2347dea

File tree

839 files changed

+169138
-22315
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

839 files changed

+169138
-22315
lines changed

.github/CODEOWNERS

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,12 @@
2424
# Module: fiori-elements-writer
2525
/packages/fiori-elements-writer/ @SAP/ux-tools-elements-writer
2626

27+
# Module: fiori-mcp-server (and related)
28+
/packages/fiori-mcp-server/ @SAP/ux-tools-fiori-mcp-server
29+
/packages/fiori-docs-embeddings/ @SAP/ux-tools-fiori-mcp-server
30+
2731
# Module: eslint-plugin-fiori-tools
28-
/packages/eslint-plugin-fiori-tools/ @SAP/ux-tools-fiori-freestyle-writer @SAP/ux-tools-elements-writer
32+
/packages/eslint-plugin-fiori-tools/ @SAP/ux-tools-eslint-plugin-fiori-tools
2933

3034
# Module: logger
3135
/packages/logger/ @SAP/ux-tools-logger

.github/workflows/lint.yml

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,16 @@ jobs:
1313
run-linters:
1414
strategy:
1515
matrix:
16-
os: [ubuntu-latest]
17-
node-version: [20.x]
16+
os: [ubuntu-latest]
17+
node-version: [20.x]
1818
runs-on: ${{ matrix.os }}
1919

2020
steps:
2121
- name: Checkout code repository
2222
uses: actions/checkout@v4
2323
with:
24-
ref: ${{ github.event.pull_request.head.ref }}
24+
repository: ${{ github.event.pull_request.head.repo.full_name }}
25+
ref: ${{ github.event.pull_request.head.ref }}
2526
- name: Setup pnpm
2627
uses: pnpm/action-setup@v4
2728
with:
@@ -30,16 +31,16 @@ jobs:
3031
- name: Cache pnpm modules
3132
uses: actions/cache@v4
3233
env:
33-
cache-name: cache-pnpm-modules
34+
cache-name: cache-pnpm-modules
3435
with:
35-
path: ~/.pnpm-store
36-
key: ${{ matrix.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
37-
restore-keys: |
38-
${{ matrix.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-
36+
path: ~/.pnpm-store
37+
key: ${{ matrix.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
38+
restore-keys: |
39+
${{ matrix.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-
3940
- name: Use Node.js ${{ matrix.node-version }}
4041
uses: actions/setup-node@v4
4142
with:
42-
node-version: ${{ matrix.node-version }}
43+
node-version: ${{ matrix.node-version }}
4344
- name: Install pnpm modules
4445
run: pnpm install --frozen-lockfile
4546
- name: Run build
@@ -52,8 +53,18 @@ jobs:
5253
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
5354
- name: Commit lint fixes if any
5455
run: |
55-
git config --global user.name github-actions[bot]
56-
git config --global user.email github-actions[bot]@users.noreply.github.com
57-
git add pnpm-lock.yaml
58-
git commit -m "Linting auto fix commit" -a --no-verify || true
59-
git push || true
56+
git config --global user.name github-actions[bot]
57+
git config --global user.email github-actions[bot]@users.noreply.github.com
58+
git add pnpm-lock.yaml
59+
if git commit -m "Linting auto fix commit" -a --no-verify; then
60+
CHANGED_FILES=$(git diff-tree --no-commit-id --name-only -r HEAD)
61+
if ! git push; then
62+
echo "::error::Failed to push lint fixes to remote repository. The commit was created locally but could not be pushed."
63+
echo "::error::Files that could not be committed: $CHANGED_FILES"
64+
echo "Fix the eslint issues locally and push the changes."
65+
exit 1
66+
fi
67+
echo "Lint fixes committed and pushed successfully"
68+
else
69+
echo "No lint fixes needed"
70+
fi

.github/workflows/pipeline.yml

Lines changed: 113 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
uses: pnpm/[email protected]
2727
with:
2828
run_install: |
29-
- args: [--frozen-lockfile]
29+
- args: [--frozen-lockfile]
3030
- name: Cache pnpm modules
3131
uses: actions/cache@v4
3232
env:
@@ -45,55 +45,69 @@ jobs:
4545
- name: Run build
4646
run: pnpm run build
4747
env:
48-
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
48+
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
4949
- name: Run unit tests
5050
run: pnpm run test --tuiAutoExit
5151
env:
52-
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
52+
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
5353
- name: Check for changeset files
5454
id: check_changeset_files
5555
uses: andstor/file-existence-action@v3
5656
with:
57-
files: '.changeset/[!README]*.md'
58-
fail: false
57+
files: '.changeset/[!README]*.md'
58+
fail: false
5959
- name: Validate changeset files if found
6060
if: steps.check_changeset_files.outputs.files_exists == 'true'
6161
run: pnpm changeset status
6262
- name: Cache playwright browsers
6363
id: cache-playwright-browsers
6464
uses: actions/cache@v4
6565
with:
66-
path: |
67-
${{ runner.os == 'Windows' }}:
68-
C:\Users\runneradmin\AppData\Local\ms-playwright
69-
${{ runner.os != 'Windows' }}:
70-
~/.cache/ms-playwright
71-
key: playwright-browsers-os-${{ matrix.os }}-node-version-${{ matrix.node-version }}
66+
path: |
67+
${{ runner.os == 'Windows' }}:
68+
C:\Users\runneradmin\AppData\Local\ms-playwright
69+
${{ runner.os != 'Windows' }}:
70+
~/.cache/ms-playwright
71+
key: playwright-browsers-os-${{ matrix.os }}-node-version-${{ matrix.node-version }}
7272
- name: Install playwright chrome browsers
7373
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
7474
run: npx playwright install chrome
7575
- name: Run integration tests
7676
run: pnpm run test:integration
7777
env:
78-
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
78+
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
7979
- name: Upload playwright reports
8080
if: failure()
8181
uses: actions/upload-artifact@v4
8282
with:
83-
name: playwright-reports-os-${{ matrix.os }}-node-version-${{ matrix.node-version }}
84-
path: |
85-
packages/*/playwright-report
86-
!packages/*/node_modules
87-
retention-days: 15
88-
- name: Delete node_modules before sonar scan (better performance)
89-
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
90-
run: find . -name 'node_modules' -type d -prune -exec rm -rf '{}' + && git restore .
83+
name: playwright-reports-os-${{ matrix.os }}-node-version-${{ matrix.node-version }}
84+
path: |
85+
packages/*/playwright-report
86+
!packages/*/node_modules
87+
retention-days: 15
9188
- name: Run SonarCloud scan
9289
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
93-
uses: sonarsource/sonarqube-scan-action@v5
94-
env:
95-
GITHUB_TOKEN: ${{ secrets.ACCESS_PAT }}
96-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
90+
shell: bash
91+
run: |
92+
echo ${{ github.event.pull_request.number }} >> pr-event.txt
93+
echo ${{ github.event.pull_request.head.ref }} >> pr-event.txt
94+
echo ${{ github.event.pull_request.base.ref }} >> pr-event.txt
95+
96+
- name: 'Prepare output artifact'
97+
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
98+
shell: bash
99+
run: touch output.tar && tar --exclude='./node_modules' --exclude='./dist' --exclude='./**/node_modules/**' --exclude='./**/dist/**' --exclude='./.git' --exclude 'output.tar' -czf output.tar .
100+
101+
- name: 'Upload sonar artifact'
102+
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
103+
uses: actions/upload-artifact@v4
104+
with:
105+
name: sonar-artifact
106+
path: |
107+
pr-event.txt
108+
output.tar
109+
if-no-files-found: error
110+
retention-days: 1
97111
version:
98112
# Run version job only on pushes to the main branch. The job depends on completion of the build job.
99113
if: github.repository == 'SAP/open-ux-tools' && github.event_name == 'push' && github.ref == 'refs/heads/main'
@@ -110,8 +124,8 @@ jobs:
110124
- name: Setup pnpm
111125
uses: pnpm/[email protected]
112126
with:
113-
run_install: |
114-
- args: [--frozen-lockfile]
127+
run_install: |
128+
- args: [--frozen-lockfile]
115129
- name: Cache pnpm modules
116130
uses: actions/cache@v4
117131
env:
@@ -156,8 +170,8 @@ jobs:
156170
- name: Setup pnpm
157171
uses: pnpm/[email protected]
158172
with:
159-
run_install: |
160-
- args: [--frozen-lockfile]
173+
run_install: |
174+
- args: [--frozen-lockfile]
161175
- name: Cache pnpm modules
162176
uses: actions/cache@v4
163177
env:
@@ -173,13 +187,20 @@ jobs:
173187
node-version: 20.x
174188
- name: Install pnpm modules
175189
run: pnpm install --frozen-lockfile
176-
- name: Replace placeholder with instrumentation key
190+
- name: Set instrumentation key in fiori-mcp-server
177191
uses: jacobtomlinson/gha-find-replace@v3
178192
with:
179193
include: packages/fiori-mcp-server/src/telemetry/index.ts
180194
find: 'ApplicationInsightsInstrumentationKeyPLACEH0LDER'
181195
replace: ${{ secrets.INSTRUMENTATION_KEY }}
182196
regex: false
197+
- name: Set instrumentation key in sap-systems-ext
198+
uses: jacobtomlinson/gha-find-replace@v3
199+
with:
200+
include: packages/sap-systems-ext/src/utils/telemetryHelper.ts
201+
find: 'ApplicationInsightsInstrumentationKeyPLACEH0LDER'
202+
replace: ${{ secrets.INSTRUMENTATION_KEY }}
203+
regex: false
183204
- name: Run build
184205
run: pnpm run build
185206
- name: Setup npmrc with npmjs.com token
@@ -191,20 +212,72 @@ jobs:
191212
publish: pnpm ci:publish
192213
env:
193214
GITHUB_TOKEN: ${{ secrets.ACCESS_PAT }}
194-
- name: Prepare Slack notification message
215+
- name: Detect extension publication
216+
if: steps.changesetPublish.outputs.published == 'true'
217+
run: |
218+
PUBLISHED=$(echo '${{ steps.changesetPublish.outputs.publishedPackages }}' | jq -r '.[].name')
219+
# Extract the first package name matching sap-ux-*-ext
220+
EXT_PKG=$(echo "$PUBLISHED" | grep -E '^sap-ux-.*-ext$' | head -n 1 || true)
221+
222+
if [ -n "$EXT_PKG" ]; then
223+
echo "EXTENSION_UPDATED=true" >> $GITHUB_ENV
224+
echo "EXT_PKG=$EXT_PKG" >> $GITHUB_ENV
225+
226+
# Strip 'sap-ux-' prefix to derive directory name
227+
EXT_DIR_NAME=$(echo "$EXT_PKG" | sed 's/^sap-ux-//')
228+
echo "EXT_DIR=packages/${EXT_DIR_NAME}" >> $GITHUB_ENV
229+
else
230+
echo "EXTENSION_UPDATED=false" >> $GITHUB_ENV
231+
fi
232+
- name: Read extension version
233+
if: env.EXTENSION_UPDATED == 'true'
234+
run: |
235+
EXT_VERSION=$(jq -r '.version' "${{ env.EXT_DIR }}/package.json")
236+
echo "EXT_VERSION=$EXT_VERSION" >> $GITHUB_ENV
237+
- name: Package VSCode extension
238+
if: env.EXTENSION_UPDATED == 'true'
239+
run: pnpm --filter ${{ env.EXT_PKG }} ide-ext:package
240+
- name: Create GitHub Release (extension)
241+
if: env.EXTENSION_UPDATED == 'true'
242+
uses: softprops/action-gh-release@v1
243+
with:
244+
tag_name: ${{ env.EXT_PKG }}@${{ env.EXT_VERSION }}
245+
name: ${{ env.EXT_PKG }} v${{ env.EXT_VERSION }}
246+
body: 'Extension release: ${{ env.EXT_PKG }} v${{ env.EXT_VERSION }}'
247+
draft: true
248+
prerelease: false
249+
generate_release_notes: true
250+
files: ${{ env.EXT_DIR }}/*.vsix
251+
fail_on_unmatched_files: true
252+
env:
253+
GITHUB_TOKEN: ${{ secrets.ACCESS_PAT }}
254+
- name: Prepare Slack notification message (published packages)
195255
if: steps.changesetPublish.outputs.published == 'true'
196256
run: |
197-
# Random delimiter required to support multi-line environment variable value
198-
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
199-
echo "PUBLISHED_PACKAGES_MESSAGE<<$EOF" >> $GITHUB_ENV
200-
# publishedPackages JSON format: '[{"name": "@sap-ux/axios-extension", "version": "1.0.2"}, {"name": "@sap-ux/fiori-freestyle-writer", "version": "0.15.12"}]'
201-
echo "$(echo '${{ steps.changesetPublish.outputs.publishedPackages }}' | jq --raw-output 'map("*" + .name + "*" + " - " + "<https://www.npmjs.com/package/" + .name + "|" + .version + ">") | join("\\n")')" >> $GITHUB_ENV
202-
echo "$EOF" >> $GITHUB_ENV
203-
- name: Send Slack notification
257+
# Random delimiter required to support multi-line environment variable value
258+
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
259+
echo "PUBLISHED_PACKAGES_MESSAGE<<$EOF" >> $GITHUB_ENV
260+
# publishedPackages JSON format: '[{"name": "@sap-ux/axios-extension", "version": "1.0.2"}, {"name": "@sap-ux/fiori-freestyle-writer", "version": "0.15.12"}]'
261+
echo "$(echo '${{ steps.changesetPublish.outputs.publishedPackages }}' | jq --raw-output 'map("*" + .name + "*" + " - " + "<https://www.npmjs.com/package/" + .name + "|" + .version + ">") | join("\\n")')" >> $GITHUB_ENV
262+
echo "$EOF" >> $GITHUB_ENV
263+
- name: Prepare Slack notification message (extension release only)
264+
if: env.EXTENSION_UPDATED == 'true'
265+
run: |
266+
RELEASE_URL="https://github.com/${{ github.repository }}/releases/tag/${{ env.EXT_PKG }}@${{ env.EXT_VERSION }}"
267+
echo "EXT_RELEASE_MESSAGE=:package: Extension *${{ env.EXT_PKG }}* v${{ env.EXT_VERSION }} released - <${RELEASE_URL}|View on GitHub>" >> $GITHUB_ENV
268+
- name: Send Slack notification (published packages)
204269
if: steps.changesetPublish.outputs.published == 'true'
205270
uses: slackapi/[email protected]
206271
with:
207-
payload: |
208-
{"text": ":rocket: The following packages were published to npmjs.com:\n${{ env.PUBLISHED_PACKAGES_MESSAGE }}" }
272+
payload: |
273+
{"text": ":rocket: The following packages were published to npmjs.com:\n${{ env.PUBLISHED_PACKAGES_MESSAGE }}" }
274+
env:
275+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
276+
- name: Send Slack notification (extension release)
277+
if: env.EXTENSION_UPDATED == 'true'
278+
uses: slackapi/[email protected]
279+
with:
280+
payload: |
281+
{"text": "${{ env.EXT_RELEASE_MESSAGE }}" }
209282
env:
210-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
283+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

.github/workflows/sonar.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: 'Sonar'
2+
on:
3+
workflow_run:
4+
workflows: [ 'CI/CD Pipeline' ]
5+
types:
6+
- completed
7+
jobs:
8+
sonar:
9+
name: 'Sonar analysis'
10+
runs-on: ubuntu-latest
11+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
12+
permissions:
13+
actions: read # Required to download artifacts
14+
steps:
15+
- name: 'Checkout project'
16+
uses: actions/checkout@v5
17+
with:
18+
repository: ${{ github.event.workflow_run.head_repository.full_name }}
19+
ref: ${{ github.event.workflow_run.head_branch }}
20+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of Sonar analysis
21+
22+
- name: 'Download cached artifact'
23+
if: github.event_name == 'workflow_run'
24+
uses: actions/download-artifact@v5
25+
with:
26+
name: sonar-artifact
27+
run-id: ${{ github.event.workflow_run.id }}
28+
github-token: ${{ secrets.ACCESS_PAT }}
29+
merge-multiple: true
30+
31+
- name: 'Extract output artifact'
32+
if: github.event_name == 'workflow_run'
33+
shell: bash
34+
run: tar -xf output.tar
35+
36+
- name: 'Read pull request event'
37+
if: github.event_name == 'workflow_run'
38+
shell: bash
39+
run: |
40+
echo "pr_number=$(sed '1q;d' pr-event.txt)" >> "$GITHUB_ENV"
41+
echo "pr_head_ref=$(sed '2q;d' pr-event.txt)" >> "$GITHUB_ENV"
42+
echo "pr_base_ref=$(sed '3q;d' pr-event.txt)" >> "$GITHUB_ENV"
43+
44+
- name: 'Run SonarCloud scan'
45+
if: github.event_name == 'workflow_run'
46+
uses: SonarSource/[email protected]
47+
with:
48+
args: >
49+
${{ github.event.workflow_run.event == 'pull_request' && format('{0}{1}', '-Dsonar.scm.revision=', github.event.workflow_run.head_sha) || '' }}
50+
${{ github.event.workflow_run.event == 'pull_request' && format('{0}{1}', '-Dsonar.pullrequest.key=', env.pr_number) || '' }}
51+
${{ github.event.workflow_run.event == 'pull_request' && format('{0}{1}', '-Dsonar.pullrequest.branch=', env.pr_head_ref) || '' }}
52+
${{ github.event.workflow_run.event == 'pull_request' && format('{0}{1}', '-Dsonar.pullrequest.base=', env.pr_base_ref) || '' }}
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.ACCESS_PAT }}
55+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

0 commit comments

Comments
 (0)