-
Notifications
You must be signed in to change notification settings - Fork 99
feat(db): add FunctionService for function versioning #1624
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
Merged
willbakst
merged 1 commit into
v2
from
12-10-feat_db_add_functionservice_for_function_versioning
Jan 6, 2026
Merged
feat(db): add FunctionService for function versioning #1624
willbakst
merged 1 commit into
v2
from
12-10-feat_db_add_functionservice_for_function_versioning
Jan 6, 2026
Conversation
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
This was referenced Dec 10, 2025
Merged
Merged
0da1a5d to
6af4a16
Compare
9bd8cf8 to
62d47af
Compare
6af4a16 to
eca6691
Compare
62d47af to
b8d82c0
Compare
eca6691 to
be37dd1
Compare
b8d82c0 to
b2aca9e
Compare
b2aca9e to
85c86f3
Compare
be37dd1 to
154a7a8
Compare
willbakst
approved these changes
Jan 6, 2026
154a7a8 to
b142be9
Compare
85c86f3 to
0e3d42a
Compare
b142be9 to
379c74a
Compare
0e3d42a to
76bc724
Compare
48b4b12 to
5f15f42
Compare
76bc724 to
b41aa73
Compare
5f15f42 to
965b130
Compare
6127227 to
47bc1a5
Compare
965b130 to
fce5987
Compare
47bc1a5 to
98dc5cc
Compare
98dc5cc to
76402ed
Compare
- Add ImmutableResourceError to errors.ts for immutable resources - Add ImmutableResourceError to BaseAuthenticatedEffectService update method - Refactor Functions service: getByHash → findByHash, simplified CRUD pattern - Update create to fail with AlreadyExistsError on duplicate hash - Update update to return ImmutableResourceError (functions are immutable) - Update tests to match new API
76402ed to
445c6d1
Compare
Collaborator
Merge activity
|
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.
TL;DR
Added a new
FunctionServiceclass to manage function registration, versioning, and retrieval.What changed?
Created a new file
cloud/db/services/functions.tsthat implements aFunctionServiceclass with the following capabilities:registerOrGet: Registers a new function or retrieves an existing one, with automatic versioning logicgetEnvironmentContext: Retrieves environment, project, and organization contextgetByHash: Retrieves a function by its hash within an environmentgetById: Retrieves a function by its IDlist: Lists functions with filtering options for name, tags, and paginationThe service handles versioning automatically by:
How to test?
Create a new function using the
registerOrGetmethod:Retrieve a function by hash:
Test versioning by registering the same function with different implementations.
Why make this change?
This service provides a structured way to manage function registration with proper versioning semantics. It ensures that:
The implementation uses Effect.js for error handling and provides clear error types for different failure scenarios.