Skip to content

Commit a5ec004

Browse files
authored
ci: separate out precommit job into a different workflow (#918)
**Description** Previously, the precommit check was only running on the code changes since it exists inside the build_and_test.yaml workflow since #774. This was a problematic when, for example, the PR only changing the documentation was opened because the spellchecks etc were not running on that PR. This essentially reverts #774. --------- Signed-off-by: Takeshi Yoneda <[email protected]>
1 parent 751c465 commit a5ec004

File tree

3 files changed

+58
-40
lines changed

3 files changed

+58
-40
lines changed

.github/workflows/build_and_test.yaml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -33,34 +33,8 @@ permissions:
3333
packages: write
3434

3535
jobs:
36-
style:
37-
name: Check
38-
strategy:
39-
fail-fast: false
40-
matrix:
41-
os:
42-
- ubuntu-latest
43-
- macos-latest
44-
runs-on: ${{ matrix.os }}
45-
steps:
46-
- uses: actions/checkout@v4
47-
- uses: actions/setup-go@v5
48-
with:
49-
cache: false
50-
go-version-file: go.mod
51-
- uses: actions/cache@v4
52-
with:
53-
path: |
54-
~/.cache/go-build
55-
~/.cache/golangci-lint
56-
~/go/pkg/mod
57-
~/go/bin
58-
key: code-style-check-${{ hashFiles('**/go.mod', '**/go.sum', '**/Makefile') }}
59-
- name: Ensure `make precommit` is executed
60-
run: make check
6136
unittest:
6237
name: Unit Test
63-
needs: [style]
6438
strategy:
6539
fail-fast: false
6640
matrix:
@@ -100,7 +74,6 @@ jobs:
10074

10175
test_crdcel:
10276
name: CRD CEL Validation Test
103-
needs: [style]
10477
runs-on: ${{ matrix.os }}
10578
strategy:
10679
fail-fast: false
@@ -125,7 +98,6 @@ jobs:
12598

12699
test_controller:
127100
name: Controller Test
128-
needs: [style]
129101
runs-on: ${{ matrix.os }}
130102
strategy:
131103
fail-fast: false
@@ -150,7 +122,6 @@ jobs:
150122

151123
test_extproc:
152124
name: External Processor Test (Envoy v${{ matrix.version }} on ${{ matrix.os }})
153-
needs: [style]
154125
strategy:
155126
fail-fast: false
156127
matrix:
@@ -209,7 +180,6 @@ jobs:
209180
# virtualization is not supported on macOS runners.
210181
# E.g. Use https://github.com/douglascamata/setup-docker-macos-action per the comment in
211182
# https://github.com/actions/runner-images/issues/17#issuecomment-1971073406
212-
needs: [style]
213183
runs-on: ubuntu-latest
214184
strategy:
215185
fail-fast: false
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# This is intentionally a separate workflow file than build_and_test.yaml since we want to run the precommit check on
2+
# any PRs regardless of the files changed, including documentation changes, etc.
3+
name: Precommit Check
4+
on:
5+
pull_request:
6+
branches:
7+
- 'main'
8+
- 'release/**'
9+
10+
push:
11+
branches:
12+
- 'main'
13+
- 'release/**'
14+
15+
concurrency:
16+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-concurrency-to-cancel-any-in-progress-job-or-run
17+
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.actor }}-${{ github.event_name }}
18+
cancel-in-progress: true
19+
20+
permissions:
21+
contents: read
22+
23+
jobs:
24+
style:
25+
name: Check
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
os:
30+
- ubuntu-latest
31+
- macos-latest
32+
runs-on: ${{ matrix.os }}
33+
steps:
34+
- uses: actions/checkout@v4
35+
- uses: actions/setup-go@v5
36+
with:
37+
cache: false
38+
go-version-file: go.mod
39+
- uses: actions/cache@v4
40+
with:
41+
path: |
42+
~/.cache/go-build
43+
~/.cache/golangci-lint
44+
~/go/pkg/mod
45+
~/go/bin
46+
key: code-style-check-${{ hashFiles('**/go.mod', '**/go.sum', '**/Makefile') }}
47+
- name: Ensure `make precommit` is executed
48+
run: make check

docs/proposals/003-epp-integration-proposal/proposal.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -659,14 +659,14 @@ sequenceDiagram
659659
AIServer->>EG: List/Watch Envoy Gateway CRDs (Gateway/HTTPRoute/EnvoyExtensionPolicy/Backend)
660660
Note over EG: Translate CRDs to xDS configuration
661661
Note over EAGES: Implemented PostRouteModify/PostClusterModify/PostTranslateModify Hooks
662-
EG->>EAGES: Invoke PostRouteModify Hook
662+
EG->>EAGES: Invoke PostRouteModify Hook
663663
EAGES-->>EG: Modify Envoy Route Config (Add EPP Metadata)
664-
EG->>EAGES: Invoke PostClusterModify Hook
664+
EG->>EAGES: Invoke PostClusterModify Hook
665665
EAGES-->>EG: Modify Envoy Cluster Config (Modify Cluster with HostOverride LBPolicy or Original Dst)
666-
EG->>EAGES: Invoke PostTranslateModify Hook
666+
EG->>EAGES: Invoke PostTranslateModify Hook
667667
EAGES-->>EG: Modify Envoy Listeners and Routes Config (Insert EPP extproc in relevant listeners and disable EPP extproc in un related routes)
668668
EG ->> Proxy: Generate final xDS configuration
669-
Note over Proxy: Ready to foward downstream requests
669+
Note over Proxy: Ready to forward downstream requests
670670
```
671671

672672
The logics flow for HTTPRoute + InferencePool is like:
@@ -681,14 +681,14 @@ sequenceDiagram
681681
AIServer->>EG: List/Watch Envoy Gateway CRDs (Gateway/HTTPRoute/EnvoyExtensionPolicy/Backend)
682682
Note over EG: Translate CRDs to xDS configuration
683683
Note over EAGES: Implemented PostRouteModify/PostClusterModify/PostTranslateModify Hooks
684-
EG->>EAGES: Invoke PostRouteModify Hook
684+
EG->>EAGES: Invoke PostRouteModify Hook
685685
EAGES-->>EG: Modify Envoy Route Config (Add EPP Metadata)
686-
EG->>EAGES: Invoke PostClusterModify Hook
686+
EG->>EAGES: Invoke PostClusterModify Hook
687687
EAGES-->>EG: Modify Envoy Cluster Config (Modify Cluster with HostOverride LBPolicy or Original Dst)
688-
EG->>EAGES: Invoke PostTranslateModify Hook
688+
EG->>EAGES: Invoke PostTranslateModify Hook
689689
EAGES-->>EG: Modify Envoy Listeners and Routes Config (Insert EPP extproc in relevant listeners and disable EPP extproc in un related routes)
690690
EG ->> Proxy: Generate final xDS configuration
691-
Note over Proxy: Ready to foward downstream requests
691+
Note over Proxy: Ready to forward downstream requests
692692
```
693693

694694
## Request Flow
@@ -715,7 +715,7 @@ sequenceDiagram
715715
EPP-->>Envoy: Add Picked Endpoint in Header and Metadata;
716716
717717
loop Retry/Fallback loop
718-
Note over Envoy: Foward Based on Picked Endpoint (Original Dst or HostOverride LbPolicy)
718+
Note over Envoy: Forward Based on Picked Endpoint (Original Dst or HostOverride LbPolicy)
719719
Envoy->>Processor: Upstream level ExtProc Request
720720
Note over Processor: Request-Transform
721721
Processor-->>Envoy: ;
@@ -746,7 +746,7 @@ sequenceDiagram
746746
EPP-->>Envoy: Add Picked Endpoint in Header and Metadata;
747747
748748
loop Retry/Fallback loop
749-
Note over Envoy: Foward Based on Picked Endpoint (Original Dst or HostOverride LbPolicy)
749+
Note over Envoy: Forward Based on Picked Endpoint (Original Dst or HostOverride LbPolicy)
750750
Envoy->>SelfHosted: Forward Request
751751
SelfHosted-->>Envoy: Response
752752
end

0 commit comments

Comments
 (0)