Skip to content
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

feat(backend): schema updates, migration, queries for Email Notification Service #9445

Merged
Merged
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
cae84e5
feat(infra): add rabbitmq to dockercompose
ntindle Feb 6, 2025
e2c9ce0
fix(infra): missed some
ntindle Feb 6, 2025
40b4d2f
feat(backend): add dependencies
ntindle Feb 6, 2025
dfe2ec2
fix(infra): missed dependencies + docs
ntindle Feb 6, 2025
d1d09df
Merge branch 'ntindle/secrt-1086-deploy-rabbitmq-as-part-of-our-docke…
ntindle Feb 6, 2025
325cd0a
feat(backend): base level attachment to rabbitmq for services
ntindle Feb 6, 2025
81bad75
fix: add healthcheck
ntindle Feb 7, 2025
c5eab7c
Merge branch 'dev' into ntindle/secrt-1086-deploy-rabbitmq-as-part-of…
ntindle Feb 7, 2025
fab0aba
Merge branch 'ntindle/secrt-1086-deploy-rabbitmq-as-part-of-our-docke…
ntindle Feb 7, 2025
d864e9c
fix(backend): rebuild rabbitmq infra
ntindle Feb 7, 2025
ee1df0f
feat(backend): add async checker + classifiy rabbitmq
ntindle Feb 7, 2025
e80d4ab
Merge branch 'dev' into ntindle/secrt-1087-attach-rabbit-mq-to-the-se…
ntindle Feb 7, 2025
66fee3a
fix(lint): fix linting and minor issues
ntindle Feb 7, 2025
2cb8157
feat(db): schema updates + migration
ntindle Feb 7, 2025
a9a268e
feat(backend): updated models for notification types + preferences
ntindle Feb 7, 2025
c23f180
feat(backend): notification queries + active user counter
ntindle Feb 7, 2025
7ff6f48
feat(backend): executions in time range query
ntindle Feb 7, 2025
815935f
feat(backend): expose added queries
ntindle Feb 7, 2025
74b1ea0
feat(backend): update models a bit more
ntindle Feb 8, 2025
ea07f03
Merge branch 'dev' into ntindle/secrt-1088-add-db-models-for-the-noti…
ntindle Feb 10, 2025
7dbb1a2
feat(backend): bring downstream changes up
ntindle Feb 10, 2025
1b28a04
feat(backend): add more migrations
ntindle Feb 10, 2025
eeec3c3
fix(backend): add the package deps
ntindle Feb 10, 2025
64e6294
fix(backend): linting
ntindle Feb 10, 2025
6ed6fa1
fix(backend): broken db query oops
ntindle Feb 10, 2025
26ce281
Merge branch 'dev' into ntindle/secrt-1088-add-db-models-for-the-noti…
ntindle Feb 10, 2025
bada17d
feat(backend): pull up changes from downstream
ntindle Feb 10, 2025
4481827
Merge branch 'dev' into ntindle/secrt-1088-add-db-models-for-the-noti…
ntindle Feb 10, 2025
c71bb17
fix(backend): relock
ntindle Feb 10, 2025
91df11b
ref(backend): use lowercase types
ntindle Feb 11, 2025
0e99bdc
ref(backend): smash migrations and apply changes to api
ntindle Feb 11, 2025
63e3582
Merge branch 'ntindle/secrt-1088-add-db-models-for-the-notification-s…
ntindle Feb 11, 2025
e2441c5
Apply suggestions from code review
ntindle Feb 11, 2025
bf49a0a
Update autogpt_platform/backend/backend/data/notifications.py
ntindle Feb 11, 2025
11cda46
ref(backend): pr changes
ntindle Feb 11, 2025
957ebe6
refactor(backend): raise errors from db queries
ntindle Feb 11, 2025
c69df5c
ref(backend): update from pr changes
ntindle Feb 12, 2025
1cd90ef
Merge branch 'dev' into ntindle/secrt-1088-add-db-models-for-the-noti…
ntindle Feb 12, 2025
85f8f41
fix(backend): relock
ntindle Feb 12, 2025
ddd2b9d
fix(backend): the tests did dumb stuff like reusing ids
ntindle Feb 12, 2025
aa21bf7
fix(backend): format
ntindle Feb 12, 2025
21c3a6f
Merge branch 'dev' into ntindle/secrt-1088-add-db-models-for-the-noti…
ntindle Feb 12, 2025
47e14d5
fix(backend): move stuff to the user object and stop messing with 1-1…
ntindle Feb 12, 2025
20267d6
Discard changes to autogpt_platform/frontend/yarn.lock
ntindle Feb 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions autogpt_platform/backend/backend/data/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from backend.data.block import BlockData, BlockInput, CompletedBlockOutput
from backend.data.includes import EXECUTION_RESULT_INCLUDE, GRAPH_EXECUTION_INCLUDE
from backend.data.queue import AsyncRedisEventBus, RedisEventBus
from backend.server.v2.store.exceptions import DatabaseError
from backend.util import json, mock
from backend.util.settings import Config

Expand Down Expand Up @@ -364,6 +365,31 @@ async def get_execution_results(graph_exec_id: str) -> list[ExecutionResult]:
return res


async def get_executions_in_timerange(
user_id: str, start_time: str, end_time: str
) -> list[ExecutionResult]:
try:
executions = await AgentGraphExecution.prisma().find_many(
where={
"AND": [
{
"startedAt": {
"gte": datetime.fromisoformat(start_time),
"lte": datetime.fromisoformat(end_time),
}
},
{"userId": user_id},
]
},
include=GRAPH_EXECUTION_INCLUDE,
)
return [ExecutionResult.from_graph(execution) for execution in executions]
except Exception as e:
raise DatabaseError(
f"Failed to get executions in timerange {start_time} to {end_time} for user {user_id}: {e}"
) from e


LIST_SPLIT = "_$_"
DICT_SPLIT = "_#_"
OBJC_SPLIT = "_@_"
Expand Down
Loading