Skip to content

Commit 225e46a

Browse files
halnasriLucaFue
authored andcommitted
halnasri-Revisit_TT_INDICATORS (#28)
* revisit TA-INDICATORS * fix dotstop * added tow statement about AWIs for the testing * added new coverage_gate to parent workflow * small fix * edited the coverage_gate workflow * rewrite statement JLS-55 * fix workflow * add pr_count_gat to parent-workflow * fix pr_count_gate * fix pr_count_gate * edited statements and context file of TA-INDICATORS * edited context file * Update TSF/trustable/statements/JLS-55.md Co-authored-by: LucaFue <luca.fueger@d-fine.de> Signed-off-by: halnasri <hatem.alnasri@d-fine.com> * Update TSF/trustable/statements/JLS-55.md Co-authored-by: LucaFue <luca.fueger@d-fine.de> Signed-off-by: halnasri <hatem.alnasri@d-fine.com> * Update TSF/trustable/statements/JLS-54.md Co-authored-by: LucaFue <luca.fueger@d-fine.de> Signed-off-by: halnasri <hatem.alnasri@d-fine.com> * Update TSF/trustable/statements/JLS-54.md Co-authored-by: LucaFue <luca.fueger@d-fine.de> Signed-off-by: halnasri <hatem.alnasri@d-fine.com> * Edited JLS-55 Signed-off-by: halnasri <hatem.alnasri@d-fine.com> * fixed some answers of the context file Signed-off-by: halnasri <hatem.alnasri@d-fine.com> * Update coverage threshold to 99.19% Signed-off-by: halnasri <hatem.alnasri@d-fine.com> * Update answers in TA-INDICATORS_CONTEXT.md Clarified answers regarding risk analyses and monitoring mechanisms in the context of AWIs. Signed-off-by: halnasri <hatem.alnasri@d-fine.com> --------- Signed-off-by: halnasri <hatem.alnasri@d-fine.com> Co-authored-by: LucaFue <luca.fueger@d-fine.de>
1 parent 603a563 commit 225e46a

File tree

10 files changed

+141
-47
lines changed

10 files changed

+141
-47
lines changed

.dotstop.dot

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,8 @@ digraph G {
8282
"JLS-51" [sha="190e17d59795c9ed3b25a0a8bf57497de1e0d06ab90b3f6ba47b543c95edea43"];
8383
"JLS-52" [sha="8539f924c31974a2722615d2410a25336a5d6a9f399f16dc485be83f7f87a5ff"];
8484
"JLS-53" [sha="d9f7e732e34b0ec79305dde4c5b3d60906559ef1d90bc3ce2906e28a90293844"];
85-
"JLS-54" [sha="e1d713fcbd323526a04ea0c7f963a4425bab1567cc7d701546d29cb05f8ac92f"];
85+
"JLS-54" [sha="f1ff5d3aff697980bcf072e27e00f9916052aceb4796fe1417486ddc80d5e241"];
8686
"JLS-55" [sha="321c775e2acf0267ac1753eb772fedf1bcca18029714071c6e55d999f6dd008a"];
87-
"JLS-56" [sha="6fdd3ab1172c1df5658f140d104d51559080aa32389a5a842b93cfbd394593b3"];
88-
"JLS-57" [sha="6261b6cf44be2e742af1e1d687f1233161ab7cdaf6f1c0a6e31e671a7451adc5"];
89-
"JLS-58" [sha="dbdb83427fd82fd3be5e90ab761945a0346b33740b9ea80fd37122dfa6baaa60"];
90-
"JLS-59" [sha="2ac670fb73ace2f582d7351baf2ea3bbd16a00dbe01cc56997ff86b564d69840"];
91-
"JLS-60" [sha="035303bc28dfc2e2a80d5b4b9de3a45406508a0c5c27d511e676159db227d9b9"];
9287
"JLS-61" [sha="151f1cda2384ae4935d29d300c3424bca710378fa3689bbcff69b06dc86bb692"];
9388
"JLS-62" [sha="60848232c2989d0282b64792d7da7a57c04ff368d2ac9deae09c3743251dfc79"];
9489
"JLS-63" [sha="2b50e79c3b43c6815b5dc15c7909ce5fb513e98fadb28ddfa40938f20f5d0427"];
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Coverage Gate
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
artifact_id:
7+
description: "Unused, kept for consistency with parent"
8+
required: true
9+
type: string
10+
11+
jobs:
12+
coverage_gate:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Download coverage HTML artifact
20+
uses: actions/download-artifact@v4
21+
with:
22+
name: code-coverage-report
23+
path: coverage_html
24+
25+
- name: Debug list coverage files
26+
run: |
27+
echo "=== coverage_html contents ==="
28+
ls -R coverage_html
29+
30+
- name: Enforce coverage threshold
31+
run: |
32+
THRESHOLD=99.19
33+
34+
echo "=== Extracting line coverage for 'Lines:' from index.html ==="
35+
36+
HEADER_BLOCK=$(grep -A1 'Lines:' coverage_html/index.html || true)
37+
echo "$HEADER_BLOCK"
38+
39+
LINE_COV=$(echo "$HEADER_BLOCK" | grep -oE "[0-9]+(\.[0-9]+)?" | head -n1 || true)
40+
echo "Extracted Line coverage: '${LINE_COV}'"
41+
42+
if [ -z "$LINE_COV" ]; then
43+
echo "Could not extract line coverage for 'Lines:' from index.html"
44+
exit 1
45+
fi
46+
47+
COMPARE=$(awk -v cov="$LINE_COV" -v thr="$THRESHOLD" 'BEGIN { if (cov < thr) print "lt"; else print "ge"; }')
48+
49+
if [ "$COMPARE" = "lt" ]; then
50+
echo "Coverage below threshold, failing job."
51+
exit 1
52+
fi
53+
54+
echo "Coverage is above threshold."

.github/workflows/parent-workflow.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010

1111
permissions:
1212
contents: read
13+
pull-requests: read
1314

1415
jobs:
1516
labeler:
@@ -63,6 +64,17 @@ jobs:
6364
with:
6465
artifact_id: "ubuntu-${{ github.sha }}"
6566

67+
coverage_gate:
68+
name: Run Coverage Gate Workflow
69+
needs: [ubuntu]
70+
uses: ./.github/workflows/coverage_gate.yml
71+
with:
72+
artifact_id: "coverage_gate-${{ github.sha }}"
73+
74+
pr_count_gate:
75+
name: Run PR Count Gate Workflow
76+
uses: ./.github/workflows/pr_count_gate.yml
77+
6678
dependency_review:
6779
name: Run dependency_review Workflow
6880
if: ${{ github.event_name == 'pull_request' }} # only run dependency_review for PRs
@@ -73,7 +85,7 @@ jobs:
7385
collect_artifacts_pr:
7486
name: "Collect Results & Deploy (PR)"
7587
if: github.event_name == 'pull_request'
76-
needs: [labeler, SME_review_checker, check_amalgamation, test_trudag_extensions, dependency_review, codeql, ubuntu]
88+
needs: [labeler, SME_review_checker, check_amalgamation, test_trudag_extensions, dependency_review, codeql, ubuntu, coverage_gate, pr_count_gate]
7789
runs-on: ubuntu-latest
7890
strategy:
7991
matrix:
@@ -106,7 +118,7 @@ jobs:
106118
collect_artifacts_non_pr:
107119
name: "Collect Results & Deploy (Non-PR)"
108120
if: github.event_name != 'pull_request'
109-
needs: [labeler, test_trudag_extensions, codeql, ubuntu] # no check_amalgamation, dependency_review or SME_review_checker if non PR
121+
needs: [labeler, test_trudag_extensions, codeql, ubuntu, coverage_gate, pr_count_gate] # no check_amalgamation, dependency_review or SME_review_checker if non PR
110122
runs-on: ubuntu-latest
111123
strategy:
112124
matrix:
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: PR Count Gate
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
pr_count_gate:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Count open pull requests
12+
id: pr-count
13+
uses: actions/github-script@v7
14+
with:
15+
github-token: ${{ secrets.GITHUB_TOKEN }}
16+
script: |
17+
const { owner, repo } = context.repo;
18+
const per_page = 100;
19+
let page = 1;
20+
let total = 0;
21+
22+
while (true) {
23+
const { data } = await github.rest.pulls.list({
24+
owner,
25+
repo,
26+
state: 'open',
27+
per_page,
28+
page,
29+
});
30+
if (data.length === 0) break;
31+
total += data.length;
32+
if (data.length < per_page) break;
33+
page++;
34+
}
35+
36+
core.info(`Open pull requests: ${total}`);
37+
core.setOutput('open_prs', total.toString());

TSF/trustable/assertions/TA-INDICATORS_CONTEXT.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,19 @@ set of AWIs is incorrect, or the tolerance is too lax.
5757
**Evidence**
5858

5959
- Risk analyses
60-
- **Answer**:
60+
- **Answer**: There is no dedicated TSF risk analysis focusing specifically on runtime behaviour of `eclipse-score/inc_nlohmann_json`.
6161
- List of advance warning indicators
62-
- **Answer**:
62+
- **Answer**: The only two introduced AWIs are provided in JLS-54 and JLS-55.
6363
- List of Expectations for monitoring mechanisms
64-
- **Answer**:
64+
- **Answer**: There are no dedicated monitoring mechanisms defined. Any expectations for monitoring apply at system or integration level and are expected to be specified and implemented by the integrator.
6565
- List of implemented monitoring mechanisms
66-
- **Answer**:
66+
- **Answer**: There are no dedicated monitoring mechanisms for AWIs in the sense of continuous or in-field monitoring. The two AWIs (coverage and PR count) are evaluated only when CI workflows are executed and are used as quality gates at CI time, rather than as a separate, continuous monitoring system (see JLS-54 and JLS-55).
6767
- List of identified misbehaviours without advance warning indicators
68-
- **Answer**:
68+
- **Answer**: Provided by JLS-69.
6969
- List of advance warning indicators without implemented monitoring mechanisms
70-
- **Answer**:
70+
- **Answer**: All currently defined AWIs (JLS-54 and JLS-55) are evaluated via CI runs, but there is no additional, dedicated monitoring mechanism beyond these CI executions.
7171
- Advance warning signal data as time series (see TA-DATA)
72-
- **Answer**:
72+
- **Answer**: The only AWIs in JLS-54 and JLS-55 are implemented as part of the CI and therefore saved as time series (see JLS-18 and JLS-45).
7373

7474
**Confidence scoring**
7575

@@ -80,27 +80,27 @@ monitoring mechanisms have been implemented to collect the required data.
8080
**Checklist**
8181

8282
- How appropriate/thorough are the analyses that led to the indicators?
83-
- **Answer**: Since no misbehaviours for the use of the library for parsing and verification of JSON data according to RFC8259 have been identified, no warning indicators are implemented.
83+
- **Answer**: For eclipse-score/inc_nlohmann_json, the library itself is a statically integrated, header-only component without stream processing loops. No runtime misbehaviours specific to this repository have been identified, and therefore no runtime AWIs are implemented for the library itself. The two AWIs that do exist (coverage threshold and PR-count limit) are based on the assumption that CI test results and review load correlate with potential misbehaviours in the library and its evolution, and are therefore focused on test and process quality rather than runtime behaviour (see JLS-54 and JLS-55).
8484
- How confident can we be that the list of indicators is comprehensive?
85-
- **Answer**:
85+
- **Answer**: For the scope of `eclipse-score/inc_nlohmann_json` as a static library, we are reasonably confident that CI-based indicators on test coverage and the count of open PRs are sufficient.
8686
- Could there be whole categories of warning indicators still missing?
87-
- **Answer**: Yes, there could. Within S-CORE, however, any warning indicator that is not natively implemented within the original nlohmann/json should be implemented in the wrapper defining the interface between the library and the project using it.
87+
- **Answer**: Yes, there could. In particular, runtime performance or stability indicators in systems that use the library are not covered here. Any missing warning indicators are expected to be implemented by the integrator (see AOU-09).
8888
- How has the list of advance warning indicators varied over time?
89-
- **Answer**:
89+
- **Answer**: The current AWIs (coverage threshold and pr count threshold on protected branches) were introduced as CI-based quality gates. No additional AWIs have been added or removed so far (see JLS-54 and JLS-55).
9090
- How confident are we that the indicators are leading/predictive?
91-
- **Answer**:
91+
- **Answer**: The indicators are leading in the sense that they prevent changes which reduce test coverage, or are made in an overloaded PR situation, from entering protected branches and being used as a basis for integration and release.
9292
- Are there misbehaviours that have no advance warning indicators?
93-
- **Answer**:
93+
- **Answer**: Potential runtime misbehaviours in consuming systems are not covered by AWIs in this repository.
9494
- Can we collect data for all indicators?
95-
- **Answer**:
95+
- **Answer**: Both indicators (JLS-54 and JLS-55) are derived from CI runs, and the required data (coverage and pr count) is collected automatically for each CI execution.
9696
- Are the monitoring mechanisms used included in our Trustable scope?
97-
- **Answer**:
97+
- **Answer**: There are no continuously running runtime monitoring mechanisms. The only related mechanisms are the CI workflows implementing JLS-54 and JLS-55, they run only when CI is executed.
9898
- Are there gaps or trends in the data?
99-
- **Answer**:
99+
- **Answer**: There is no trend analysis preformed on AWIs. However, there is trend analysis done as a proof of concept to the failure rate of CI test (see JLS-17). Potential gaps could arrise during the integration of the library (see AOU-09).
100100
- If there are gaps or trends, are they analysed and addressed?
101-
- **Answer**:
101+
- **Answer**: There are no trends identified (see the question above). Any gaps should be closed by the integrator.
102102
- Is the data actually predictive/useful?
103-
- **Answer**:
103+
- **Answer**: Yes, the CI data from the AWIs is useful to prevent regressions in the tested behaviour of the library and possible issues introduced due to a large number of open PRs from entering protected branches.
104104
- Are indicators from code, component, tool, or data inspections taken into
105105
consideration?
106-
- **Answer**:
106+
- **Answer**: Yes, all types of indicator are taken into consideration.

TSF/trustable/statements/JLS-54.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
---
22
level: 1.1
33
normative: true
4+
references:
5+
- type: verbose_file
6+
path: "./.github/workflows/coverage_gate.yml"
7+
description: "GitHub Actions workflow enforcing a minimum coverage threshold."
8+
- type: verbose_file
9+
path: "./.github/workflows/parent-workflow.yml"
10+
description: "Parent CI workflow that calls the coverage_gate workflow."
411
---
512

6-
In eclipse-score/inc_nlohmann_json, a GitHub workflow continuously monitors the fraction of failing unit and integration tests on protected branches (e.g., main, release branches). If the failure rate exceeds a defined threshold over a configurable number of consecutive runs, the workflow blocks further merges to the affected branch, and restores the last known-good commit (last fully passing pipeline) as the default basis for integration and release.
13+
In the eclipse-score/inc_nlohmann_json repository, code coverage for unit and integration tests is measured in every CI run, and a minimum coverage threshold is defined for each protected branch. If coverage for a change would fall below this threshold, the CI workflow blocks the merge until coverage is restored or the change is rejected.

TSF/trustable/statements/JLS-55.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
---
22
level: 1.1
33
normative: true
4+
references:
5+
- type: verbose_file
6+
path: "./.github/workflows/pr_count_gate.yml"
7+
description: "GitHub Actions workflow enforcing a limit on open PRs."
8+
- type: verbose_file
9+
path: "./.github/workflows/parent-workflow.yml"
10+
description: "Parent CI workflow that calls the pr_count_gate workflow."
411
---
512

6-
In eclipse-score/inc_nlohmann_json, a GitHub workflow tracks CI pipeline duration (build + tests) over time. If the median runtime increases beyond a defined relative threshold compared to a rolling baseline, the workflow flags the regression, blocks releases from the affected commit(s), and opens or updates an issue to investigate performance-related misbehaviours.
13+
In eclipse-score/inc_nlohmann_json, a GitHub Actions workflow checks the number of open pull requests in the main branch. If the number exceeds a defined threshold, the workflow fails and blocks further merges until the number of open pull requests is reduced below that threshold.

TSF/trustable/statements/JLS-56.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

TSF/trustable/statements/JLS-59.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

TSF/trustable/statements/JLS-60.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)