Skip to content

Commit c65f775

Browse files
authored
Refactoring/768 run sonar after fast checks too (#769)
* Run report after fast-checks * Fix missed reference * Add information to the summary
1 parent 2789cfb commit c65f775

5 files changed

Lines changed: 60 additions & 21 deletions

File tree

.github/workflows/merge-gate.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ jobs:
1010
permissions:
1111
contents: read
1212

13+
fast-report:
14+
name: Fast Report
15+
needs:
16+
- run-fast-checks
17+
uses: ./.github/workflows/report.yml
18+
secrets: inherit
19+
permissions:
20+
contents: read
21+
1322
approve-run-slow-tests:
1423
name: Approve Running Slow Tests?
1524
runs-on: "ubuntu-24.04"

doc/changes/unreleased.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@
44

55
This release includes an update of `action/upload-pages-artifact` from v4 to v5.0.0. With this
66
change, now all actions used in the PTB run with Node.js 24. This is important as support
7-
for Node.js 20 reaches it end-of-life in April of 2026 and support for it in GitHub will end in
7+
for Node.js 20 reaches it end-of-life in April 2026 and support for it in GitHub will end in
88
September 2026; for more details, see GitHub's [deprecation notice](https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/).
99

10+
The `report.yml` is also called after the `checks.yml` completes. This allows users
11+
to get linting, security, and unit test coverage before running the `slow-checks.yml`,
12+
as described in the [Pull Request description](https://exasol.github.io/python-toolbox/main/user_guide/features/github_workflows/index.html#pull-request).
13+
1014
## Refactoring
1115

1216
* #764: Updated `action/upload-pages-artifact` from v4 to [v5](https://github.com/actions/upload-pages-artifact/releases/tag/v5.0.0)
17+
* #768: Updated `merge-gate.yml` to execute the `report.yml` after the `checks.yml` completes
1318

1419
## Bugfix
1520

doc/user_guide/features/github_workflows/github_project_configuration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Branch Protection
77
-----------------
88

99
The best and most maintainable way to have solid branch protection
10-
(:code:`Settings/Branches/main`) is to require the workflow :code:`merge-gate / Allow
10+
(:code:`Settings/Branches/main`) is to require the workflow :code:`Merge Gate / Allow
1111
Merge` to pass successfully. Additionally, if it makes sense for your project,
1212
you can further require that ``SonarCloud Code Analysis`` passes.
1313

doc/user_guide/features/github_workflows/index.rst

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -112,31 +112,47 @@ When configured as described on :ref:`github_project_configuration`, the
112112
workflows, like ``slow-checks.yml``. This allows developers to update their pull
113113
request more often and to only periodically run the more time-expensive tests.
114114

115+
The `report.yml` is called twice:
116+
#. after the steps in `checks.yml` successfully finish - this allows developers
117+
to get faster feedback for linting, security, and unit test coverage.
118+
#. after the steps in `slow-checks.yml` successfully finish - this gives developers an
119+
overview of the total coverage, as well as the information provided from running
120+
the `checks.yml`
121+
122+
In both scenarios, the results are posted in the PR and made available on Sonar's UI.
123+
Note that Sonar does not keep historical information, so it will only show the latest
124+
information provided to it.
125+
115126
If one of the jobs in the chain fails (or if ``run-slow-tests`` is not approved),
116127
then the subsequent jobs will not be started.
117128

118129
.. mermaid::
119130

120131
graph TD
121-
%% Workflow Triggers (Solid Lines)
122-
ci[ci.yml] --> merge-gate[merge-gate.yml]
123-
ci --> metrics[report.yml]
124-
125-
merge-gate --> fast-checks[checks.yml]
126-
merge-gate --> run-slow-tests[run-slow-tests]
127-
run-slow-tests -.->|needs| slow-checks[slow-checks.yml]
128-
129-
%% Dependencies / Waiting (Dotted Lines)
130-
fast-checks -.->|needs| approve-merge[approve-merge]
131-
slow-checks -.->|needs| approve-merge
132-
133-
%% Final Dependency
134-
approve-merge -.->|needs| metrics
135-
136-
%% Visual Styling to distinguish jobs
137-
style approve-merge fill:#fff,stroke:#333,stroke-dasharray: 5 5
138-
style run-slow-tests fill:#fff,stroke:#333,stroke-dasharray: 5 5
139-
132+
%% Define Nodes
133+
ci_job[ci.yml]
134+
gate[merge-gate.yml]
135+
checks[checks.yml]
136+
slow_run[run-slow-tests]
137+
slow_checks[slow-checks.yml]
138+
report[report.yml]
139+
approver[approve-merge]
140+
141+
%% Workflow Triggers
142+
ci_job --> gate
143+
gate --> checks
144+
gate --> slow_run
145+
slow_run -.->|needs| slow_checks
146+
147+
%% Dependencies
148+
checks -.->|needs| report
149+
checks -.->|needs| approver
150+
slow_checks -.->|needs| approver
151+
approver -.->|needs| report
152+
153+
%% Styling
154+
style approver fill:#fff,stroke:#333,stroke-dasharray: 5 5
155+
style slow_run fill:#fff,stroke:#333,stroke-dasharray: 5 5
140156

141157
.. _pr_merge_yml:
142158

exasol/toolbox/templates/github/workflows/merge-gate.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ jobs:
1010
permissions:
1111
contents: read
1212

13+
fast-report:
14+
name: Fast Report
15+
needs:
16+
- run-fast-checks
17+
uses: ./.github/workflows/report.yml
18+
secrets: inherit
19+
permissions:
20+
contents: read
21+
1322
approve-run-slow-tests:
1423
name: Approve Running Slow Tests?
1524
runs-on: "(( os_version ))"

0 commit comments

Comments
 (0)