Skip to content

Stage#9400

Merged
evereq merged 2 commits intostagefrom
develop
Feb 1, 2026
Merged

Stage#9400
evereq merged 2 commits intostagefrom
develop

Conversation

@evereq
Copy link
Member

@evereq evereq commented Feb 1, 2026

PR

Please note: we will close your PR without comment if you do not check the boxes above and provide ALL requested information.



Summary by cubic

Adds branch-aware Nx Cloud caching to Docker builds and GitHub workflows, and applies ORM relation decorators only for the active ORM to prevent metadata conflicts.

  • Bug Fixes

    • Many-to-one, one-to-one, one-to-many, and many-to-many decorators now use getORMType and apply either TypeORM or MikroORM decorators, not both.
  • Refactors

    • Pass NX_BRANCH (github.ref_name) to Docker builds and set it in the environment to improve Nx Cloud caching.
    • Forward params in ui-config and ui-core task dependencies to support configuration pass-through.

Written for commit cb3325d. Summary will update on new commits.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 1, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch develop

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.

@evereq evereq merged commit ae44709 into stage Feb 1, 2026
18 of 22 checks passed
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 1, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
16.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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 19 files

@augmentcode
Copy link

augmentcode bot commented Feb 1, 2026

🤖 Augment PR Summary

Summary: This PR improves environment-specific builds and ORM compatibility by wiring branch-aware Nx caching into Docker builds and making multi-ORM relation decorators conditional.

Changes:

  • Added NX_BRANCH as a Docker build arg/env across API, webapp, MCP, and MCP-auth Dockerfiles to support branch-scoped Nx Cloud caching.
  • Updated multiple Docker build/publish GitHub Actions workflows to pass NX_BRANCH=${{ github.ref_name }} into Docker builds.
  • Adjusted MultiORM* relation decorators (ManyToMany/ManyToOne/OneToMany/OneToOne) to apply only the decorator for the active ORM type, determined via getORMType().
  • Updated Nx project configs (ui-config, ui-core) to forward params when invoking dependent targets, helping configuration (e.g., prod/dev) propagate correctly.

Technical Notes: ORM selection is driven by process.env.DB_ORM (defaulting to TypeORM); Nx branch context is sourced from GitHub’s ref_name and injected during Docker builds.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 1 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

})
)(target, propertyKey);
// Determine which ORM is in use
const ormType = getORMType();
Copy link

Choose a reason for hiding this comment

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

getORMType() resolves from process.env.DB_ORM at decorator-evaluation time, so if DB_ORM isn’t set (or is mutated after entities are imported), the relation decorators for the intended ORM won’t be registered. That can lead to missing relation metadata at runtime (especially in tests/CLI contexts) even though the entity class compiles fine.

Other Locations
  • packages/core/src/lib/core/decorators/entity/relations/many-to-one.decorator.ts:71
  • packages/core/src/lib/core/decorators/entity/relations/one-to-many.decorator.ts:60
  • packages/core/src/lib/core/decorators/entity/relations/one-to-one.decorator.ts:71

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 1, 2026

Greptile Overview

Greptile Summary

Enabled NX Cloud branch-specific caching and optimized ORM decorator application to improve build performance and reduce runtime overhead.

  • Added NX_BRANCH environment variable across all Dockerfiles and GitHub workflows to enable branch-specific build caching in NX Cloud
  • Optimized MultiORM decorators (ManyToMany, ManyToOne, OneToMany, OneToOne) to conditionally apply only the active ORM's decorator at runtime instead of applying both TypeORM and MikroORM decorators
  • Added params: forward to NX project dependencies to ensure build parameters propagate correctly

Note: The PR template checkboxes are not checked and the description lacks detail about the changes and their value, which goes against the contributing guidelines.

Confidence Score: 4/5

  • This PR is safe to merge with minor attention needed for deployment verification
  • The changes are infrastructure improvements (NX Cloud optimization) and performance optimizations (conditional ORM decorator application). All changes are well-structured and logically sound. The only considerations are: 1) PR template compliance issues, 2) need to verify github.ref_name works correctly in all workflow contexts (branches, tags, PRs), and 3) runtime testing of the ORM decorator optimization to ensure no edge cases were missed
  • Verify GitHub workflow changes work correctly with github.ref_name in different contexts (tags, PRs)

Important Files Changed

Filename Overview
.deploy/api/Dockerfile Added NX_BRANCH build argument and environment variable for NX Cloud branch tracking
.github/workflows/docker-build-publish-stage.yml Added NX_BRANCH build argument with github.ref_name value for NX Cloud branch identification
packages/core/src/lib/core/decorators/entity/relations/many-to-many.decorator.ts Optimized to conditionally apply ORM decorators based on runtime ORM type instead of applying both
packages/core/src/lib/core/decorators/entity/relations/many-to-one.decorator.ts Optimized to conditionally apply ORM decorators based on runtime ORM type instead of applying both
packages/core/src/lib/core/decorators/entity/relations/one-to-many.decorator.ts Optimized to conditionally apply ORM decorators based on runtime ORM type instead of applying both
packages/core/src/lib/core/decorators/entity/relations/one-to-one.decorator.ts Optimized to conditionally apply ORM decorators based on runtime ORM type instead of applying both

Sequence Diagram

sequenceDiagram
    participant GH as GitHub Workflow
    participant Docker as Docker Build
    participant NX as NX Cloud
    participant App as Application Runtime
    participant ORM as ORM Layer

    Note over GH,NX: Build-Time Optimization
    GH->>Docker: Pass NX_BRANCH (github.ref_name)
    Docker->>NX: Send branch info for cache lookup
    NX->>Docker: Return cached artifacts if available
    Docker->>Docker: Build with branch-specific cache

    Note over App,ORM: Runtime Optimization
    App->>ORM: Load Entity with MultiORM decorators
    ORM->>ORM: Call getORMType() to check DB_ORM env
    alt ORM is TypeORM
        ORM->>ORM: Apply only TypeORM decorator
    else ORM is MikroORM
        ORM->>ORM: Apply only MikroORM decorator
    end
    ORM->>App: Entity ready with single ORM metadata
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.

6 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

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