-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[Chore] : Generate migration for DATE_TIME to DATE for DATE_TIME + IS operand filters #17564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[Chore] : Generate migration for DATE_TIME to DATE for DATE_TIME + IS operand filters #17564
Conversation
...ase/commands/upgrade-version-command/1-17/1-17-migrate-date-time-is-filter-values.command.ts
Outdated
Show resolved
Hide resolved
Greptile OverviewGreptile SummaryThis PR adds a data migration command to convert DATE_TIME field filter values from ISO datetime format (e.g., The migration:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant CLI as CLI Command
participant Cmd as MigrateDateTimeIsFilterValuesCommand
participant VFR as ViewFilterRepository
participant DB as Database
CLI->>Cmd: runOnWorkspace(workspaceId, options)
Cmd->>VFR: find(where: {workspaceId}, relations: ['fieldMetadata'])
VFR->>DB: Query view filters with field metadata
DB-->>VFR: Return view filters
VFR-->>Cmd: viewFilters[]
Cmd->>Cmd: Filter by DATE_TIME type + IS operand + value contains 'T'
Cmd->>Cmd: filtersToUpdate[]
alt No filters to update
Cmd-->>CLI: Early return
end
alt isDryRun
Cmd->>Cmd: Log dry run message
Cmd-->>CLI: Return without updates
else Update mode
loop For each filter
Cmd->>Cmd: Split value by 'T' to extract date
Cmd->>Cmd: Validate date format (YYYY-MM-DD)
alt Valid date
Cmd->>VFR: update(filterId, {value: newDate})
VFR->>DB: Update view filter value
DB-->>VFR: Success
VFR-->>Cmd: Updated
Cmd->>Cmd: Increment updatedCount
else Invalid date
Cmd->>Cmd: Log warning and skip
end
end
Cmd->>Cmd: Log migration summary
Cmd-->>CLI: Complete
end
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 files reviewed, 1 comment
...ase/commands/upgrade-version-command/1-17/1-17-migrate-date-time-is-filter-values.command.ts
Show resolved
Hide resolved
There was a problem hiding this 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 2 files
|
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:14644 This environment will automatically shut down when the PR is closed or after 5 hours. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 issues found across 811 files
Note: This PR contains a large number of files. cubic only reviews up to 75 files per PR, so some files may not have been reviewed.
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-front/src/modules/command-menu/components/hooks/usePageLayoutHeaderInfo.ts">
<violation number="1" location="packages/twenty-front/src/modules/command-menu/components/hooks/usePageLayoutHeaderInfo.ts:132">
P2: Graph type labels already include "Chart", so appending another " Chart" results in duplicated titles (e.g., "Pie Chart Chart") for the graph filter header.</violation>
</file>
<file name="packages/twenty-docker/helm/twenty/templates/secret-db-url.yaml">
<violation number="1" location="packages/twenty-docker/helm/twenty/templates/secret-db-url.yaml:2">
P2: Secret DB URL is always generated for the internal DB service; when db.enabled=false/external DB is used, PG_DATABASE_URL still points to the internal service and breaks external DB setups.</violation>
</file>
<file name="packages/twenty-docker/helm/twenty/templates/deployment-worker.yaml">
<violation number="1" location="packages/twenty-docker/helm/twenty/templates/deployment-worker.yaml:58">
P2: Worker now always expects the fixed "<fullname>-db-url" secret, while the only db-url secret template builds an internal DB URL. External DB/external-secret configurations lose their conditional handling and will fail to provide the expected secret/URL, breaking external DB setups.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| const headerType = | ||
| commandMenuPage === CommandMenuPages.PageLayoutGraphFilter | ||
| ? graphTypeLabel | ||
| ? t`${graphTypeLabel} Chart` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Graph type labels already include "Chart", so appending another " Chart" results in duplicated titles (e.g., "Pie Chart Chart") for the graph filter header.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/twenty-front/src/modules/command-menu/components/hooks/usePageLayoutHeaderInfo.ts, line 132:
<comment>Graph type labels already include "Chart", so appending another " Chart" results in duplicated titles (e.g., "Pie Chart Chart") for the graph filter header.</comment>
<file context>
@@ -129,7 +129,7 @@ export const usePageLayoutHeaderInfo = ({
const headerType =
commandMenuPage === CommandMenuPages.PageLayoutGraphFilter
- ? graphTypeLabel
+ ? t`${graphTypeLabel} Chart`
: t`Chart`;
</file context>
| ? t`${graphTypeLabel} Chart` | |
| ? graphTypeLabel |
| @@ -1,5 +1,4 @@ | |||
| {{- $secretName := printf "%s-db-url" (include "twenty.fullname" .) -}} | |||
| {{- if .Values.db.enabled -}} | |||
| {{- $existingSecret := lookup "v1" "Secret" (include "twenty.namespace" .) $secretName -}} | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Secret DB URL is always generated for the internal DB service; when db.enabled=false/external DB is used, PG_DATABASE_URL still points to the internal service and breaks external DB setups.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/twenty-docker/helm/twenty/templates/secret-db-url.yaml, line 2:
<comment>Secret DB URL is always generated for the internal DB service; when db.enabled=false/external DB is used, PG_DATABASE_URL still points to the internal service and breaks external DB setups.</comment>
<file context>
@@ -1,5 +1,4 @@
{{- $secretName := printf "%s-db-url" (include "twenty.fullname" .) -}}
-{{- if .Values.db.enabled -}}
{{- $existingSecret := lookup "v1" "Secret" (include "twenty.namespace" .) $secretName -}}
{{- $appPassword := "" -}}
{{- if $existingSecret -}}
</file context>
| valueFrom: | ||
| secretKeyRef: | ||
| name: {{ include "twenty.dbUrl.secretName" . }} | ||
| name: {{ include "twenty.fullname" . }}-db-url |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Worker now always expects the fixed "-db-url" secret, while the only db-url secret template builds an internal DB URL. External DB/external-secret configurations lose their conditional handling and will fail to provide the expected secret/URL, breaking external DB setups.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/twenty-docker/helm/twenty/templates/deployment-worker.yaml, line 58:
<comment>Worker now always expects the fixed "<fullname>-db-url" secret, while the only db-url secret template builds an internal DB URL. External DB/external-secret configurations lose their conditional handling and will fail to provide the expected secret/URL, breaking external DB setups.</comment>
<file context>
@@ -52,21 +52,11 @@ spec:
valueFrom:
secretKeyRef:
- name: {{ include "twenty.dbUrl.secretName" . }}
+ name: {{ include "twenty.fullname" . }}-db-url
key: url
- {{- end }}
</file context>
043d5c6 to
004b453
Compare
...ase/commands/upgrade-version-command/1-17/1-17-migrate-date-time-is-filter-values.command.ts
Show resolved
Hide resolved
004b453 to
1976ad5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 files reviewed, no comments
migration command in response to the fix : #17529 for the issue twentyhq/core-team-issues#2027