Skip to content

Fix 2.16 search field metadata cross version upgrade#22039

Merged
prastoin merged 4 commits into
mainfrom
fix-cross-version-upgrade-command
Jun 23, 2026
Merged

Fix 2.16 search field metadata cross version upgrade#22039
prastoin merged 4 commits into
mainfrom
fix-cross-version-upgrade-command

Conversation

@prastoin

@prastoin prastoin commented Jun 23, 2026

Copy link
Copy Markdown
Member

Introduction

Allow decorating at class scope the properties introduced in specific upgrade command

@WasIntroducedInUpgrade({
  upgradeCommandName:
    ADD_UNIVERSAL_IDENTIFIER_AND_APPLICATION_ID_TO_SEARCH_FIELD_METADATA_UPGRADE_COMMAND_NAME,
  properties: ['universalIdentifier', 'applicationId', 'position'],
})

Here the search field metadata has been created as it without extending the syncableEntity a previous PR I've created now extends it, but nothing has been protected the fact they're not decorated. Also having to re-declare the properties would be redundant to me

Review in cubic

@prastoin prastoin marked this pull request as ready for review June 23, 2026 16:15
@twenty-ci-bot-public

twenty-ci-bot-public Bot commented Jun 23, 2026

Copy link
Copy Markdown

🔍 Automated Pre-Review

No issues detected - This PR is ready for human review.


View details

Automated pre-review — human approval still required.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 9 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/twenty-server/src/engine/twenty-orm/upgrade-aware/upgrade-aware-entity-metadata.adapter.ts">

<violation number="1" location="packages/twenty-server/src/engine/twenty-orm/upgrade-aware/upgrade-aware-entity-metadata.adapter.ts:365">
P2: Validation now accepts relation property names for `@WasIntroducedInUpgrade(properties)`, but upgrade-aware resolution only supports columns. This can hide misconfigured decorators that never take effect.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@Weiko Weiko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

expect(getWasIntroducedInUpgradeClassMetadata(Example)).toBeUndefined();
});

it('merges with property-level decorators on the same entity', () => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

FYI TS applies class decorators after property decorators

@prastoin prastoin force-pushed the fix-cross-version-upgrade-command branch from c6073b6 to 22f317c Compare June 23, 2026 16:27
@prastoin prastoin enabled auto-merge (squash) June 23, 2026 16:33
@prastoin prastoin merged commit b768441 into main Jun 23, 2026
141 of 143 checks passed
@prastoin prastoin deleted the fix-cross-version-upgrade-command branch June 23, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants