Skip to content

Commit 9cba95a

Browse files
authored
Actions toplam süresini gerçekten kısalt (#75)
## Sorun Önceki optimizasyon job bazında iyi görünse de gerçek PR workflow'u 2m44s sürdü; eski 2m53s'e göre yalnız 9 saniye kazanç vardı. `verify` aggregator'ı 3 saniye iş yapmasına rağmen runner kuyruğunda yaklaşık 52 saniye bekledi. Core backend de 1m43s ile bottleneck kaldı. ## Değişiklik - `verify` aggregator tamamen kaldırıldı; repository ruleset named status check gerektirmiyor. - Ağır core testleri ölçülen 40–46 saniyelik suiteler etrafında üç gruba ayrıldı: - `test:d1:core:foundation` - `test:d1:core:site` - `test:d1:core:public` - PR workflow bu üç core grubu + publication + platform + frontend'i ayrı runner'larda paralel çalıştırıyor. - Production deploy aynı üçlü core ayrımını kullanıyor; deploy gate tüm alt job'ların sonucunu ve scope eşitliğini kontrol ediyor. - Nightly full regression artık seri `npm run build` zincirini çalıştırmıyor ve staging rehearsal'ı full-regression sonrasına bağlamıyor. Tüm exhaustive D1 split'leri, production frontend verifier, live contract ve staging rehearsal paralel başlıyor. - Coverage lock; tam `test:d1` listesinin bütün split'lerde tam bir kez yer aldığını ve PR/deploy/full-regression workflow'larının hepsinin bu split'leri çağırdığını doğruluyor. ## Yerel doğrulama - YAML parse: 3 workflow da OK - `actions:scope:test`: 5/5 - core foundation: 57/57 + JS 11/11 + Python 7/7 - core site: 80/80 - core public: 109/109 - üç core grup aynı anda koşturuldu, port/Undici flake yok - `npm audit`: 0 vulnerability Bu PR'ın kendi Actions koşumu gerçek trigger-to-complete duvar süresini ölçecek; job sürelerini başarı metriği olarak kullanmıyoruz.
1 parent 6e4a2c3 commit 9cba95a

7 files changed

Lines changed: 262 additions & 102 deletions

File tree

‎.github/workflows/deploy-production.yml‎

Lines changed: 94 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ jobs:
8383
include-hidden-files: true
8484
retention-days: 1
8585

86-
backend:
86+
backend-foundation:
8787
runs-on: ubuntu-latest
8888
timeout-minutes: 12
8989
outputs:
9090
scope: ${{ steps.scope.outputs.scope }}
9191
steps:
92-
- name: Checkout backend candidate and history
92+
- name: Checkout foundation candidate and history
9393
uses: actions/checkout@v7
9494
with:
9595
fetch-depth: 0
@@ -117,13 +117,97 @@ jobs:
117117
if: ${{ steps.scope.outputs.scope == 'full' }}
118118
run: npm ci
119119

120-
- name: Verify D1, Worker, reference client and security behavior
120+
- name: Verify D1 foundation, authorization and reference clients
121121
if: ${{ steps.scope.outputs.scope == 'full' }}
122-
run: npm run test:d1:core && npm run orbit:test:clients
122+
run: npm run test:d1:core:foundation && npm run orbit:test:clients
123123

124-
- name: Record frontend-only backend decision
124+
- name: Record frontend-only decision
125125
if: ${{ steps.scope.outputs.scope != 'full' }}
126-
run: echo 'No backend/security path changed; the fail-safe classifier selected frontend validation.'
126+
run: echo 'No backend/security path changed; this validation slice is not required.'
127+
128+
backend-site:
129+
runs-on: ubuntu-latest
130+
timeout-minutes: 12
131+
outputs:
132+
scope: ${{ steps.scope.outputs.scope }}
133+
steps:
134+
- name: Checkout site-auth candidate and history
135+
uses: actions/checkout@v7
136+
with:
137+
fetch-depth: 0
138+
139+
- name: Classify changed paths independently
140+
id: scope
141+
env:
142+
BEFORE_SHA: ${{ github.event.before }}
143+
EVENT_NAME: ${{ github.event_name }}
144+
run: |
145+
if [[ "$EVENT_NAME" == 'workflow_dispatch' || -z "$BEFORE_SHA" || "$BEFORE_SHA" =~ ^0+$ ]]; then
146+
printf 'scope=full\n' >> "$GITHUB_OUTPUT"
147+
exit 0
148+
fi
149+
git diff --name-only "$BEFORE_SHA" "$GITHUB_SHA" | node scripts/orbit-actions-scope.mjs
150+
151+
- name: Set up Node
152+
if: ${{ steps.scope.outputs.scope == 'full' }}
153+
uses: actions/setup-node@v7
154+
with:
155+
node-version: 24
156+
cache: npm
157+
158+
- name: Install dependencies
159+
if: ${{ steps.scope.outputs.scope == 'full' }}
160+
run: npm ci
161+
162+
- name: Verify site authorization and sign-in behavior
163+
if: ${{ steps.scope.outputs.scope == 'full' }}
164+
run: npm run test:d1:core:site
165+
166+
- name: Record frontend-only decision
167+
if: ${{ steps.scope.outputs.scope != 'full' }}
168+
run: echo 'No backend/security path changed; this validation slice is not required.'
169+
170+
backend-public:
171+
runs-on: ubuntu-latest
172+
timeout-minutes: 12
173+
outputs:
174+
scope: ${{ steps.scope.outputs.scope }}
175+
steps:
176+
- name: Checkout public-core candidate and history
177+
uses: actions/checkout@v7
178+
with:
179+
fetch-depth: 0
180+
181+
- name: Classify changed paths independently
182+
id: scope
183+
env:
184+
BEFORE_SHA: ${{ github.event.before }}
185+
EVENT_NAME: ${{ github.event_name }}
186+
run: |
187+
if [[ "$EVENT_NAME" == 'workflow_dispatch' || -z "$BEFORE_SHA" || "$BEFORE_SHA" =~ ^0+$ ]]; then
188+
printf 'scope=full\n' >> "$GITHUB_OUTPUT"
189+
exit 0
190+
fi
191+
git diff --name-only "$BEFORE_SHA" "$GITHUB_SHA" | node scripts/orbit-actions-scope.mjs
192+
193+
- name: Set up Node
194+
if: ${{ steps.scope.outputs.scope == 'full' }}
195+
uses: actions/setup-node@v7
196+
with:
197+
node-version: 24
198+
cache: npm
199+
200+
- name: Install dependencies
201+
if: ${{ steps.scope.outputs.scope == 'full' }}
202+
run: npm ci
203+
204+
- name: Verify public repository and identity behavior
205+
if: ${{ steps.scope.outputs.scope == 'full' }}
206+
run: npm run test:d1:core:public
207+
208+
- name: Record frontend-only decision
209+
if: ${{ steps.scope.outputs.scope != 'full' }}
210+
run: echo 'No backend/security path changed; this validation slice is not required.'
127211

128212
backend-publication:
129213
runs-on: ubuntu-latest
@@ -212,10 +296,12 @@ jobs:
212296
deploy:
213297
needs:
214298
- frontend
215-
- backend
299+
- backend-foundation
300+
- backend-site
301+
- backend-public
216302
- backend-publication
217303
- backend-platform
218-
if: ${{ needs.frontend.result == 'success' && needs.backend.result == 'success' && needs.backend-publication.result == 'success' && needs.backend-platform.result == 'success' && needs.frontend.outputs.scope != 'docs' && needs.frontend.outputs.scope == needs.backend.outputs.scope && needs.frontend.outputs.scope == needs.backend-publication.outputs.scope && needs.frontend.outputs.scope == needs.backend-platform.outputs.scope }}
304+
if: ${{ needs.frontend.result == 'success' && needs.backend-foundation.result == 'success' && needs.backend-site.result == 'success' && needs.backend-public.result == 'success' && needs.backend-publication.result == 'success' && needs.backend-platform.result == 'success' && needs.frontend.outputs.scope != 'docs' && needs.frontend.outputs.scope == needs.backend-foundation.outputs.scope && needs.frontend.outputs.scope == needs.backend-site.outputs.scope && needs.frontend.outputs.scope == needs.backend-public.outputs.scope && needs.frontend.outputs.scope == needs.backend-publication.outputs.scope && needs.frontend.outputs.scope == needs.backend-platform.outputs.scope }}
219305
runs-on: ubuntu-latest
220306
timeout-minutes: 8
221307
environment:

‎.github/workflows/full-regression.yml‎

Lines changed: 80 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -13,59 +13,107 @@ concurrency:
1313
cancel-in-progress: false
1414

1515
jobs:
16-
full-regression:
16+
frontend:
1717
runs-on: ubuntu-latest
18-
timeout-minutes: 20
18+
timeout-minutes: 12
1919
steps:
20-
- name: Checkout
21-
uses: actions/checkout@v7
20+
- uses: actions/checkout@v7
21+
- uses: actions/setup-node@v7
22+
with:
23+
node-version: 24
24+
cache: npm
25+
- run: npm ci
26+
- name: Verify complete production frontend
27+
run: |
28+
npm run actions:scope:test
29+
npm run verify:frontend:production
2230
23-
- name: Set up Node
24-
uses: actions/setup-node@v7
31+
backend-foundation:
32+
runs-on: ubuntu-latest
33+
timeout-minutes: 12
34+
steps:
35+
- uses: actions/checkout@v7
36+
- uses: actions/setup-node@v7
2537
with:
2638
node-version: 24
2739
cache: npm
40+
- run: npm ci
41+
- run: npm run test:d1:core:foundation && npm run orbit:test:clients
2842

29-
- name: Install dependencies
30-
run: npm ci
43+
backend-site:
44+
runs-on: ubuntu-latest
45+
timeout-minutes: 12
46+
steps:
47+
- uses: actions/checkout@v7
48+
- uses: actions/setup-node@v7
49+
with:
50+
node-version: 24
51+
cache: npm
52+
- run: npm ci
53+
- run: npm run test:d1:core:site
3154

32-
- name: Run the complete application regression
33-
run: |
34-
npm run actions:scope:test
35-
npm run check
36-
npm run build
37-
npm run production:config:check
38-
npm run worker:build:production:live
39-
npm run contract:live
55+
backend-public:
56+
runs-on: ubuntu-latest
57+
timeout-minutes: 12
58+
steps:
59+
- uses: actions/checkout@v7
60+
- uses: actions/setup-node@v7
61+
with:
62+
node-version: 24
63+
cache: npm
64+
- run: npm ci
65+
- run: npm run test:d1:core:public
66+
67+
backend-publication:
68+
runs-on: ubuntu-latest
69+
timeout-minutes: 12
70+
steps:
71+
- uses: actions/checkout@v7
72+
- uses: actions/setup-node@v7
73+
with:
74+
node-version: 24
75+
cache: npm
76+
- run: npm ci
77+
- run: npm run test:d1:publication
78+
79+
backend-platform:
80+
runs-on: ubuntu-latest
81+
timeout-minutes: 12
82+
steps:
83+
- uses: actions/checkout@v7
84+
- uses: actions/setup-node@v7
85+
with:
86+
node-version: 24
87+
cache: npm
88+
- run: npm ci
89+
- run: npm run test:d1:platform
90+
91+
live-contract:
92+
runs-on: ubuntu-latest
93+
timeout-minutes: 8
94+
steps:
95+
- uses: actions/checkout@v7
96+
- uses: actions/setup-node@v7
97+
with:
98+
node-version: 24
99+
cache: npm
100+
- run: npm ci
101+
- name: Verify the live agent contract
102+
run: npm run contract:live
40103

41-
# Staging provaları hiçbir yerde otomatik koşmuyordu ve bir tanesi üç
42-
# hafta boyunca bozuk kaldı: sunucuya yeni bir yayın kısıtı girdi, betik
43-
# ondan habersiz kaldı, kimse çalıştırmadığı için kimse görmedi.
44-
#
45-
# Bu iş staging'e YENİ KOD DAĞITMIYOR. Staging Samet'in elle kullandığı
46-
# kapı; gece yarısı üzerine yazmak, sabah bakmak için bıraktığı şeyi
47-
# silmek olurdu. Burada aranan şey provaların ürüne ayak uydurup
48-
# uydurmadığı — bunun için o an staging'de ne varsa yeter.
49104
staging-rehearsal:
50-
needs: full-regression
51105
runs-on: ubuntu-latest
52106
timeout-minutes: 30
53107
steps:
54108
- name: Checkout
55109
uses: actions/checkout@v7
56-
57110
- name: Set up Node
58111
uses: actions/setup-node@v7
59112
with:
60113
node-version: 24
61114
cache: npm
62-
63115
- name: Install dependencies
64116
run: npm ci
65-
66-
# Eksik bir secret'ın hatası, provanın kendi hatasına benzemesin.
67-
# Kimlik bilgisi olmadan düşen bir iş, gerçekten kırılmış bir
68-
# sözleşmeyle karıştırılırsa görmezden gelinmeye başlar.
69117
- name: Verify the staging credentials are present
70118
env:
71119
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
@@ -77,32 +125,17 @@ jobs:
77125
[ -n "$CLOUDFLARE_API_TOKEN" ] || missing="$missing CLOUDFLARE_API_TOKEN"
78126
[ -n "$ORBIT_SESSION_PEPPER_V1" ] || missing="$missing ORBIT_STAGING_SESSION_PEPPER_V1"
79127
[ -n "$ORBIT_CSRF_PEPPER_V1" ] || missing="$missing ORBIT_STAGING_CSRF_PEPPER_V1"
80-
[ -n "$ORBIT_AGENT_CREDENTIAL_PEPPER_V1" ] \
81-
|| missing="$missing ORBIT_STAGING_AGENT_CREDENTIAL_PEPPER_V1"
128+
[ -n "$ORBIT_AGENT_CREDENTIAL_PEPPER_V1" ] || missing="$missing ORBIT_STAGING_AGENT_CREDENTIAL_PEPPER_V1"
82129
if [ -n "$missing" ]; then
83130
echo "::error::Staging rehearsal cannot run. Missing repository secrets:$missing"
84131
exit 1
85132
fi
86-
87133
- name: Rehearse the staging contract
88134
env:
89135
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
90136
ORBIT_SESSION_PEPPER_V1: ${{ secrets.ORBIT_STAGING_SESSION_PEPPER_V1 }}
91137
ORBIT_CSRF_PEPPER_V1: ${{ secrets.ORBIT_STAGING_CSRF_PEPPER_V1 }}
92138
ORBIT_AGENT_CREDENTIAL_PEPPER_V1: ${{ secrets.ORBIT_STAGING_AGENT_CREDENTIAL_PEPPER_V1 }}
93-
# Buraya yalnız yeşil olduğu ölçülmüş provalar giriyor. Bir provayı
94-
# kırmızı hâlde bağlamak, gecelik işi görmezden gelinen bir işe
95-
# çevirir — düzeltmeye çalıştığımız sorunun ta kendisi.
96-
#
97-
# Bu yüzden slice2 ve slice3 provaları buraya eklenmedi, silindi:
98-
# biri kaldırılmış bir API'ye bakıyordu, diğeri staging büyüdükçe
99-
# kendi kendine bozulan sayılara. Kapsamın nereye düştüğü
100-
# orbit-slice1-tests.ts ve orbit-slice3-tests.ts içinde,
101-
# devraldıkları testin başında yazılı.
102-
#
103-
# Yeni bir staging betiği eklenirse ya buraya girer ya da elle
104-
# çalışacağı orbit-production-config-tests.mjs'de açıkça beyan
105-
# edilir; kilit ikisini de yapmadan geçmiyor.
106139
run: |
107140
npm run staging:verify
108141
npm run staging:slice4:e2e

0 commit comments

Comments
 (0)