mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-07-25 12:01:04 +02:00
chore: implement review comments
This commit is contained in:
parent
a6ca02bd13
commit
681c1c9801
6 changed files with 16 additions and 16 deletions
|
|
@ -29,7 +29,7 @@ Contributor setup and service startup are documented in `docs/contribution/setup
|
|||
|
||||
## Environment Configuration
|
||||
|
||||
- `api/.env` - Backend environment variables. Source this when running diagnostic scripts or one-off services against the dev DB (e.g. `python -m api.services.admin_utils.<script>`).
|
||||
- `api/.env` - Backend environment variables. Source this when running repo-owned backend scripts against the dev DB (e.g. `python -m scripts.dump_docs_openapi`).
|
||||
- `api/.env.test` - Test-only environment variables. Source this when running pytest so tests hit the test DB and never the dev/prod credentials in `api/.env`.
|
||||
- `ui/.env` - Frontend environment variables
|
||||
|
||||
|
|
@ -39,6 +39,6 @@ Typical invocation:
|
|||
# Tests
|
||||
source venv/bin/activate && set -a && source api/.env.test && set +a && python -m pytest api/tests/...
|
||||
|
||||
# Diagnostics / scripts
|
||||
source venv/bin/activate && set -a && source api/.env && set +a && python -m api.services.admin_utils.<script>
|
||||
# Backend scripts
|
||||
source venv/bin/activate && set -a && source api/.env && set +a && python -m scripts.dump_docs_openapi
|
||||
```
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ MINIMUM_DOGRAH_CREDITS_FOR_CALL = 0.10
|
|||
|
||||
OSS_QUOTA_EXCEEDED_MESSAGE = (
|
||||
"You have exhausted your trial credits. "
|
||||
"Please email founders@dograh.com for additional Dograh credits "
|
||||
"or change providers in Models configurations."
|
||||
"Please sign up on app.dograh.com to create a "
|
||||
"new service key and set up in your model configurations."
|
||||
)
|
||||
|
||||
HOSTED_QUOTA_EXCEEDED_MESSAGE = (
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
"""Rule-based audit of a workflow definition's nodes + edges.
|
||||
|
||||
Pure, dependency-free helpers derived from `NodeSpec.graph_constraints`.
|
||||
Lives in tracked code so the regression tests in
|
||||
`test_workflow_graph_constraints.py` can pin it; admin cleanup scripts
|
||||
under `api/services/admin_utils/` are the production consumers.
|
||||
Lives in tracked code so `test_workflow_graph_constraints.py` can pin the
|
||||
verdicts that one-off cleanup tooling needs to share with runtime validation.
|
||||
"""
|
||||
|
||||
from collections import Counter
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ category of violation we found in production. We pin two layers:
|
|||
layer ever stops rejecting one of these fixtures, the production
|
||||
write paths will quietly start accepting bad workflows again.
|
||||
2. audit_definition (api.services.workflow.audit) — read-only sweep
|
||||
over persisted rows used by the admin cleanup script to find
|
||||
over persisted rows for one-off cleanup tooling that finds
|
||||
legacy/imported breakage. Pinned so refactors of the rule set
|
||||
don't silently change the verdicts the migration relies on.
|
||||
don't silently change those cleanup verdicts.
|
||||
|
||||
DTO-level shape validation is covered by `test_dto.py` and isn't
|
||||
re-pinned here.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# generated by datamodel-codegen:
|
||||
# filename: dograh-openapi-XXXXXX.json.svihj4XwE6
|
||||
# timestamp: 2026-07-07T11:32:10+00:00
|
||||
# filename: dograh-openapi-XXXXXX.json.qHm1SwtOq5
|
||||
# timestamp: 2026-07-07T12:20:41+00:00
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ export default function BillingPage() {
|
|||
const router = useRouter();
|
||||
const searchParams = useSearchParams();
|
||||
const auth = useAuth();
|
||||
const { config } = useAppConfig();
|
||||
const { config, loading: configLoading } = useAppConfig();
|
||||
const [credits, setCredits] = useState<MpsBillingCreditsResponse | null>(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [refreshing, setRefreshing] = useState(false);
|
||||
|
|
@ -125,8 +125,9 @@ export default function BillingPage() {
|
|||
() => getPageFromSearchParams(searchParams),
|
||||
);
|
||||
|
||||
const isOssMode = config?.deploymentMode === "oss";
|
||||
const canPurchaseCredits = !isOssMode;
|
||||
const hasAppConfig = !configLoading && config !== null;
|
||||
const isOssMode = hasAppConfig && config.deploymentMode === "oss";
|
||||
const canPurchaseCredits = hasAppConfig && config.deploymentMode !== "oss";
|
||||
const totalQuota = credits?.total_quota ?? 0;
|
||||
const remainingCredits = credits?.remaining_credits ?? 0;
|
||||
const usedCredits = credits?.total_credits_used ?? 0;
|
||||
|
|
@ -228,7 +229,7 @@ export default function BillingPage() {
|
|||
}
|
||||
};
|
||||
|
||||
if (loading) {
|
||||
if (loading || configLoading) {
|
||||
return (
|
||||
<div className="container mx-auto p-6 space-y-6">
|
||||
<div className="space-y-2">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue