Skip to content

Commit be8665d

Browse files
committed
Merge remote-tracking branch 'origin/main' into dependabot/npm_and_yarn/datatables.net-2.3.6
2 parents 3169ea2 + dc4cb6d commit be8665d

5 files changed

Lines changed: 231 additions & 19 deletions

File tree

.github/quality-gates-pr.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"qualityGates": [
3+
{
4+
"metric": "test-success-rate",
5+
"name": "Overall Tests Success Rate",
6+
"threshold": 100.0,
7+
"criticality": "FAILURE"
8+
},
9+
{
10+
"metric": "bugs",
11+
"name": "Potential Bugs in Whole Project",
12+
"threshold": 0.0,
13+
"criticality": "FAILURE"
14+
},
15+
{
16+
"metric": "style",
17+
"name": "Style Violation in Whole Project",
18+
"threshold": 0.0,
19+
"criticality": "FAILURE"
20+
}
21+
]
22+
}

.github/quality-monitor-pr.json

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
{
2+
"tests": {
3+
"name": "Tests",
4+
"tools": [
5+
{
6+
"id": "junit",
7+
"name": "Unit Tests",
8+
"pattern": "**/target/surefire-reports/TEST*data*.xml"
9+
},
10+
{
11+
"id": "junit",
12+
"icon": "rocket",
13+
"name": "Integration Tests",
14+
"pattern": "**/target/failsafe-reports/TEST*.xml"
15+
},
16+
{
17+
"id": "junit",
18+
"icon": "no_entry",
19+
"name": "Architecture Tests",
20+
"pattern": "**/target/surefire-reports/TEST*archunit*.xml"
21+
}
22+
]
23+
},
24+
"analysis": [
25+
{
26+
"name": "Style",
27+
"id": "style",
28+
"tools": [
29+
{
30+
"id": "checkstyle",
31+
"pattern": "**/target/**checkstyle-result.xml"
32+
},
33+
{
34+
"id": "pmd",
35+
"pattern": "**/target/pmd-*/pmd.xml"
36+
},
37+
{
38+
"id": "java",
39+
"icon": "coffee",
40+
"pattern": "**/maven.log"
41+
}
42+
]
43+
},
44+
{
45+
"name": "Bugs",
46+
"id": "bugs",
47+
"icon": "bug",
48+
"tools": [
49+
{
50+
"id": "spotbugs",
51+
"sourcePath": "src/main/java",
52+
"pattern": "**/target/spotbugsXml.xml"
53+
},
54+
{
55+
"id": "error-prone",
56+
"pattern": "**/maven.log"
57+
}
58+
]
59+
},
60+
{
61+
"name": "Vulnerabilities",
62+
"id": "vulnerabilities",
63+
"icon": "shield",
64+
"tools": [
65+
{
66+
"id": "owasp-dependency-check",
67+
"icon": "shield",
68+
"pattern": "**/target/dependency-check-report.json"
69+
}
70+
]
71+
}
72+
],
73+
"coverage": [
74+
{
75+
"name": "Coverage for New Code",
76+
"tools": [
77+
{
78+
"id": "jacoco",
79+
"metric": "line",
80+
"scope": "new",
81+
"sourcePath": "src/main/java",
82+
"pattern": "**/target/site/jacoco/jacoco.xml"
83+
},
84+
{
85+
"id": "jacoco",
86+
"metric": "branch",
87+
"scope": "new",
88+
"sourcePath": "src/main/java",
89+
"pattern": "**/target/site/jacoco/jacoco.xml"
90+
}
91+
]
92+
},
93+
{
94+
"name": "Coverage for Whole Project",
95+
"tools": [
96+
{
97+
"id": "jacoco",
98+
"metric": "line",
99+
"sourcePath": "src/main/java",
100+
"pattern": "**/target/site/jacoco/jacoco.xml"
101+
},
102+
{
103+
"id": "jacoco",
104+
"metric": "branch",
105+
"sourcePath": "src/main/java",
106+
"pattern": "**/target/site/jacoco/jacoco.xml"
107+
}
108+
]
109+
}
110+
],
111+
"metrics": {
112+
"name": "Software Metrics",
113+
"tools": [
114+
{
115+
"id": "metrics",
116+
"pattern": "**/metrics/pmd.xml",
117+
"metric": "CYCLOMATIC_COMPLEXITY"
118+
},
119+
{
120+
"id": "metrics",
121+
"pattern": "**/metrics/pmd.xml",
122+
"metric": "COGNITIVE_COMPLEXITY"
123+
},
124+
{
125+
"id": "metrics",
126+
"pattern": "**/metrics/pmd.xml",
127+
"metric": "NPATH_COMPLEXITY"
128+
},
129+
{
130+
"id": "metrics",
131+
"pattern": "**/metrics/pmd.xml",
132+
"metric": "LOC"
133+
},
134+
{
135+
"id": "metrics",
136+
"pattern": "**/metrics/pmd.xml",
137+
"metric": "NCSS"
138+
},
139+
{
140+
"id": "metrics",
141+
"pattern": "**/metrics/pmd.xml",
142+
"metric": "COHESION"
143+
},
144+
{
145+
"id": "metrics",
146+
"pattern": "**/metrics/pmd.xml",
147+
"metric": "WEIGHT_OF_CLASS"
148+
}
149+
]
150+
}
151+
}

.github/quality-monitor.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
"icon": "shield",
6464
"tools": [
6565
{
66-
"icon": "shield",
6766
"id": "owasp-dependency-check",
6867
"icon": "shield",
6968
"pattern": "**/target/dependency-check-report.json"
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: 'Quality Monitor Comment PR'
2+
3+
on:
4+
workflow_run:
5+
workflows: [ "Quality Monitor Build" ]
6+
types: [ completed ]
7+
8+
permissions:
9+
actions: read
10+
contents: read
11+
pull-requests: write
12+
checks: write
13+
14+
jobs:
15+
comment:
16+
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request' }}
17+
runs-on: ubuntu-latest
18+
name: Comment on PR
19+
20+
steps:
21+
- name: Extract PR number and SHA
22+
id: pr
23+
run: |
24+
pr_number='${{ github.event.workflow_run.pull_requests[0].number }}'
25+
echo "number=$pr_number" >> "$GITHUB_OUTPUT"
26+
sha='${{ github.event.workflow_run.head_sha }}'
27+
echo "sha=$sha" >> "$GITHUB_OUTPUT"
28+
- name: Checkout PR
29+
uses: actions/checkout@v6
30+
with:
31+
ref: ${{ steps.pr.outputs.sha }}
32+
- name: Download PR Quality Reports from Quality Monitor Build workflow
33+
uses: dawidd6/action-download-artifact@v12
34+
with:
35+
run_id: ${{ github.event.workflow_run.id }}
36+
name: quality-reports
37+
- name: Read Quality Monitor Configuration
38+
id: quality-monitor
39+
run: echo "json=$(jq -c . .github/quality-monitor-pr.json)" >> "$GITHUB_OUTPUT"
40+
- name: Read Quality Gates Configuration
41+
id: quality-gates
42+
run: echo "json=$(jq -c . .github/quality-gates-pr.json)" >> "$GITHUB_OUTPUT"
43+
- name: Run Quality Monitor and Comment on PR
44+
uses: uhafner/quality-monitor@main
45+
with:
46+
sha: ${{ steps.pr.outputs.sha }}
47+
config: ${{ steps.quality-monitor.outputs.json }}
48+
quality-gates: ${{ steps.quality-gates.outputs.json }}
49+
pr-number: ${{ steps.pr.outputs.number }}
50+
comments-strategy: REMOVE
51+
show-headers: true
52+
title-metric: none

.github/workflows/quality-monitor-comment.yml

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,15 @@ permissions:
1313

1414
jobs:
1515
comment:
16-
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request' }}
16+
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' && github.event.workflow_run.head_branch == 'main' }}
1717
runs-on: ubuntu-latest
18-
name: Comment on PR
18+
name: Comment main branch
1919

2020
steps:
21-
- name: Extract PR number and SHA
22-
id: pr
23-
run: |
24-
pr_number='${{ github.event.workflow_run.pull_requests[0].number }}'
25-
echo "number=$pr_number" >> "$GITHUB_OUTPUT"
26-
sha='${{ github.event.workflow_run.head_sha }}'
27-
echo "sha=$sha" >> "$GITHUB_OUTPUT"
28-
- name: Checkout PR
21+
- name: Checkout main branch
2922
uses: actions/checkout@v6
30-
with:
31-
ref: ${{ steps.pr.outputs.sha }}
32-
- name: Download PR Quality Reports from Quality Monitor Build workflow
33-
uses: dawidd6/action-download-artifact@v11
23+
- name: Download Quality Reports from Quality Monitor Build workflow
24+
uses: dawidd6/action-download-artifact@v12
3425
with:
3526
run_id: ${{ github.event.workflow_run.id }}
3627
name: quality-reports
@@ -41,12 +32,9 @@ jobs:
4132
id: quality-gates
4233
run: echo "json=$(jq -c . .github/quality-gates.json)" >> "$GITHUB_OUTPUT"
4334
- name: Run Quality Monitor and Comment on PR
44-
uses: uhafner/quality-monitor@changed-lines
35+
uses: uhafner/quality-monitor@main
4536
with:
46-
sha: ${{ steps.pr.outputs.sha }}
4737
config: ${{ steps.quality-monitor.outputs.json }}
4838
quality-gates: ${{ steps.quality-gates.outputs.json }}
49-
pr-number: ${{ steps.pr.outputs.number }}
50-
comments-strategy: REMOVE
5139
show-headers: true
5240
title-metric: none

0 commit comments

Comments
 (0)