CRD E2E Ginkgo Suite#964
Merged
Merged
Conversation
✅ Deploy Preview for porch ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
8856d37 to
b1026a1
Compare
liamfallon
previously approved these changes
May 5, 2026
Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
…te lock and synchronized lookup
…c cache after pod restart
…, and SSA patch timing
…propagation delay
… overwriting a concurrent push
…fore push in e2e tests
Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
101b587 to
d2171be
Compare
Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
|
liamfallon
approved these changes
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Title
CRD E2E Ginkgo Suite
Description
Adds a comprehensive ginkgo-based end-to-end test suite (
test/e2e/crd/) for the v1alpha2 PackageRevision CRD controller.Test Coverage
Supporting Changes
test-blueprints.bundle— Addednstest/v1package (builtinset-namespacepipeline) for fast render testsscripts/create-deployment-blueprint.sh— Fixed RBAC copy ordering (loop ran beforepackagerevisionswas added toENABLED_RECONCILERS).github/workflows/porch-e2e-ci-jobs.yaml— Added CRD e2e suite to CI matrixtest/e2e/cli/testdata/rpkg-get/config.yaml— Updated expected output for newnstestpackagecontrollers/functionconfigs/reconciler/functionconfigreconciler.go+pkg/engine/builtinruntime.go— Fixed data race in exec cache: added missing write lock toUpdateExecCacheand replaced unsynchronized map access inbuiltinRuntimewithGetProcessorFromCache(read-locked lookup)Bug Fixes (discovered via CI)
Controller fixes
controllers/main.go) — Pre-populate store on startup viamgr.GetAPIReader().List()to prevent empty exec cache after pod restartcontrollers/.../render.go) — Always runcheckRenderStale, not just for annotation-triggered renders; prevents init render from overwriting a concurrent user pushcontrollers/.../packagerevision_controller.go) — Re-read PR from API afterreconcileRenderbefore callingreconcileLifecycleto prevent staleSpec.Lifecyclefrom reverting concurrent transitionscontrollers/.../packagerevision_controller.go) — ReturnRequeue: trueonUpdateLifecycleerror so transient git push conflicts are retried automatically (partially addresses Sub-reconcile errors swallowed without requeue #925)DB layer fixes
pkg/cache/dbcache/dbpackagerevisionresourcessql.go) — Wrap DELETE + INSERT in a PostgreSQL transaction to prevent concurrent writers from seeing partial state. Fixes Non-transactional DB resource writes allow corruption under concurrency #967.pkg/cache/dbcache/dbpackagerevision.go,dbrepository.go) — AddresourcesDirtyflag;savePackageRevisionDraftonly writes resources when they were actually modified. Prevents Draft→Proposed from wiping resources with stale/empty content. Fixes Non-transactional DB resource writes allow corruption under concurrency #967.Test Stabilization (CI timing sensitivity)
updatePRRResourcesretries on conflict;waitForReadyasserts no render in-flightwaitForRenderedchecks annotation match to avoid passing on staleRendered=TrueEventuallyfor cache propagation delaywaitForPRRVisiblehelper guards against DB commit visibility lag across connectionspublishPackageincludes PRR visibility check before lifecycle transitionsupdatePRRResourceswhen PRR resources not yet populated after restartRelated Issue(s)
Type of Change
Checklist
Testing Instructions
make run-in-kind-v1alpha2(deploys porch with PR controller + FunctionConfig reconciler)make test-e2e-crd-all(runs full suite including migration tests)E2E=1 go test -v ./test/e2e/crd -ginkgo.v -ginkgo.focus="FunctionConfig"Additional Notes
test-blueprints.bundlemust be reloaded on existing clusters:scripts/modify-gitea-test-blueprints.sh reloadPIt): Skipped pending render cancellation (Render cancellation on new push #931). When two pushes arrive within ~100ms, the first render can complete and write before the second push's annotation lands in etcd, causing stale detection to miss it.Pendingin suite, awaiting webhook implementation — Race condition prevention: webhook validation for lifecycle transitions during render #917)packagerevisionsRBAC is never deployed when v1alpha2 is enabledcontrollers/main.go(merged in PR Controller PoC #514)nstest/v1test blueprint was added specifically to avoid fn-runner pod cold-start latency in CI (~47s → <1s)AI Disclosure
[X] I have used AI in the creation of this PR.
AmazonQ Developer was used