Skip to content

Commit cfad39a

Browse files
authored
Merge branch 'main' into fix/loadevents-head-tail-snapshot-preservation-v2
2 parents 505475e + f4e07df commit cfad39a

245 files changed

Lines changed: 18632 additions & 1555 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/e2e.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
backend: ${{ steps.filter.outputs.backend }}
3333
operator: ${{ steps.filter.outputs.operator }}
3434
claude-runner: ${{ steps.filter.outputs.claude-runner }}
35+
api-server: ${{ steps.filter.outputs.api-server }}
3536
steps:
3637
- name: Checkout PR code
3738
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -55,6 +56,8 @@ jobs:
5556
- 'components/operator/**'
5657
claude-runner:
5758
- 'components/runners/**'
59+
api-server:
60+
- 'components/ambient-api-server/**'
5861
5962
e2e:
6063
name: End-to-End Tests
@@ -142,6 +145,8 @@ jobs:
142145
docker tag quay.io/ambient_code/vteam_claude_runner:latest quay.io/ambient_code/vteam_claude_runner:e2e-test) &
143146
pull_pids+=($!)
144147
fi
148+
# api-server is always built from branch code (no pull fallback)
149+
# because RBAC e2e tests require the branch's middleware
145150
for pid in "${pull_pids[@]}"; do
146151
wait "$pid" || exit 1
147152
done
@@ -186,6 +191,18 @@ jobs:
186191
type=gha,scope=e2e-ambient-runner
187192
cache-to: type=gha,mode=max,scope=e2e-ambient-runner
188193

194+
- name: Build api-server image
195+
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7
196+
with:
197+
context: components/ambient-api-server
198+
file: components/ambient-api-server/Dockerfile
199+
load: true
200+
tags: quay.io/ambient_code/vteam_api_server:e2e-test
201+
cache-from: |
202+
type=gha,scope=api-server-amd64
203+
type=gha,scope=e2e-api-server
204+
cache-to: type=gha,mode=max,scope=e2e-api-server
205+
189206
- name: Show built images
190207
run: docker images | grep e2e-test
191208

@@ -222,6 +239,7 @@ jobs:
222239
quay.io/ambient_code/vteam_backend:e2e-test \
223240
quay.io/ambient_code/vteam_operator:e2e-test \
224241
quay.io/ambient_code/vteam_claude_runner:e2e-test \
242+
quay.io/ambient_code/vteam_api_server:e2e-test \
225243
| kind load image-archive /dev/stdin --name ambient-local
226244
echo "All images loaded into kind cluster"
227245
@@ -232,6 +250,7 @@ jobs:
232250
IMAGE_BACKEND: quay.io/ambient_code/vteam_backend:e2e-test
233251
IMAGE_OPERATOR: quay.io/ambient_code/vteam_operator:e2e-test
234252
IMAGE_RUNNER: quay.io/ambient_code/vteam_claude_runner:e2e-test
253+
DEFAULT_API_SERVER_IMAGE: quay.io/ambient_code/vteam_api_server:e2e-test
235254
run: ./scripts/deploy.sh
236255

237256
- name: Verify deployment
@@ -317,6 +336,19 @@ jobs:
317336
done
318337
./scripts/run-tests.sh
319338
339+
- name: Run RBAC enforcement E2E tests
340+
run: |
341+
# Port-forward api-server and keycloak for RBAC tests.
342+
# The test script (Phase 0.5) handles all deployment patching,
343+
# JWT/authz enablement, rollout, and port-forward re-establishment.
344+
kubectl port-forward -n ambient-code svc/ambient-api-server 13592:8000 &
345+
kubectl port-forward -n ambient-code svc/keycloak-service 18592:8080 &
346+
sleep 3
347+
348+
API_URL=http://localhost:13592/api/ambient/v1 \
349+
KC_URL=http://localhost:18592 \
350+
bash components/ambient-api-server/test/e2e/rbac_e2e_test.sh
351+
320352
- name: Upload test results
321353
if: failure()
322354
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6

.github/workflows/lint.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,24 @@ jobs:
226226
working-directory: components/ambient-api-server
227227
args: --timeout=5m
228228

229+
- name: Check OpenAPI generated code is up to date
230+
run: |
231+
cd components/ambient-api-server
232+
make generate
233+
if ! git diff --quiet pkg/api/openapi/; then
234+
echo ""
235+
echo "============================================"
236+
echo "ERROR: Generated OpenAPI code is out of date"
237+
echo "============================================"
238+
echo ""
239+
echo "The following files differ from what 'make generate' produces:"
240+
git diff --name-only pkg/api/openapi/
241+
echo ""
242+
echo "Run 'cd components/ambient-api-server && make generate' and commit the result."
243+
exit 1
244+
fi
245+
echo "OpenAPI generated code is up to date."
246+
229247
go-cli:
230248
runs-on: ubuntu-latest
231249
needs: detect-changes

components/ambient-api-server/cmd/ambient-api-server/environments/e_integration_testing.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ func (e *IntegrationTestingEnvImpl) OverrideConfig(c *config.ApplicationConfig)
3333
}
3434

3535
func (e *IntegrationTestingEnvImpl) OverrideServices(s *pkgenv.Services) error {
36-
s.SetService("RBACMiddleware", nil)
3736
return nil
3837
}
3938

@@ -52,7 +51,7 @@ func (e *IntegrationTestingEnvImpl) Flags() map[string]string {
5251
"api-base-url": "https://api.integration.openshift.com",
5352
"enable-https": "false",
5453
"enable-metrics-https": "false",
55-
"enable-authz": "true",
54+
"enable-authz": "false",
5655
"debug": "false",
5756
"enable-mock": "true",
5857
"api-server-bindaddress": "localhost:0",

components/ambient-api-server/cmd/ambient-api-server/environments/e_production.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ func (e *ProductionEnvImpl) OverrideConfig(c *config.ApplicationConfig) error {
3737
c.Auth.JwkCertURL = defaultJwkCertURL
3838
}
3939

40-
c.Auth.JwkCertFile = ""
4140
return nil
4241
}
4342

components/ambient-api-server/cmd/ambient-api-server/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616

1717
// Backend-compatible plugins only
1818
_ "github.com/ambient-code/platform/components/ambient-api-server/plugins/agents"
19+
_ "github.com/ambient-code/platform/components/ambient-api-server/plugins/applications"
1920
_ "github.com/ambient-code/platform/components/ambient-api-server/plugins/credentials"
2021
_ "github.com/ambient-code/platform/components/ambient-api-server/plugins/inbox"
2122
_ "github.com/ambient-code/platform/components/ambient-api-server/plugins/projectSettings"
@@ -36,6 +37,7 @@ func main() {
3637
pkgcmd.NewMigrateCommand("ambient-api-server"),
3738
pkgcmd.NewServeCommand(localapi.GetOpenAPISpec),
3839
localcmd.NewEncryptCredentialsCommand(),
40+
localcmd.NewSeedAdminCommand(),
3941
)
4042

4143
if err := rootCmd.Execute(); err != nil {

0 commit comments

Comments
 (0)