tembo-io / pg_vectorize

The simplest way to build AI workloads on Postgres
https://tembo.io/pg_vectorize/
739 stars 33 forks source link

Implement event trigger to remove jobs from vectorize.job upon table deletion #164

Open varshith257 opened 1 month ago

varshith257 commented 1 month ago

/claim #148 Closes #148

varshith257 commented 4 weeks ago

@ChuckHend Can have a review on this PR?

varshith257 commented 3 weeks ago

It seems test fails are not related of changes in this PR?

Any changes needed or can be merged @ChuckHend ?

ChuckHend commented 3 weeks ago

@varshith257 yes these tests will fail for any branch that isnt part of the org (due to security policy on the repo). It is because there is an API key and it is in a github secret. We can ignore those tests.

varshith257 commented 3 weeks ago

@ChuckHend Can it be merged?

ChuckHend commented 3 weeks ago

Sorry we haven't had a chance to do a thorough review yet. Can you add a test that asserts the records are indeed dropped?

varshith257 commented 3 weeks ago

Sure!

varshith257 commented 2 weeks ago

@ChuckHend Added tests! Can you review this PR?

varshith257 commented 2 weeks ago

@ChuckHend Can it be merged? Or any changes needed?

varshith257 commented 2 weeks ago

@ChuckHend Done!

ChuckHend commented 5 days ago

@varshith257, the test that was added in this PR does not compile.

error[E0282]: type annotations needed
   --> tests/integration_tests.rs:96:9
    |
96  |     let job_exists = sqlx::query_scalar(&format!(
    |         ^^^^^^^^^^
...
104 |         !job_exists,
    |         ----------- type must be known at this point
    |
help: consider giving `job_exists` an explicit type
    |
96  |     let job_exists: /* Type */ = sqlx::query_scalar(&format!(
    |                   ++++++++++++
varshith257 commented 5 days ago

@ChuckHend Sorry! I have modified it locally and I didn't pushed here lol 🤦

varshith257 commented 5 days ago

@ChuckHend Can you approve workflows again?

varshith257 commented 5 days ago

@ChuckHend Are any changes needed? Let me know, I am ready to incorporate them and get this PR merged soon :)

ChuckHend commented 5 days ago

The test_drop_table_triggers_job_deletion fails when I run locally.

make test-integration TEST_NAME=test_drop_table_triggers_job_deletion

test test_drop_table_triggers_job_deletion ... URL: postgres://user:pass@localhost:28817/postgres
thread 'test_drop_table_triggers_job_deletion' panicked at tests/integration_tests.rs:89:5:
assertion `left == right` failed: Job was not deleted after table drop
  left: 1
 right: 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
FAILED

I'm going to push a change to the CI workflow so that the failing ./core tests dont block the extension tests from running.

varshith257 commented 3 days ago

@ChuckHend I am debugging if the trigger event is triggered or something is blocking in test for deletion