Skip to content

fix: resolve stale document bug on policy update and add comprehensive e2e coverage#69

Merged
JoseSzycho merged 2 commits intomainfrom
test/e2e
Mar 11, 2026
Merged

fix: resolve stale document bug on policy update and add comprehensive e2e coverage#69
JoseSzycho merged 2 commits intomainfrom
test/e2e

Conversation

@JoseSzycho
Copy link
Copy Markdown
Contributor

@JoseSzycho JoseSzycho commented Mar 11, 2026

Summary

  • Bug fix: Resources that no longer match a ResourceIndexPolicy after a CEL condition update were not being removed from the Meilisearch index. The re-index consumer was evaluating resources against a stale policy cache, causing the old (broader) conditions to still match everything.

  • e2e tests: Added six end-to-end test suites covering the full search pipeline — indexing, pagination, continue tokens, backfill, finalizer cleanup, resource deletion/update, and policy spec updates.

  • Dev workflow: Set imagePullPolicy: Never in the dev and CI kustomize overlays so task dev:build && task dev:load always deploys the freshly built image without the kubelet using a stale cached layer.

Related to:

Closes #20

…licy caching, to avoid stale policies

This is related to a race condition, in which a resourceindexpolicy can be updated, but the reindexer cache don't get the update on time, so it reindex the resources with a stale version of it.
Comment on lines +311 to +325
# =========================================================================
# Cleanup
# =========================================================================
- name: cleanup
description: "Removes all resources created by this test"
try:
- script:
timeout: 60s
content: |
kubectl delete resourceindexpolicy e2e-search-flow-secret-policy e2e-duplicate-fields-secret-policy --ignore-not-found=true || true
kubectl delete secret e2e-search-target-secret -n default --ignore-not-found=true || true
kubectl delete secret e2e-search-excluded-secret -n e2e-search-excluded --ignore-not-found=true || true
kubectl delete namespace e2e-search-excluded --ignore-not-found=true || true
check:
($error): ~
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chainsaw should automatically clean up resources it creates.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, is the second time I forget that. Will fix that

@github-project-automation github-project-automation bot moved this from In review to Ready in Searching Resources in Milo Mar 11, 2026
@JoseSzycho JoseSzycho merged commit 2c16c64 into main Mar 11, 2026
7 of 8 checks passed
@JoseSzycho JoseSzycho deleted the test/e2e branch March 11, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Create end-to-end testing pipeline with Chainsaw

3 participants