Skip to content

Review/systems and deployments api#58

Closed
waltergalvao wants to merge 29 commits intomainfrom
review/systems-and-deployments-api
Closed

Review/systems and deployments api#58
waltergalvao wants to merge 29 commits intomainfrom
review/systems-and-deployments-api

Conversation

@waltergalvao
Copy link
Copy Markdown
Contributor

@waltergalvao waltergalvao commented Oct 8, 2025

Summary by CodeRabbit

  • New Features
    • Introduced Applications, Deployments, Incidents, and Environments with queries and mutations (create/update, list, get by ID).
    • Added environment archive/unarchive actions.
    • Deployment details now include last production deployment, author, related pull requests, and counts.
  • Improvements
    • Team, People, and Repository lists support filtering by IDs.
    • Refined permissions to validate workspace membership for mutations.
    • Enhanced validation for inputs (applications, incidents, teams).
    • Updated Slack digest links to new /humans routes.
  • Chores
    • Expanded GraphQL types/operations for new entities across API and frontend.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Oct 8, 2025

Walkthrough

Adds DORA domain: Applications, Environments, Deployments, Incidents, and DeployedPullRequests across DB schema, Prisma models, services, validators, and GraphQL types/resolvers. Refactors authorization to member-scoped checks. Expands filtering in People/Teams/Repositories. Introduces transformers and validation utilities. Updates GraphQL SDL, frontend typed documents, and several minor refactors.

Changes

Cohort / File(s) Summary
Database & Prisma models
apps/api/prisma/migrations/20250911021019_create_dora_tables/migration.sql, apps/api/prisma/schema.prisma
Creates Environment, Application, Deployment, Incident, DeployedPullRequest tables with RLS policies and indexes; adds corresponding Prisma models and relations across Workspace, Team, Repository, PullRequest, GitProfile.
Authorization refactor
apps/api/src/app/authorization.service.ts, apps/api/src/app/**/resolvers/mutations/* (alerts/api-keys/automations/digests/integrations/teams/workspaces), apps/api/src/app/**/services/*authorization*.ts, apps/api/src/app/auth/services/auth.service.ts, apps/api/src/app/billing/**, apps/api/src/app/integrations/slack/services/slack-integration.service.ts
Replaces authorizeWorkspaceOrThrow with authorizeWorkspaceMemberOrThrow; adds authorizeTeamMembersOrThrow; centralizes isActiveCustomer/getTemporaryNonce/preventCSRFAttack import source; updates call sites.
GraphQL SDL root Mutation declarations
apps/api/src/app/alerts/resolvers/alerts.schema.ts, .../api-keys/resolvers/api-keys.schema.ts, .../automations/resolvers/automations.schema.ts, .../digests/resolvers/digests.schema.ts
Changes SDL from extend type Mutation to type Mutation without altering fields.
Applications feature
apps/api/src/app/applications/resolvers/*, .../services/application.*, .../resolvers/transformers/application.transformer.ts
Adds Application types, inputs, queries (list/one), mutation (upsert), field resolver (Deployment.application), transformer, service (find/paginate/upsert), validation schema.
Deployments feature
apps/api/src/app/deployment/resolvers/*, .../services/deployment.*, .../resolvers/transformers/deployment.transformer.ts
Adds Deployment type, list/one queries, Application.lastProductionDeployment resolver, Incident deployment resolvers, transformer, service for fetch/paginate/last production.
Environments feature
apps/api/src/app/environments/resolvers/*, .../services/environment.*, .../resolvers/transformers/environment.transformer.ts
Introduces Environment type, workspace environments query, archive/unarchive mutations, Deployment.environment resolver, service (find/paginate/archive/unarchive), transformer.
Incidents feature
apps/api/src/app/incidents/resolvers/*, .../services/incident.*
Adds Incident type, list/one queries, upsert mutation, leader/team/deployment field resolvers, transformer, service (find/paginate/upsert), validation schema.
Pull Requests × Deployments
apps/api/src/app/pull-requests/resolvers/pull-requests.schema.ts, .../resolvers/queries/deployment-pull-requests.query.ts, .../services/pull-request.service.ts, .../services/pull-request.types.ts, .../resolvers/transformers/pull-request.transformer.ts
Extends Deployment with pullRequests and pullRequestCount; adds resolvers; services to fetch/count PRs by deployment; types updated; minor import tidy.
People enhancements
apps/api/src/app/people/resolvers/people.schema.ts, .../resolvers/queries/people.query.ts, .../resolvers/queries/deployment-author.query.ts, .../resolvers/queries/incident-leader.query.ts, .../services/people.service.ts, .../services/people.types.ts
Adds ids filter to PeopleQueryInput; supports gitProfileIds in pagination; adds Deployment.author and Incident.leader resolvers; updates service filtering and types.
Repositories updates
apps/api/src/app/repositories/resolvers/repositories.schema.ts, .../resolvers/queries/repositories.query.ts, .../resolvers/queries/pull-request-repository.query.ts, .../resolvers/queries/application-repository.query.ts, .../services/repository.service.ts, .../services/repository.types.ts
Adds ids filter to RepositoriesQueryInput and query plumbing; new Application.repository resolver; refactors findRepositoryById signature (+OrThrow), supports repositoriesIds filter; updates types and call sites.
Teams updates
apps/api/src/app/teams/resolvers/queries/teams.query.ts, .../resolvers/queries/application-team.query.ts, .../resolvers/queries/incident-team.query.ts, .../resolvers/mutations/upsert-team.mutation.ts, .../services/team.service.ts, .../services/team.types.ts, .../services/team.validation.ts
Adds ids filtering; resolvers for Application.team and Incident.team; switches to member-based auth in upsert; service adds OrThrow helpers, workspace scoping, validation; types renamed/augmented; new validation schema.
Validator and shared types
apps/api/src/app/validator.service.ts, apps/api/src/app/types.ts, apps/api/src/lib/validate-input.ts
Adds zod-based validateInputOrThrow and ID validators (workspace member, deployment, application, team, repository); introduces DateTimeRange; exports STRING_INPUT_MAX_LENGTH and URL_INPUT_MAX_LENGTH.
Digests URL tweaks
apps/api/src/app/digests/services/digest-team-metrics.service.ts, .../services/digest-team-wip.service.ts, .../services/digest-schedule.service.ts
Updates Slack/action URLs to /humans paths; moves isActiveCustomer import source.
GraphQL types generation
packages/graphql-types/api.ts, packages/graphql-types/frontend/gql.ts
Adds generated types/resolvers for Application/Deployment/Environment/Incident and related inputs; adds many frontend document typings and graphql() overloads.
Miscellaneous refactors
apps/api/src/app/code-reviews/resolvers/transformers/code-review.transformer.ts, .../github/services/github-code-review.service.ts, .../sync-batch/workers/sync-batch.worker.ts, .../workspaces/services/workspace.service.ts
Minor import cleanups; const binding for array; remove optional worker token parameter; remove unused imports.

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120–180 minutes

Possibly related PRs

Suggested labels

huge, enhancement

Suggested reviewers

  • sweetrdev

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The title “Review/systems and deployments api” is too vague and does not clearly convey the major changes in this pull request, which introduce new Prisma models, SQL migrations, and comprehensive GraphQL APIs for environments, applications, deployments, incidents, and pull requests. It includes a slash and generic terms that do not summarize the primary feature additions or motivations. A concise, descriptive title would help reviewers understand the scope at a glance. Please provide a more descriptive title that summarizes the key changes, for example “Add Prisma models and GraphQL APIs for environments, applications, deployments, incidents, and pull requests.”
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch review/systems-and-deployments-api

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 18

🧹 Nitpick comments (15)
apps/api/src/app/digests/services/digest-team-wip.service.ts (1)

79-79: Verify frontend routes for new /humans/teams URLs.
Ensure the frontend exposes these routes to prevent 404s when Slack buttons are clicked:

  • /humans/teams/:id
  • /humans/teams/:id/digests/wip

Optional: extract a URL‐builder utility to replace duplicated template literals in both digest‐wip and digest‐metrics services.

apps/api/src/app/repositories/resolvers/queries/repositories.query.ts (1)

20-20: LGTM! Filtering by repository IDs added.

The new repositoriesIds parameter enables filtering repositories by a set of IDs, consistent with the existing parameter handling pattern.

Optionally, you could simplify to repositoriesIds: input?.ids, since the optional chaining already returns undefined when input is nullish. However, keeping || undefined maintains consistency with the existing code style on lines 21-22.

apps/api/src/app/people/resolvers/queries/people.query.ts (1)

20-20: LGTM! Git profile ID filtering added.

The new gitProfileIds parameter enables filtering people by specific git profile IDs, following the same pattern as the repositories query.

Similar to the repositories query, you could simplify to gitProfileIds: input?.ids, since optional chaining handles the undefined case. However, || undefined maintains consistency with lines 21-23.

apps/api/src/app/teams/resolvers/queries/teams.query.ts (1)

31-31: Consider simplifying the undefined fallback.

The || undefined is redundant since input?.ids already returns undefined when nullish. You can simplify to just input?.ids.

Apply this diff to simplify:

-      teamIds: input?.ids || undefined,
+      teamIds: input?.ids,
apps/api/src/app/repositories/resolvers/queries/application-repository.query.ts (1)

20-23: Type assertions bypass compile-time safety.

Using bracket notation and type assertions (as number) to access repositoryId indicates this property exists in the database model but not in the public GraphQL type. While this pattern works, it's fragile and could break if the database schema changes.

Consider creating an internal type that extends the public API type to document these hidden fields:

type ApplicationWithInternals = Application & {
  repositoryId: number;
  workspaceId: number;
};

export const applicationRepositoryQuery = createFieldResolver("Application", {
  repository: async (application: ApplicationWithInternals, _, context) => {
    // ...
    repositoryId: application.repositoryId,
    // ...
  },
});
apps/api/src/app/environments/resolvers/query/environments.query.ts (1)

18-24: Simplify optional parameter handling.

The pattern input.ids || undefined is redundant because paginateEnvironments already handles undefined and empty arrays correctly. Additionally, using || with arrays can have unexpected behavior (empty array [] becomes undefined).

Consider passing values directly for clarity:

     const environments = await paginateEnvironments(workspace.id, {
-      environmentIds: input.ids || undefined,
-      query: input.query || undefined,
-      cursor: input.cursor || undefined,
-      limit: input.limit || undefined,
-      includeArchived: input.includeArchived || undefined,
+      environmentIds: input.ids ?? undefined,
+      query: input.query ?? undefined,
+      cursor: input.cursor ?? undefined,
+      limit: input.limit ?? undefined,
+      includeArchived: input.includeArchived ?? undefined,
     });

Or, if the service handles nullish values correctly, pass them directly:

     const environments = await paginateEnvironments(workspace.id, {
-      environmentIds: input.ids || undefined,
-      query: input.query || undefined,
-      cursor: input.cursor || undefined,
-      limit: input.limit || undefined,
-      includeArchived: input.includeArchived || undefined,
+      environmentIds: input.ids,
+      query: input.query,
+      cursor: input.cursor,
+      limit: input.limit,
+      includeArchived: input.includeArchived,
     });
apps/api/src/app/teams/services/team.validation.ts (1)

9-9: Bind workspaceId to the scoped workspace.

Because this schema is already parameterized with the trusted workspace id, accepting an arbitrary numeric workspaceId from the payload opens the door for mismatched or forged workspace writes if downstream code relies on the parsed value. Replace the field with z.literal(workspaceId) (or drop it entirely and inject the trusted value later) so callers can’t smuggle operations into another workspace.

apps/api/src/app/applications/services/application.validation.ts (1)

8-8: Lock workspaceId to the caller’s scope.

For the same reason as in the team schema, this workspace-scoped validator shouldn’t let the client provide an arbitrary workspaceId. Swap z.number() for z.literal(workspaceId) (or remove the field and inject the trusted id later) to prevent callers from steering operations into a different workspace.

apps/api/src/app/deployment/resolvers/queries/deployments.query.ts (3)

15-17: Improve error specificity.

The code checks both workspace.id and input, but the error message only mentions "Workspace not found". This could be confusing when the actual issue is missing input.

Apply this diff for clearer error messages:

-    if (!workspace.id || !input) {
+    if (!workspace.id) {
       throw new ResourceNotFoundException("Workspace not found");
     }
+    
+    if (!input) {
+      throw new ResourceNotFoundException("Query input is required");
+    }

21-32: Remove redundant || undefined patterns.

The code uses || undefined for already-optional fields. This is redundant because input.ids is already undefined if not provided.

Simplify to:

     const deployments = await paginateDeployments(workspace.id, {
-      deploymentIds: input.ids || undefined,
-      query: input.query || undefined,
+      deploymentIds: input.ids,
+      query: input.query,
       deployedAt: {
-        from: input.deployedAt?.from || undefined,
-        to: input.deployedAt?.to || undefined,
+        from: input.deployedAt?.from,
+        to: input.deployedAt?.to,
       },
-      applicationIds: input.applicationIds || undefined,
-      environmentIds: input.environmentIds || undefined,
-      cursor: input.cursor || undefined,
-      limit: input.limit || undefined,
+      applicationIds: input.applicationIds,
+      environmentIds: input.environmentIds,
+      cursor: input.cursor,
+      limit: input.limit,
     });

39-41: Same error specificity issue.

As with the deployments resolver, the error check and message don't align.

Apply this diff:

-    if (!workspace.id || !deploymentId) {
+    if (!workspace.id) {
       throw new ResourceNotFoundException("Workspace not found");
     }
+    
+    if (!deploymentId) {
+      throw new ResourceNotFoundException("Deployment ID is required");
+    }
apps/api/src/app/incidents/services/incident.validation.ts (1)

16-20: Consider simplifying .optional().nullable() to just .optional().

Several fields use both .optional() and .nullable(), creating a union type of T | undefined | null. Unless your API semantically distinguishes between null (explicitly cleared) and undefined (not provided), this adds unnecessary complexity.

If null and undefined are treated the same, simplify to:

-    fixDeploymentId: deploymentValidator(workspaceId).optional().nullable(),
-    leaderId: workspaceMemberValidator(workspaceId).optional().nullable(),
-    teamId: teamValidator(workspaceId).optional().nullable(),
-    postmortemUrl: z.string().max(URL_INPUT_MAX_LENGTH).optional().nullable(),
-    resolvedAt: z.date().optional().nullable(),
+    fixDeploymentId: deploymentValidator(workspaceId).optional(),
+    leaderId: workspaceMemberValidator(workspaceId).optional(),
+    teamId: teamValidator(workspaceId).optional(),
+    postmortemUrl: z.string().max(URL_INPUT_MAX_LENGTH).optional(),
+    resolvedAt: z.date().optional(),
apps/api/src/app/applications/resolvers/queries/deployment-application.query.ts (2)

29-31: Data integrity check should be logged, not just thrown.

If a deployment has an applicationId but the application isn't found, this suggests a data integrity issue (orphaned deployment). Consider logging this scenario for monitoring purposes before throwing.

     if (!application) {
+      logger.error("Data integrity issue: deployment references non-existent application", {
+        deploymentId: deployment.id,
+        applicationId: deployment["applicationId"],
+        workspaceId: deployment["workspaceId"],
+      });
       throw new ResourceNotFoundException("Application not found");
     }

12-22: Use consistent property access and consolidate validation

  • Destructure id, workspaceId, and applicationId from deployment and use dot notation instead of deployment["…"].
  • (Optional) Extract or combine the null checks into a single guard or helper to reduce repetition and clarify intent.
apps/api/src/app/incidents/services/incident.service.ts (1)

82-84: Redundant workspaceId in update clause.

The workspaceId is already included in the validated data object (Line 69-72) and should be immutable for existing records. Including it in the update clause is redundant.

Consider removing workspaceId from the update clause:

     update: {
       ...data,
-      workspaceId,
     },
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0b52d61 and d5cf454.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (90)
  • apps/api/prisma/migrations/20250911021019_create_dora_tables/migration.sql (1 hunks)
  • apps/api/prisma/schema.prisma (7 hunks)
  • apps/api/src/app/alerts/resolvers/alerts.schema.ts (1 hunks)
  • apps/api/src/app/alerts/resolvers/mutations/update-alert.mutation.ts (2 hunks)
  • apps/api/src/app/alerts/services/alert-merged-without-approval.service.ts (1 hunks)
  • apps/api/src/app/alerts/services/alert-schedule.service.ts (1 hunks)
  • apps/api/src/app/api-keys/resolvers/api-keys.schema.ts (1 hunks)
  • apps/api/src/app/api-keys/resolvers/mutations/api-keys.mutation.ts (1 hunks)
  • apps/api/src/app/applications/resolvers/applications.schema.ts (1 hunks)
  • apps/api/src/app/applications/resolvers/mutations/upsert-application.mutation.ts (1 hunks)
  • apps/api/src/app/applications/resolvers/queries/applications.query.ts (1 hunks)
  • apps/api/src/app/applications/resolvers/queries/deployment-application.query.ts (1 hunks)
  • apps/api/src/app/applications/resolvers/transformers/application.transformer.ts (1 hunks)
  • apps/api/src/app/applications/services/application.service.ts (1 hunks)
  • apps/api/src/app/applications/services/application.types.ts (1 hunks)
  • apps/api/src/app/applications/services/application.validation.ts (1 hunks)
  • apps/api/src/app/auth/services/auth.service.ts (1 hunks)
  • apps/api/src/app/authorization.service.ts (1 hunks)
  • apps/api/src/app/automations/resolvers/automations.schema.ts (1 hunks)
  • apps/api/src/app/automations/resolvers/mutations/update-automation.mutation.ts (1 hunks)
  • apps/api/src/app/automations/services/automation.service.ts (1 hunks)
  • apps/api/src/app/automations/sweets/pr-title-check/pr-title-check.service.ts (1 hunks)
  • apps/api/src/app/billing/resolvers/queries/is-active-customer.query.ts (1 hunks)
  • apps/api/src/app/billing/services/billing.service.ts (1 hunks)
  • apps/api/src/app/code-reviews/resolvers/transformers/code-review.transformer.ts (1 hunks)
  • apps/api/src/app/deployment/resolvers/deployments.schema.ts (1 hunks)
  • apps/api/src/app/deployment/resolvers/queries/application-deployment.query.ts (1 hunks)
  • apps/api/src/app/deployment/resolvers/queries/deployments.query.ts (1 hunks)
  • apps/api/src/app/deployment/resolvers/queries/incident-deployments.query.ts (1 hunks)
  • apps/api/src/app/deployment/resolvers/transformers/deployment.transformer.ts (1 hunks)
  • apps/api/src/app/deployment/services/deployment.service.ts (1 hunks)
  • apps/api/src/app/deployment/services/deployment.types.ts (1 hunks)
  • apps/api/src/app/digests/resolvers/digests.schema.ts (1 hunks)
  • apps/api/src/app/digests/resolvers/mutations/update-digest.mutation.ts (2 hunks)
  • apps/api/src/app/digests/services/digest-schedule.service.ts (1 hunks)
  • apps/api/src/app/digests/services/digest-team-metrics.service.ts (1 hunks)
  • apps/api/src/app/digests/services/digest-team-wip.service.ts (1 hunks)
  • apps/api/src/app/environments/resolvers/environments.schema.ts (1 hunks)
  • apps/api/src/app/environments/resolvers/mutations/archive-environment.mutation.ts (1 hunks)
  • apps/api/src/app/environments/resolvers/query/deployment-environment.query.ts (1 hunks)
  • apps/api/src/app/environments/resolvers/query/environments.query.ts (1 hunks)
  • apps/api/src/app/environments/resolvers/transformers/environment.transformer.ts (1 hunks)
  • apps/api/src/app/environments/services/environment.service.ts (1 hunks)
  • apps/api/src/app/environments/services/environment.types.ts (1 hunks)
  • apps/api/src/app/github/services/github-code-review.service.ts (1 hunks)
  • apps/api/src/app/incidents/resolvers/incidents.schema.ts (1 hunks)
  • apps/api/src/app/incidents/resolvers/mutations/upsert-incident.mutation.ts (1 hunks)
  • apps/api/src/app/incidents/resolvers/queries/incidents.query.ts (1 hunks)
  • apps/api/src/app/incidents/resolvers/transformers/incident.transformer.ts (1 hunks)
  • apps/api/src/app/incidents/services/incident.service.ts (1 hunks)
  • apps/api/src/app/incidents/services/incident.types.ts (1 hunks)
  • apps/api/src/app/incidents/services/incident.validation.ts (1 hunks)
  • apps/api/src/app/integrations/resolvers/mutations/install-integration.mutation.ts (2 hunks)
  • apps/api/src/app/integrations/resolvers/mutations/remove-integration.mutation.ts (1 hunks)
  • apps/api/src/app/integrations/resolvers/mutations/send-test-message.mutation.ts (2 hunks)
  • apps/api/src/app/integrations/slack/services/slack-integration.service.ts (1 hunks)
  • apps/api/src/app/people/resolvers/people.schema.ts (1 hunks)
  • apps/api/src/app/people/resolvers/queries/deployment-author.query.ts (1 hunks)
  • apps/api/src/app/people/resolvers/queries/incident-leader.query.ts (1 hunks)
  • apps/api/src/app/people/resolvers/queries/people.query.ts (1 hunks)
  • apps/api/src/app/people/services/people.service.ts (1 hunks)
  • apps/api/src/app/people/services/people.types.ts (1 hunks)
  • apps/api/src/app/pull-requests/resolvers/pull-requests.schema.ts (1 hunks)
  • apps/api/src/app/pull-requests/resolvers/queries/deployment-pull-requests.query.ts (1 hunks)
  • apps/api/src/app/pull-requests/resolvers/transformers/pull-request.transformer.ts (1 hunks)
  • apps/api/src/app/pull-requests/services/pull-request.service.ts (3 hunks)
  • apps/api/src/app/pull-requests/services/pull-request.types.ts (2 hunks)
  • apps/api/src/app/repositories/resolvers/queries/application-repository.query.ts (1 hunks)
  • apps/api/src/app/repositories/resolvers/queries/pull-request-repository.query.ts (1 hunks)
  • apps/api/src/app/repositories/resolvers/queries/repositories.query.ts (1 hunks)
  • apps/api/src/app/repositories/resolvers/repositories.schema.ts (1 hunks)
  • apps/api/src/app/repositories/services/repository.service.ts (2 hunks)
  • apps/api/src/app/repositories/services/repository.types.ts (1 hunks)
  • apps/api/src/app/sync-batch/services/sync-batch.types.ts (1 hunks)
  • apps/api/src/app/sync-batch/workers/sync-batch.worker.ts (1 hunks)
  • apps/api/src/app/teams/resolvers/mutations/upsert-team.mutation.ts (1 hunks)
  • apps/api/src/app/teams/resolvers/queries/application-team.query.ts (1 hunks)
  • apps/api/src/app/teams/resolvers/queries/incident-team.query.ts (1 hunks)
  • apps/api/src/app/teams/resolvers/queries/teams.query.ts (1 hunks)
  • apps/api/src/app/teams/resolvers/teams.schema.ts (1 hunks)
  • apps/api/src/app/teams/services/team.service.ts (6 hunks)
  • apps/api/src/app/teams/services/team.types.ts (2 hunks)
  • apps/api/src/app/teams/services/team.validation.ts (1 hunks)
  • apps/api/src/app/types.ts (1 hunks)
  • apps/api/src/app/validator.service.ts (1 hunks)
  • apps/api/src/app/workspaces/resolvers/mutations/update-workspace-settings.mutation.ts (1 hunks)
  • apps/api/src/app/workspaces/services/workspace.service.ts (0 hunks)
  • apps/api/src/lib/validate-input.ts (1 hunks)
  • packages/graphql-types/api.ts (28 hunks)
  • packages/graphql-types/frontend/gql.ts (7 hunks)
💤 Files with no reviewable changes (1)
  • apps/api/src/app/workspaces/services/workspace.service.ts
🧰 Additional context used
🧬 Code graph analysis (48)
apps/api/src/app/environments/resolvers/query/deployment-environment.query.ts (5)
apps/api/src/lib/graphql.ts (1)
  • createFieldResolver (21-30)
packages/graphql-types/api.ts (1)
  • Deployment (257-278)
apps/api/src/lib/logger.ts (1)
  • logger (13-37)
apps/api/src/app/environments/services/environment.service.ts (1)
  • findEnvironmentById (10-20)
apps/api/src/app/environments/resolvers/transformers/environment.transformer.ts (1)
  • transformEnvironment (4-11)
apps/api/src/app/applications/resolvers/mutations/upsert-application.mutation.ts (6)
apps/api/src/lib/graphql.ts (1)
  • createMutationResolver (11-19)
apps/api/src/lib/logger.ts (1)
  • logger (13-37)
apps/api/src/app/authorization.service.ts (1)
  • authorizeWorkspaceMemberOrThrow (53-72)
apps/api/src/app/billing/services/billing.service.ts (1)
  • protectWithPaywall (141-155)
apps/api/src/app/applications/services/application.service.ts (1)
  • upsertApplication (82-123)
apps/api/src/app/applications/resolvers/transformers/application.transformer.ts (1)
  • transformApplication (7-15)
apps/api/src/app/people/resolvers/queries/incident-leader.query.ts (5)
apps/api/src/lib/graphql.ts (1)
  • createFieldResolver (21-30)
packages/graphql-types/api.ts (1)
  • Incident (376-395)
apps/api/src/lib/logger.ts (1)
  • logger (13-37)
apps/api/src/app/people/services/people.service.ts (1)
  • findGitProfileById (75-87)
apps/api/src/app/people/resolvers/transformers/people.transformer.ts (1)
  • transformPerson (4-17)
apps/api/src/app/deployment/resolvers/queries/application-deployment.query.ts (5)
apps/api/src/lib/graphql.ts (1)
  • createFieldResolver (21-30)
packages/graphql-types/api.ts (1)
  • Application (66-84)
apps/api/src/lib/logger.ts (1)
  • logger (13-37)
apps/api/src/app/deployment/services/deployment.service.ts (1)
  • findLastProductionDeploymentByApplicationId (98-113)
apps/api/src/app/deployment/resolvers/transformers/deployment.transformer.ts (1)
  • transformDeployment (4-15)
apps/api/src/app/incidents/resolvers/queries/incidents.query.ts (5)
apps/api/src/lib/graphql.ts (1)
  • createFieldResolver (21-30)
apps/api/src/lib/logger.ts (1)
  • logger (13-37)
apps/api/src/app/billing/services/billing.service.ts (1)
  • protectWithPaywall (141-155)
apps/api/src/app/incidents/services/incident.service.ts (2)
  • paginateIncidents (20-64)
  • findIncidentById (11-18)
apps/api/src/app/incidents/resolvers/transformers/incident.transformer.ts (1)
  • transformIncident (4-16)
apps/api/src/app/deployment/resolvers/transformers/deployment.transformer.ts (1)
packages/graphql-types/api.ts (1)
  • Omit (11-11)
apps/api/src/app/teams/resolvers/queries/incident-team.query.ts (5)
apps/api/src/lib/graphql.ts (1)
  • createFieldResolver (21-30)
packages/graphql-types/api.ts (1)
  • Incident (376-395)
apps/api/src/lib/logger.ts (1)
  • logger (13-37)
apps/api/src/app/teams/services/team.service.ts (1)
  • findTeamById (13-23)
apps/api/src/app/teams/resolvers/transformers/team.transformer.ts (1)
  • transformTeam (4-21)
apps/api/src/app/repositories/resolvers/queries/pull-request-repository.query.ts (1)
apps/api/src/app/repositories/services/repository.service.ts (1)
  • findRepositoryById (9-19)
apps/api/src/app/digests/resolvers/mutations/update-digest.mutation.ts (1)
apps/api/src/app/authorization.service.ts (1)
  • authorizeWorkspaceMemberOrThrow (53-72)
apps/api/src/app/environments/resolvers/mutations/archive-environment.mutation.ts (5)
apps/api/src/lib/graphql.ts (1)
  • createMutationResolver (11-19)
apps/api/src/lib/logger.ts (1)
  • logger (13-37)
apps/api/src/app/billing/services/billing.service.ts (1)
  • protectWithPaywall (141-155)
apps/api/src/app/environments/services/environment.service.ts (2)
  • archiveEnvironment (59-67)
  • unarchiveEnvironment (69-77)
apps/api/src/app/environments/resolvers/transformers/environment.transformer.ts (1)
  • transformEnvironment (4-11)
apps/api/src/app/applications/resolvers/transformers/application.transformer.ts (2)
packages/graphql-types/api.ts (2)
  • Omit (11-11)
  • DeploymentSettings (280-286)
apps/api/src/app/applications/services/application.types.ts (1)
  • DeploymentSettings (22-25)
apps/api/src/app/people/resolvers/queries/deployment-author.query.ts (5)
apps/api/src/lib/graphql.ts (1)
  • createFieldResolver (21-30)
packages/graphql-types/api.ts (1)
  • Deployment (257-278)
apps/api/src/lib/logger.ts (1)
  • logger (13-37)
apps/api/src/app/people/services/people.service.ts (1)
  • findGitProfileById (75-87)
apps/api/src/app/people/resolvers/transformers/people.transformer.ts (1)
  • transformPerson (4-17)
apps/api/src/app/applications/services/application.validation.ts (2)
apps/api/src/lib/validate-input.ts (1)
  • STRING_INPUT_MAX_LENGTH (4-4)
apps/api/src/app/validator.service.ts (2)
  • repositoryValidator (66-73)
  • teamValidator (57-64)
apps/api/src/app/environments/resolvers/query/environments.query.ts (5)
apps/api/src/lib/graphql.ts (1)
  • createFieldResolver (21-30)
apps/api/src/lib/logger.ts (1)
  • logger (13-37)
apps/api/src/app/billing/services/billing.service.ts (1)
  • protectWithPaywall (141-155)
apps/api/src/app/environments/services/environment.service.ts (1)
  • paginateEnvironments (22-57)
apps/api/src/app/environments/resolvers/transformers/environment.transformer.ts (1)
  • transformEnvironment (4-11)
apps/api/src/app/incidents/services/incident.types.ts (2)
apps/api/src/app/types.ts (1)
  • DateTimeRange (1-4)
packages/graphql-types/api.ts (2)
  • DateTimeRange (240-245)
  • UpsertIncidentInput (942-961)
apps/api/src/app/applications/services/application.types.ts (2)
packages/graphql-types/api.ts (2)
  • DeploymentSettings (280-286)
  • UpsertApplicationInput (925-940)
packages/graphql-types/frontend/graphql.ts (2)
  • DeploymentSettings (277-283)
  • UpsertApplicationInput (922-937)
apps/api/src/app/deployment/resolvers/queries/deployments.query.ts (5)
apps/api/src/lib/graphql.ts (1)
  • createFieldResolver (21-30)
apps/api/src/lib/logger.ts (1)
  • logger (13-37)
apps/api/src/app/billing/services/billing.service.ts (1)
  • protectWithPaywall (141-155)
apps/api/src/app/deployment/services/deployment.service.ts (2)
  • paginateDeployments (35-96)
  • findDeploymentById (10-20)
apps/api/src/app/deployment/resolvers/transformers/deployment.transformer.ts (1)
  • transformDeployment (4-15)
apps/api/src/app/automations/resolvers/mutations/update-automation.mutation.ts (1)
apps/api/src/app/authorization.service.ts (1)
  • authorizeWorkspaceMemberOrThrow (53-72)
apps/api/src/app/integrations/resolvers/mutations/send-test-message.mutation.ts (1)
apps/api/src/app/authorization.service.ts (1)
  • authorizeWorkspaceMemberOrThrow (53-72)
apps/api/src/app/digests/services/digest-team-wip.service.ts (1)
apps/api/src/env.ts (1)
  • env (6-133)
apps/api/src/app/deployment/resolvers/queries/incident-deployments.query.ts (5)
apps/api/src/lib/graphql.ts (1)
  • createFieldResolver (21-30)
packages/graphql-types/api.ts (1)
  • Incident (376-395)
apps/api/src/lib/logger.ts (1)
  • logger (13-37)
apps/api/src/app/deployment/services/deployment.service.ts (1)
  • findDeploymentById (10-20)
apps/api/src/app/deployment/resolvers/transformers/deployment.transformer.ts (1)
  • transformDeployment (4-15)
apps/api/src/app/incidents/services/incident.validation.ts (2)
apps/api/src/app/validator.service.ts (3)
  • deploymentValidator (39-46)
  • workspaceMemberValidator (27-37)
  • teamValidator (57-64)
apps/api/src/lib/validate-input.ts (1)
  • URL_INPUT_MAX_LENGTH (5-5)
apps/api/src/app/applications/resolvers/queries/applications.query.ts (5)
apps/api/src/lib/graphql.ts (1)
  • createFieldResolver (21-30)
apps/api/src/lib/logger.ts (1)
  • logger (13-37)
apps/api/src/app/billing/services/billing.service.ts (1)
  • protectWithPaywall (141-155)
apps/api/src/app/applications/services/application.service.ts (2)
  • paginateApplications (39-80)
  • findApplicationById (14-24)
apps/api/src/app/applications/resolvers/transformers/application.transformer.ts (1)
  • transformApplication (7-15)
apps/api/src/app/deployment/services/deployment.service.ts (2)
apps/api/src/app/deployment/services/deployment.types.ts (3)
  • FindDeploymentByIdArgs (13-16)
  • PaginateDeploymentsArgs (3-11)
  • FindLastProductionDeploymentByApplicationIdArgs (18-21)
apps/api/src/prisma.ts (2)
  • getPrisma (23-49)
  • take (51-53)
apps/api/src/app/applications/resolvers/queries/deployment-application.query.ts (4)
apps/api/src/lib/graphql.ts (1)
  • createFieldResolver (21-30)
packages/graphql-types/api.ts (1)
  • Deployment (257-278)
apps/api/src/app/applications/services/application.service.ts (1)
  • findApplicationById (14-24)
apps/api/src/app/applications/resolvers/transformers/application.transformer.ts (1)
  • transformApplication (7-15)
apps/api/src/app/incidents/resolvers/transformers/incident.transformer.ts (1)
packages/graphql-types/api.ts (1)
  • Omit (11-11)
apps/api/src/app/environments/services/environment.service.ts (2)
apps/api/src/app/environments/services/environment.types.ts (4)
  • FindEnvironmentByIdArgs (1-4)
  • PaginateEnvironmentsArgs (6-12)
  • ArchiveEnvironmentArgs (14-17)
  • UnarchiveEnvironmentArgs (19-22)
apps/api/src/prisma.ts (2)
  • getPrisma (23-49)
  • take (51-53)
apps/api/src/app/pull-requests/resolvers/queries/deployment-pull-requests.query.ts (4)
apps/api/src/lib/graphql.ts (1)
  • createFieldResolver (21-30)
apps/api/src/lib/logger.ts (1)
  • logger (13-37)
apps/api/src/app/pull-requests/services/pull-request.service.ts (2)
  • findPullRequestsByDeploymentId (207-223)
  • countPullRequestsByDeploymentId (225-232)
apps/api/src/app/pull-requests/resolvers/transformers/pull-request.transformer.ts (1)
  • transformPullRequest (7-17)
apps/api/src/app/teams/resolvers/mutations/upsert-team.mutation.ts (1)
apps/api/src/app/authorization.service.ts (1)
  • authorizeWorkspaceMemberOrThrow (53-72)
apps/api/src/app/teams/resolvers/queries/application-team.query.ts (5)
apps/api/src/lib/graphql.ts (1)
  • createFieldResolver (21-30)
packages/graphql-types/api.ts (1)
  • Application (66-84)
apps/api/src/lib/logger.ts (1)
  • logger (13-37)
apps/api/src/app/teams/services/team.service.ts (1)
  • findTeamById (13-23)
apps/api/src/app/teams/resolvers/transformers/team.transformer.ts (1)
  • transformTeam (4-21)
apps/api/src/app/incidents/resolvers/mutations/upsert-incident.mutation.ts (6)
apps/api/src/lib/graphql.ts (1)
  • createMutationResolver (11-19)
apps/api/src/lib/logger.ts (1)
  • logger (13-37)
apps/api/src/app/authorization.service.ts (1)
  • authorizeWorkspaceMemberOrThrow (53-72)
apps/api/src/app/billing/services/billing.service.ts (1)
  • protectWithPaywall (141-155)
apps/api/src/app/incidents/services/incident.service.ts (1)
  • upsertIncident (66-87)
apps/api/src/app/incidents/resolvers/transformers/incident.transformer.ts (1)
  • transformIncident (4-16)
apps/api/src/app/deployment/services/deployment.types.ts (1)
apps/api/src/app/types.ts (1)
  • DateTimeRange (1-4)
apps/api/src/app/repositories/services/repository.service.ts (2)
apps/api/src/app/repositories/services/repository.types.ts (1)
  • FindRepositoryByIdArgs (1-4)
apps/api/src/prisma.ts (1)
  • getPrisma (23-49)
apps/api/src/app/digests/services/digest-team-metrics.service.ts (1)
apps/api/src/env.ts (1)
  • env (6-133)
apps/api/src/app/teams/services/team.validation.ts (2)
apps/api/src/lib/validate-input.ts (1)
  • STRING_INPUT_MAX_LENGTH (4-4)
apps/api/src/prisma.ts (1)
  • getPrisma (23-49)
apps/api/src/app/api-keys/resolvers/mutations/api-keys.mutation.ts (1)
apps/api/src/app/authorization.service.ts (1)
  • authorizeWorkspaceMemberOrThrow (53-72)
apps/api/src/app/incidents/services/incident.service.ts (4)
apps/api/src/app/incidents/services/incident.types.ts (3)
  • FindIncidentByIdArgs (3-6)
  • PaginateIncidentsArgs (8-14)
  • UpsertIncidentInput (16-26)
apps/api/src/prisma.ts (2)
  • getPrisma (23-49)
  • take (51-53)
apps/api/src/app/validator.service.ts (1)
  • validateInputOrThrow (9-25)
apps/api/src/app/incidents/services/incident.validation.ts (1)
  • getIncidentValidationSchema (9-21)
apps/api/src/app/teams/services/team.service.ts (3)
apps/api/src/app/teams/services/team.types.ts (3)
  • FindTeamByIdArgs (3-6)
  • FindTeamsByWorkspaceArgs (27-32)
  • FindTeamMembersArgs (8-11)
apps/api/src/app/validator.service.ts (1)
  • validateInputOrThrow (9-25)
apps/api/src/app/teams/services/team.validation.ts (1)
  • getTeamValidationSchema (7-42)
apps/api/src/app/applications/services/application.service.ts (4)
apps/api/src/app/applications/services/application.types.ts (3)
  • FindApplicationByIdArgs (3-6)
  • PaginateApplicationsArgs (8-14)
  • UpsertApplicationInput (27-35)
apps/api/src/prisma.ts (2)
  • getPrisma (23-49)
  • take (51-53)
apps/api/src/app/validator.service.ts (1)
  • validateInputOrThrow (9-25)
apps/api/src/app/applications/services/application.validation.ts (1)
  • getApplicationValidationSchema (6-23)
apps/api/src/app/integrations/resolvers/mutations/remove-integration.mutation.ts (1)
apps/api/src/app/authorization.service.ts (1)
  • authorizeWorkspaceMemberOrThrow (53-72)
apps/api/src/app/repositories/resolvers/queries/application-repository.query.ts (5)
apps/api/src/lib/graphql.ts (1)
  • createFieldResolver (21-30)
packages/graphql-types/api.ts (1)
  • Application (66-84)
apps/api/src/lib/logger.ts (1)
  • logger (13-37)
apps/api/src/app/repositories/services/repository.service.ts (1)
  • findRepositoryById (9-19)
apps/api/src/app/repositories/resolvers/transformers/repository.transformer.ts (1)
  • transformRepository (4-12)
apps/api/src/app/workspaces/resolvers/mutations/update-workspace-settings.mutation.ts (1)
apps/api/src/app/authorization.service.ts (1)
  • authorizeWorkspaceMemberOrThrow (53-72)
apps/api/src/app/integrations/resolvers/mutations/install-integration.mutation.ts (1)
apps/api/src/app/authorization.service.ts (1)
  • authorizeWorkspaceMemberOrThrow (53-72)
apps/api/src/app/authorization.service.ts (1)
apps/api/src/prisma.ts (1)
  • getPrisma (23-49)
packages/graphql-types/api.ts (4)
packages/graphql-types/frontend/graphql.ts (33)
  • Application (63-81)
  • Maybe (3-3)
  • Scalars (11-24)
  • DeploymentSettings (277-283)
  • Deployment (254-275)
  • Repository (780-785)
  • Team (798-814)
  • ApplicationsQueryInput (83-94)
  • InputMaybe (4-4)
  • ArchiveEnvironmentInput (96-99)
  • Person (587-598)
  • Environment (342-351)
  • PullRequest (618-647)
  • DeploymentSettingsInput (285-290)
  • DeploymentsQueryInput (299-314)
  • DateTimeRange (237-242)
  • EnvironmentsQueryInput (353-364)
  • Incident (373-392)
  • IncidentsQueryInput (394-405)
  • Automation (124-129)
  • Workspace (977-1010)
  • UnarchiveEnvironmentInput (878-881)
  • UpsertApplicationInput (922-937)
  • UpsertIncidentInput (939-958)
  • Billing (149-156)
  • Charts (174-182)
  • WorkspaceApplicationArgs (1013-1015)
  • WorkspaceApplicationsArgs (1018-1020)
  • WorkspaceDeploymentArgs (1033-1035)
  • WorkspaceDeploymentsArgs (1038-1040)
  • WorkspaceEnvironmentsArgs (1043-1045)
  • WorkspaceIncidentArgs (1048-1050)
  • WorkspaceIncidentsArgs (1053-1055)
apps/api/src/app/applications/services/application.types.ts (2)
  • DeploymentSettings (22-25)
  • UpsertApplicationInput (27-35)
apps/api/src/app/incidents/services/incident.types.ts (1)
  • UpsertIncidentInput (16-26)
packages/graphql-types/shared.ts (1)
  • GraphQLContext (7-27)
apps/api/src/app/validator.service.ts (7)
apps/api/src/lib/validate-input.ts (1)
  • validateInputOrThrow (7-22)
apps/api/src/app/errors/exceptions/input-validation.exception.ts (1)
  • InputValidationException (11-25)
apps/api/src/app/authorization.service.ts (1)
  • authorizeWorkspaceMemberOrThrow (53-72)
apps/api/src/app/deployment/services/deployment.service.ts (1)
  • findDeploymentByIdOrThrow (22-33)
apps/api/src/app/applications/services/application.service.ts (1)
  • findApplicationByIdOrThrow (26-37)
apps/api/src/app/teams/services/team.service.ts (1)
  • findTeamByIdOrThrow (25-36)
apps/api/src/app/repositories/services/repository.service.ts (1)
  • findRepositoryByIdOrThrow (21-32)
apps/api/src/app/pull-requests/services/pull-request.service.ts (2)
apps/api/src/app/pull-requests/services/pull-request.types.ts (2)
  • FindPullRequestsByDeploymentIdArgs (21-24)
  • CountPullRequestsByDeploymentIdArgs (26-29)
apps/api/src/prisma.ts (2)
  • getPrisma (23-49)
  • take (51-53)
apps/api/src/app/alerts/resolvers/mutations/update-alert.mutation.ts (1)
apps/api/src/app/authorization.service.ts (1)
  • authorizeWorkspaceMemberOrThrow (53-72)

Comment thread apps/api/prisma/schema.prisma
Comment thread apps/api/src/app/alerts/resolvers/alerts.schema.ts
Comment thread apps/api/src/app/incidents/services/incident.service.ts
Comment thread apps/api/src/app/teams/resolvers/mutations/upsert-team.mutation.ts
Comment thread apps/api/src/app/validator.service.ts
@waltergalvao waltergalvao deleted the review/systems-and-deployments-api branch October 8, 2025 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant