Skip to content

Conversation

@martmull
Copy link
Contributor

as title, upload built files to local storage

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 74 files

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 22, 2026

Greptile Summary

This PR implements functionality to upload built application files to local storage during the build process. The implementation includes a new GraphQL resolver uploadApplicationFile and integrates file uploads into the CLI build command.

Major changes:

  • Added uploadApplicationFile mutation in application.resolver.ts with proper validation for allowed file folders (BuiltFunction, BuiltFrontComponent, Asset, Source)
  • Implemented uploadFile method in ApiService using GraphQL multipart upload with form-data
  • Refactored pascalCase utility to twenty-shared package for reuse across SDK and server
  • Modified onFileBuilt callback to async to support file upload operations
  • Added file upload logic in buildFunctions method that uploads each built function file

Critical issue found:

  • Front components are built but NOT uploaded - the buildFrontComponents method lacks the upload logic that exists in buildFunctions

Test artifacts:

  • toto and toto1 test app directories were committed and should be removed or added to .gitignore

Confidence Score: 2/5

  • This PR has a critical implementation gap - front components are not being uploaded
  • The PR implements only half of the required functionality. While functions are successfully uploaded to storage, front components are built but never uploaded, creating an inconsistent state. The test app directories should also be removed before merging.
  • Critical: packages/twenty-sdk/src/cli/commands/app/app-build.ts needs upload logic added for front components. Remove test directories: packages/twenty-apps/toto/ and packages/twenty-apps/toto1/

Important Files Changed

Filename Overview
packages/twenty-sdk/src/cli/commands/app/app-build.ts Added file upload functionality for built functions but missing upload logic for front components (critical issue)
packages/twenty-server/src/engine/core-modules/application/application.resolver.ts Added uploadApplicationFile mutation with proper validation and security checks
packages/twenty-apps/toto/src/app/application.config.ts Test app directory that should likely not be committed to the repository

Sequence Diagram

sequenceDiagram
    participant CLI as CLI (app-build)
    participant FW as FunctionsWatcher
    participant FCW as FrontComponentsWatcher
    participant API as ApiService
    participant Server as GraphQL Server
    participant Storage as FileStorage

    CLI->>FW: buildFunctions()
    CLI->>FCW: buildFrontComponents()
    
    FW->>FW: Build function files (.mjs)
    FW->>CLI: onFileBuilt(builtPath, checksum)
    CLI->>API: uploadFile(filePath, FileFolder.BuiltFunction)
    API->>Server: GraphQL uploadApplicationFile mutation
    Server->>Storage: Write file to storage
    Storage-->>Server: File saved
    Server-->>API: FileDTO response
    API-->>CLI: Upload success
    
    Note over FCW: Missing upload logic!
    FCW->>FCW: Build front component files (.mjs)
    FCW->>CLI: onFileBuilt(builtPath, checksum)
    Note over CLI,Storage: Front components NOT uploaded
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Additional Comments (2)

  1. packages/twenty-sdk/src/cli/commands/app/app-build.ts, line 107-130 (link)

    logic: Front components are built but NOT uploaded to storage. Only functions have upload logic in onFileBuilt callback (lines 85-99). Add similar upload logic for front components:

  2. packages/twenty-apps/toto/src/app/application.config.ts, line 1-10 (link)

    style: toto and toto1 test app directories should not be committed. These appear to be test/development apps that should be in .gitignore.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

65 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@github-actions
Copy link
Contributor

github-actions bot commented Jan 22, 2026

🚀 Preview Environment Ready!

Your preview environment is available at: http://bore.pub:8047

This environment will automatically shut down when the PR is closed or after 5 hours.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 22, 2026

📊 API Changes Report

GraphQL Schema Changes

GraphQL Schema Changes

[log]
Detected the following changes (2) between schemas:

[log] ✖ Argument builtHandlerPath: String! added to field Mutation.uploadApplicationFile
[log] ✖ Argument filePath: String! was removed from field Mutation.uploadApplicationFile
[error] Detected 2 breaking changes
⚠️ Breaking changes or errors detected in GraphQL schema

[log] 
Detected the following changes (2) between schemas:

[log] ✖  Argument builtHandlerPath: String! added to field Mutation.uploadApplicationFile
[log] ✖  Argument filePath: String! was removed from field Mutation.uploadApplicationFile
[error] Detected 2 breaking changes
Error generating diff

GraphQL Metadata Schema Changes

GraphQL Metadata Schema Changes

[log]
Detected the following changes (2) between schemas:

[log] ✖ Argument builtHandlerPath: String! added to field Mutation.uploadApplicationFile
[log] ✖ Argument filePath: String! was removed from field Mutation.uploadApplicationFile
[error] Detected 2 breaking changes
⚠️ Breaking changes or errors detected in GraphQL metadata schema

[log] 
Detected the following changes (2) between schemas:

[log] ✖  Argument builtHandlerPath: String! added to field Mutation.uploadApplicationFile
[log] ✖  Argument filePath: String! was removed from field Mutation.uploadApplicationFile
[error] Detected 2 breaking changes
Error generating diff

⚠️ Please review these API changes carefully before merging.

⚠️ Breaking Change Protocol

Breaking changes detected but PR title does not contain "breaking" - CI will pass but action needed.

🔄 Options:

  1. If this IS a breaking change: Add "breaking" to your PR title and add BREAKING CHANGE: to your commit message
  2. If this is NOT a breaking change: The API diff tool may have false positives - please review carefully

For breaking changes, add to commit message:

feat: add new API endpoint

BREAKING CHANGE: removed deprecated field from User schema

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 24 files (changes from recent commits).

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/twenty-sdk/src/cli/commands/app/app-sync.ts">

<violation number="1" location="packages/twenty-sdk/src/cli/commands/app/app-sync.ts:39">
P2: Handle upload failures before proceeding to sync so the manifest isn’t published when built files failed to upload.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

4 issues found across 26 files (changes from recent commits).

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/twenty-sdk/src/cli/__tests__/apps/root-app/__integration__/app-dev/app-dev.integration.spec.ts">

<violation number="1" location="packages/twenty-sdk/src/cli/__tests__/apps/root-app/__integration__/app-dev/app-dev.integration.spec.ts:4">
P2: The root-app spec now points to rich-app front-component tests, which assert a different output layout (src/components/*). This will fail against root-app’s root-level output and validates the wrong behavior.</violation>

<violation number="2" location="packages/twenty-sdk/src/cli/__tests__/apps/root-app/__integration__/app-dev/app-dev.integration.spec.ts:5">
P2: The root-app spec imports rich-app function tests, which expect a different output structure (nested src/functions). This mismatches root-app’s root-level function outputs.</violation>

<violation number="3" location="packages/twenty-sdk/src/cli/__tests__/apps/root-app/__integration__/app-dev/app-dev.integration.spec.ts:6">
P2: The root-app integration spec now imports rich-app manifest tests, which assert a different application name and counts. This will validate the wrong manifest for root-app and likely fail.</violation>

<violation number="4" location="packages/twenty-sdk/src/cli/__tests__/apps/root-app/__integration__/app-dev/app-dev.integration.spec.ts:8">
P2: The root-app spec now uses rich-app console output assertions, which check for different app names and counts. This will fail and validates the wrong console output for root-app.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

import { defineFunctionsTests } from '@/cli/__tests__/apps/rich-app/__integration__/app-dev/tests/functions.tests';
import { defineManifestTests } from '@/cli/__tests__/apps/rich-app/__integration__/app-dev/tests/manifest.tests';
import { runAppDev } from '@/cli/__tests__/integration/utils/run-app-dev.util';
import { defineConsoleOutputTests } from '@/cli/__tests__/apps/rich-app/__integration__/app-dev/tests/console-output.tests';
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Jan 23, 2026

Choose a reason for hiding this comment

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

P2: The root-app spec now uses rich-app console output assertions, which check for different app names and counts. This will fail and validates the wrong console output for root-app.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/twenty-sdk/src/cli/__tests__/apps/root-app/__integration__/app-dev/app-dev.integration.spec.ts, line 8:

<comment>The root-app spec now uses rich-app console output assertions, which check for different app names and counts. This will fail and validates the wrong console output for root-app.</comment>

<file context>
@@ -1,11 +1,11 @@
+import { defineFunctionsTests } from '@/cli/__tests__/apps/rich-app/__integration__/app-dev/tests/functions.tests';
+import { defineManifestTests } from '@/cli/__tests__/apps/rich-app/__integration__/app-dev/tests/manifest.tests';
+import { runAppDev } from '@/cli/__tests__/integration/utils/run-app-dev.util';
+import { defineConsoleOutputTests } from '@/cli/__tests__/apps/rich-app/__integration__/app-dev/tests/console-output.tests';
 
 const APP_PATH = join(__dirname, '../..');
</file context>
Suggested change
import { defineConsoleOutputTests } from '@/cli/__tests__/apps/rich-app/__integration__/app-dev/tests/console-output.tests';
import { defineConsoleOutputTests } from '@/cli/__tests__/apps/root-app/__integration__/app-dev/tests/console-output.tests';
Fix with Cubic

import { defineManifestTests } from './tests/manifest.tests';
import { type RunCliCommandResult } from '@/cli/__tests__/integration/utils/run-cli-command.util';
import { defineFrontComponentsTests } from '@/cli/__tests__/apps/rich-app/__integration__/app-dev/tests/front-components.tests';
import { defineFunctionsTests } from '@/cli/__tests__/apps/rich-app/__integration__/app-dev/tests/functions.tests';
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Jan 23, 2026

Choose a reason for hiding this comment

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

P2: The root-app spec imports rich-app function tests, which expect a different output structure (nested src/functions). This mismatches root-app’s root-level function outputs.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/twenty-sdk/src/cli/__tests__/apps/root-app/__integration__/app-dev/app-dev.integration.spec.ts, line 5:

<comment>The root-app spec imports rich-app function tests, which expect a different output structure (nested src/functions). This mismatches root-app’s root-level function outputs.</comment>

<file context>
@@ -1,11 +1,11 @@
-import { defineManifestTests } from './tests/manifest.tests';
+import { type RunCliCommandResult } from '@/cli/__tests__/integration/utils/run-cli-command.util';
+import { defineFrontComponentsTests } from '@/cli/__tests__/apps/rich-app/__integration__/app-dev/tests/front-components.tests';
+import { defineFunctionsTests } from '@/cli/__tests__/apps/rich-app/__integration__/app-dev/tests/functions.tests';
+import { defineManifestTests } from '@/cli/__tests__/apps/rich-app/__integration__/app-dev/tests/manifest.tests';
+import { runAppDev } from '@/cli/__tests__/integration/utils/run-app-dev.util';
</file context>
Suggested change
import { defineFunctionsTests } from '@/cli/__tests__/apps/rich-app/__integration__/app-dev/tests/functions.tests';
import { defineFunctionsTests } from '@/cli/__tests__/apps/root-app/__integration__/app-dev/tests/functions.tests';
Fix with Cubic

import { defineFunctionsTests } from './tests/functions.tests';
import { defineManifestTests } from './tests/manifest.tests';
import { type RunCliCommandResult } from '@/cli/__tests__/integration/utils/run-cli-command.util';
import { defineFrontComponentsTests } from '@/cli/__tests__/apps/rich-app/__integration__/app-dev/tests/front-components.tests';
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Jan 23, 2026

Choose a reason for hiding this comment

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

P2: The root-app spec now points to rich-app front-component tests, which assert a different output layout (src/components/*). This will fail against root-app’s root-level output and validates the wrong behavior.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/twenty-sdk/src/cli/__tests__/apps/root-app/__integration__/app-dev/app-dev.integration.spec.ts, line 4:

<comment>The root-app spec now points to rich-app front-component tests, which assert a different output layout (src/components/*). This will fail against root-app’s root-level output and validates the wrong behavior.</comment>

<file context>
@@ -1,11 +1,11 @@
-import { defineFunctionsTests } from './tests/functions.tests';
-import { defineManifestTests } from './tests/manifest.tests';
+import { type RunCliCommandResult } from '@/cli/__tests__/integration/utils/run-cli-command.util';
+import { defineFrontComponentsTests } from '@/cli/__tests__/apps/rich-app/__integration__/app-dev/tests/front-components.tests';
+import { defineFunctionsTests } from '@/cli/__tests__/apps/rich-app/__integration__/app-dev/tests/functions.tests';
+import { defineManifestTests } from '@/cli/__tests__/apps/rich-app/__integration__/app-dev/tests/manifest.tests';
</file context>
Suggested change
import { defineFrontComponentsTests } from '@/cli/__tests__/apps/rich-app/__integration__/app-dev/tests/front-components.tests';
import { defineFrontComponentsTests } from '@/cli/__tests__/apps/root-app/__integration__/app-dev/tests/front-components.tests';
Fix with Cubic

import { type RunCliCommandResult } from '@/cli/__tests__/integration/utils/run-cli-command.util';
import { defineFrontComponentsTests } from '@/cli/__tests__/apps/rich-app/__integration__/app-dev/tests/front-components.tests';
import { defineFunctionsTests } from '@/cli/__tests__/apps/rich-app/__integration__/app-dev/tests/functions.tests';
import { defineManifestTests } from '@/cli/__tests__/apps/rich-app/__integration__/app-dev/tests/manifest.tests';
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Jan 23, 2026

Choose a reason for hiding this comment

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

P2: The root-app integration spec now imports rich-app manifest tests, which assert a different application name and counts. This will validate the wrong manifest for root-app and likely fail.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/twenty-sdk/src/cli/__tests__/apps/root-app/__integration__/app-dev/app-dev.integration.spec.ts, line 6:

<comment>The root-app integration spec now imports rich-app manifest tests, which assert a different application name and counts. This will validate the wrong manifest for root-app and likely fail.</comment>

<file context>
@@ -1,11 +1,11 @@
+import { type RunCliCommandResult } from '@/cli/__tests__/integration/utils/run-cli-command.util';
+import { defineFrontComponentsTests } from '@/cli/__tests__/apps/rich-app/__integration__/app-dev/tests/front-components.tests';
+import { defineFunctionsTests } from '@/cli/__tests__/apps/rich-app/__integration__/app-dev/tests/functions.tests';
+import { defineManifestTests } from '@/cli/__tests__/apps/rich-app/__integration__/app-dev/tests/manifest.tests';
+import { runAppDev } from '@/cli/__tests__/integration/utils/run-app-dev.util';
+import { defineConsoleOutputTests } from '@/cli/__tests__/apps/rich-app/__integration__/app-dev/tests/console-output.tests';
</file context>
Suggested change
import { defineManifestTests } from '@/cli/__tests__/apps/rich-app/__integration__/app-dev/tests/manifest.tests';
import { defineManifestTests } from '@/cli/__tests__/apps/root-app/__integration__/app-dev/tests/manifest.tests';
Fix with Cubic

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.

2 participants