-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add workflow collections #2569
Add workflow collections #2569
Conversation
These are named and shared key-value storages
add :collection_id, | ||
references(:collections, on_delete: :delete_all, type: :binary_id, null: false) | ||
|
||
timestamps() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you change this to timestamps(type: :naive_datetime_usec)
and the models as well.
Probably a good idea to start with sub-second resolution on these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
timestamps() | ||
end | ||
|
||
create unique_index(:collections_items, [:collection_id, :key]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one, do you think we should put an index on updated_at and inserted_at as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @stuartc I would like to play a bit more with the BRIN indexes because I am trying to avoid adding more cost to the job execution. May we add it during the "query by filter" PR? Will have better stats.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2569 +/- ##
==========================================
+ Coverage 90.44% 90.47% +0.02%
==========================================
Files 316 319 +3
Lines 10926 10955 +29
==========================================
+ Hits 9882 9911 +29
Misses 1044 1044 ☔ View full report in Codecov by Sentry. |
There is no user update on collection name
d1cf44a
to
f3872e9
Compare
bf0f894
to
cf579c0
Compare
Thank you for the AI disclosure @jyeshe |
1c4c60f
to
d160c17
Compare
7c331ed
to
9d6bca4
Compare
* Add workflow collections These are named and shared key-value storages * Increase timestamp precision * Use single return patter on same get function * Optimize all ops once the names are stable There is no user update on collection name * Changelog and formatting * Add stream_all allowing equivalent queries to HGETALL and HSCAN * Add stream_match for wildcard prefix queries * Add pg_trigram and GIN index on the key to allow multi wildcard
* Add workflow collections These are named and shared key-value storages * Increase timestamp precision * Use single return patter on same get function * Optimize all ops once the names are stable There is no user update on collection name * Changelog and formatting * Add stream_all allowing equivalent queries to HGETALL and HSCAN * Add stream_match for wildcard prefix queries * Add pg_trigram and GIN index on the key to allow multi wildcard
* Add workflow collections These are named and shared key-value storages * Increase timestamp precision * Use single return patter on same get function * Optimize all ops once the names are stable There is no user update on collection name * Changelog and formatting * Add stream_all allowing equivalent queries to HGETALL and HSCAN * Add stream_match for wildcard prefix queries * Add pg_trigram and GIN index on the key to allow multi wildcard
Description
This PR adds workflow collections which are scoped to projects and provide similar functionality to Redis HSET and HGET (named hashes operations). It will be used not only to share mutable data between jobs on downstream but also shared among multiple workflows and it will be the responsibility of the programmer to use it without conflicts between workflows.
EDIT: The PRs are "merged" and it also includes functionalities similar to HGETALL and HSCAN allowing a query by pattern using a cursor (and respecting a limit).
Closes #2550
Closes #2551
Closes #2552
Validation steps
There is not UI using it yet but a complete test coverage is provided.
AI Usage
Please disclose how you've used AI in this work (it's cool, we just want to know!):
You can read more details in our Responsible AI Policy
Pre-submission checklist
:owner
,:admin
,:editor
,:viewer
)