Skip to content

Commit 5bd1e94

Browse files
committed
Merge branch 'next-bidirectional' into feature/gateway-layer-part-2
2 parents 4dc4443 + 90c8370 commit 5bd1e94

Some content is hidden

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

44 files changed

+8500
-9317
lines changed

.github/workflows/cxx-build.yml

Lines changed: 123 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,31 @@ on:
1111
- opened
1212
- synchronize
1313

14+
defaults:
15+
run:
16+
shell: bash
17+
1418
env:
1519
HUSKY: 0
1620
jobs:
1721
thunder:
1822
name: Build Thunder Libraries
1923
runs-on: ubuntu-latest
2024
container:
21-
image: kevinshahfws/node-c:3.0
25+
image: node:23.3.0
2226
steps:
23-
- name: Checkout
27+
- name: Checkout firebolt-apis
2428
uses: actions/checkout@v2
2529

2630
- name: Clone and Install Thunder
27-
id: install_thunder
2831
run: |
32+
apt update
33+
apt install -y cmake ninja-build python3-pip python3.11-venv
34+
python3 -m venv firebolt-env
35+
source firebolt-env/bin/activate
36+
pip install jsonref
2937
.github/workflows/utils.sh cloneAndInstallThunder
30-
38+
3139
- name: Upload the library artifact
3240
uses: actions/upload-artifact@v3
3341
with:
@@ -36,9 +44,12 @@ jobs:
3644

3745
openrpc:
3846
name: Build Openrpc Artifacts
47+
needs: thunder
3948
runs-on: ubuntu-latest
4049
container:
41-
image: kevinshahfws/node-c:3.0
50+
image: node:23.3.0
51+
permissions:
52+
pull-requests: write
4253
steps:
4354
- name: Checkout
4455
uses: actions/checkout@v2
@@ -62,7 +73,7 @@ jobs:
6273
key: deps-node-modules-${{ hashFiles('package-lock.json') }}
6374

6475
- name: Install dependencies
65-
run: npm ci
76+
run: npm install
6677

6778
- name: Set file permissions
6879
run: |
@@ -84,19 +95,19 @@ jobs:
8495
with:
8596
name: manage
8697
path: src/sdks/manage
87-
98+
8899
- name: Upload Discovery SDK
89100
uses: actions/upload-artifact@v3
90101
with:
91102
name: discovery
92-
path: src/sdks/discovery
103+
path: src/sdks/discovery
93104

94105
core_sdk:
95106
name: Build Core SDK
96107
needs: [thunder, openrpc]
97108
runs-on: ubuntu-latest
98109
container:
99-
image: kevinshahfws/node-c:3.0
110+
image: node:23.3.0
100111
steps:
101112
- name: Checkout
102113
uses: actions/checkout@v2
@@ -107,7 +118,6 @@ jobs:
107118
name: core
108119
path: /__w/firebolt-apis/firebolt-apis/src/sdks/core
109120

110-
111121
- name: Download Thunder
112122
uses: actions/download-artifact@v3
113123
with:
@@ -121,27 +131,58 @@ jobs:
121131
key: deps-node-modules-${{ hashFiles('package-lock.json') }}
122132

123133
- name: Install npm dependencies
124-
run: npm ci
134+
run: |
135+
apt update
136+
apt install -y cmake
137+
npm install
125138
126139
- name: Generate core SDK source code
127140
run: |
128141
.github/workflows/utils.sh generate_cpp_core_sdk_source_code
129142
130-
- name: Build CXX Core SDK
143+
- name: Build CXX Core SDK
131144
run: |
145+
apt install -y python3-pip python3.11-venv
146+
python3 -m venv firebolt-env
147+
source firebolt-env/bin/activate
148+
pip install gcovr
149+
132150
.github/workflows/utils.sh build_core_cpp_sdk
133151
152+
- name: Test and Generate coverage report
153+
run: .github/workflows/utils.sh generate_core_sdk_coverage_report
154+
155+
- name: Display coverage report
156+
uses: irongut/[email protected]
157+
with:
158+
filename: coverage/coverage.cobertura.xml
159+
badge: true
160+
fail_below_min: false
161+
format: markdown
162+
hide_branch_rate: false
163+
hide_complexity: true
164+
indicators: true
165+
output: both
166+
thresholds: '80 40'
167+
168+
- name: Add coverage PR comment
169+
uses: marocchino/sticky-pull-request-comment@v2
170+
with:
171+
recreate: true
172+
path: code-coverage-results.md
173+
174+
134175
manage_sdk:
135176
name: Build Manage SDK
136177
needs: [thunder, openrpc]
137178
runs-on: ubuntu-latest
138179
container:
139-
image: kevinshahfws/node-c:3.0
180+
image: node:23.3.0
140181
steps:
141182
- name: Checkout
142183
uses: actions/checkout@v2
143184

144-
- name: Download Manage SDK
185+
- name: Download Manage SDK
145186
uses: actions/download-artifact@v3
146187
with:
147188
name: manage
@@ -160,22 +201,52 @@ jobs:
160201
key: deps-node-modules-${{ hashFiles('package-lock.json') }}
161202

162203
- name: Install npm dependencies
163-
run: npm ci
204+
run: |
205+
apt update
206+
apt install -y cmake
207+
npm install
164208
165209
- name: Generate manage SDK source code
166210
run: |
167211
.github/workflows/utils.sh generate_cpp_manage_sdk_source_code
168212
169-
- name: Build CXX manage SDK
213+
- name: Build CXX Manage SDK
170214
run: |
215+
apt install -y python3-pip python3.11-venv
216+
python3 -m venv firebolt-env
217+
source firebolt-env/bin/activate
218+
pip install gcovr
219+
171220
.github/workflows/utils.sh build_manage_cpp_sdk
172221
173-
dicovery_sdk:
222+
- name: Test and Generate coverage report
223+
run: .github/workflows/utils.sh generate_manage_sdk_coverage_report
224+
225+
- name: Display coverage report
226+
uses: irongut/[email protected]
227+
with:
228+
filename: coverage/coverage.cobertura.xml
229+
badge: true
230+
fail_below_min: false
231+
format: markdown
232+
hide_branch_rate: false
233+
hide_complexity: true
234+
indicators: true
235+
output: both
236+
thresholds: '80 40'
237+
238+
- name: Add coverage PR comment
239+
uses: marocchino/sticky-pull-request-comment@v2
240+
with:
241+
recreate: true
242+
path: code-coverage-results.md
243+
244+
discovery_sdk:
174245
name: Build Discovery SDK
175246
needs: [thunder, openrpc]
176247
runs-on: ubuntu-latest
177248
container:
178-
image: kevinshahfws/node-c:3.0
249+
image: node:23.3.0
179250
steps:
180251
- name: Checkout
181252
uses: actions/checkout@v2
@@ -199,12 +270,43 @@ jobs:
199270
key: deps-node-modules-${{ hashFiles('package-lock.json') }}
200271

201272
- name: Install npm dependencies
202-
run: npm ci
273+
run: |
274+
apt update
275+
apt install -y cmake
276+
npm install
203277
204278
- name: Generate discovery SDK source code
205279
run: |
206280
.github/workflows/utils.sh generate_cpp_discovery_sdk_source_code
207281
208-
- name: Build CXX Discovery SDK
282+
- name: Build CXX Discovery SDK
209283
run: |
210-
.github/workflows/utils.sh build_discovery_cpp_sdk
284+
apt install -y python3-pip python3.11-venv
285+
python3 -m venv firebolt-env
286+
source firebolt-env/bin/activate
287+
pip install gcovr
288+
289+
.github/workflows/utils.sh build_discovery_cpp_sdk
290+
291+
- name: Test and Generate coverage report
292+
run: .github/workflows/utils.sh generate_discovery_sdk_coverage_report
293+
294+
- name: Display coverage report
295+
uses: irongut/[email protected]
296+
with:
297+
filename: coverage/coverage.cobertura.xml
298+
badge: true
299+
fail_below_min: false
300+
format: markdown
301+
hide_branch_rate: false
302+
hide_complexity: true
303+
indicators: true
304+
output: both
305+
thresholds: '80 40'
306+
307+
- name: Add coverage PR comment
308+
uses: marocchino/sticky-pull-request-comment@v2
309+
with:
310+
recreate: true
311+
path: code-coverage-results.md
312+

.github/workflows/utils.sh

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ function unzipArtifact(){
182182
}
183183

184184
function cloneAndInstallThunder() {
185+
printenv
186+
185187
cd ..
186188

187189
git clone https://github.com/rdkcentral/Thunder.git
@@ -269,12 +271,27 @@ function build_cpp_sdk() {
269271

270272
echo " ************ Build ${sdk_name^} CPP SDK ************"
271273

272-
cd /__w/firebolt-apis/firebolt-apis/src/sdks/${sdk_name}/build/cpp/src/firebolt-${sdk_name}-native-sdk-${FIREBOLT_VERSION}/
274+
tar -xvf /__w/firebolt-apis/firebolt-apis/src/sdks/${sdk_name}/build/cpp/src/firebolt-${sdk_name}-native-sdk-${FIREBOLT_VERSION}.tgz -C /__w/firebolt-apis/firebolt-apis/
275+
cd /__w/firebolt-apis/firebolt-apis/firebolt-${sdk_name}-native-sdk-${FIREBOLT_VERSION}
273276
chmod +x ./build.sh
274277

275278
./build.sh -s "/__w/thunder/install/" || exit 9999
276279
}
277280

281+
282+
function generate_coverage_report(){
283+
FIREBOLT_VERSION=$(node -p "require('./package.json').version")
284+
echo "The version from package.json is $FIREBOLT_VERSION"
285+
local sdk_name=$1
286+
287+
echo " ************ Generate coverage report for ${sdk_name^} CPP SDK ************"
288+
289+
cd /__w/firebolt-apis/firebolt-apis/firebolt-${sdk_name}-native-sdk-${FIREBOLT_VERSION}
290+
cmake --build build --target coverage
291+
292+
mv /__w/firebolt-apis/firebolt-apis/firebolt-${sdk_name}-native-sdk-${FIREBOLT_VERSION}/build/test/coverage /__w/firebolt-apis/firebolt-apis/
293+
}
294+
278295
# Check argument and call corresponding function
279296
case "$1" in
280297
runTests) runTests ;;
@@ -288,6 +305,9 @@ case "$1" in
288305
build_core_cpp_sdk) build_cpp_sdk "core" ;;
289306
build_manage_cpp_sdk) build_cpp_sdk "manage" ;;
290307
build_discovery_cpp_sdk) build_cpp_sdk "discovery" ;;
308+
generate_core_sdk_coverage_report) generate_coverage_report "core" ;;
309+
generate_manage_sdk_coverage_report) generate_coverage_report "manage" ;;
310+
generate_discovery_sdk_coverage_report) generate_coverage_report "discovery" ;;
291311
*)
292312
echo "Invalid function specified."
293313
exit 1

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"validate:each": "npx firebolt-openrpc validate --input src/openrpc --schemas src/schemas --transformations",
1717
"validate:compiled": "npx firebolt-openrpc validate --input dist/firebolt-open-rpc.json --pass-throughs && npm run validate --workspaces",
1818
"validate": "npm run validate:each && npm run validate:compiled ",
19-
"compile": "npx firebolt-openrpc openrpc --input src --template src/template/openrpc/template.json --output ./dist/firebolt-open-rpc.json --schemas src/schemas",
19+
"compile": "npx firebolt-openrpc openrpc --input src --template src/template/openrpc/template.json --platformApi ./dist/firebolt-open-rpc.json --appApi ./dist/firebolt-app-open-rpc.json --schemas src/schemas",
2020
"slice": "npm run slice --workspaces",
2121
"sdks": "npm run sdk --workspaces",
2222
"docs": "npm run docs --workspaces",
@@ -45,7 +45,7 @@
4545
"devDependencies": {
4646
"@commitlint/cli": "^17.0.3",
4747
"@commitlint/config-conventional": "^17.0.3",
48-
"@firebolt-js/openrpc": "3.1.1",
48+
"@firebolt-js/openrpc": "../firebolt-openrpc",
4949
"@firebolt-js/schemas": "2.0.0",
5050
"@saithodev/semantic-release-backmerge": "^3.2.0",
5151
"@semantic-release/changelog": "^6.0.1",

src/openrpc/_internal.json

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
},
1515
{
1616
"name": "capabilities",
17-
"x-uses": [
18-
"xrn:firebolt:capability:lifecycle:initialize"
19-
]
17+
"x-uses": ["xrn:firebolt:capability:lifecycle:initialize"]
2018
}
2119
],
2220
"summary": "Initialize the SDK / FEE session.",
@@ -26,7 +24,7 @@
2624
"name": "version",
2725
"required": true,
2826
"schema": {
29-
"$ref": "https://meta.comcast.com/firebolt/types#/definitions/SemanticVersion"
27+
"$ref": "https://meta.rdkcentral.com/firebolt/schemas/types#/definitions/SemanticVersion"
3028
},
3129
"summary": "The semantic version of the SDK."
3230
}
@@ -35,7 +33,15 @@
3533
"name": "session",
3634
"summary": "Info about the SDK/FEE session",
3735
"schema": {
38-
"$ref": "#/components/schemas/InitializeResult"
36+
"type": "object",
37+
"required": ["version"],
38+
"properties": {
39+
"version": {
40+
"$ref": "https://meta.rdkcentral.com/firebolt/schemas/types#/definitions/SemanticVersion",
41+
"description": "The semantic version of the FEE."
42+
}
43+
},
44+
"additionalProperties": false
3945
}
4046
},
4147
"examples": [
@@ -59,28 +65,15 @@
5965
"major": 1,
6066
"minor": 0,
6167
"patch": 0,
62-
"readable": "Firebolt FEE 1.0.0"
68+
"readable": "Firebolt FEE 1.0.0"
6369
}
6470
}
6571
}
66-
}
67-
]
72+
}
73+
]
6874
}
6975
],
7076
"components": {
71-
"schemas": {
72-
"InitializeResult": {
73-
"title": "InitializeResult",
74-
"type": "object",
75-
"required": ["version"],
76-
"properties": {
77-
"version": {
78-
"$ref": "https://meta.comcast.com/firebolt/types#/definitions/SemanticVersion",
79-
"description": "The semantic version of the FEE."
80-
}
81-
},
82-
"additionalProperties": false
83-
}
84-
}
77+
"schemas": {}
8578
}
86-
}
79+
}

0 commit comments

Comments
 (0)