Skip to content

feat(api-service): api for env level change fixes NV-6155 #8608

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

Open
wants to merge 68 commits into
base: next
Choose a base branch
from

Conversation

scopsy
Copy link
Contributor

@scopsy scopsy commented Jun 29, 2025

What changed? Why was the change needed?

Screenshots

Expand for optional sections

Related enterprise PR

Special notes for your reviewer

Summary by CodeRabbit

  • New Features

    • Introduced API endpoints to compare ("diff") and publish resources (workflows) between environments, including dry-run support.
    • Added detailed reporting on changes (added, modified, deleted, unchanged) for workflows and their steps between environments.
    • Enabled transactional synchronization to ensure safe, atomic publishing of workflows.
    • Provided comprehensive summaries and structured results for both diff and publish operations.
  • Bug Fixes

    • Ensured payload schema and validation settings are preserved when syncing workflows across environments.
  • Tests

    • Added end-to-end tests for environment diff and publish endpoints, covering validation, resource changes, and response structure.

Copy link

linear bot commented Jun 29, 2025

Copy link

netlify bot commented Jun 29, 2025

Deploy Preview for dashboard-v2-novu-staging canceled.

Name Link
🔨 Latest commit aa954ed
🔍 Latest deploy log https://app.netlify.com/projects/dashboard-v2-novu-staging/deploys/686cea59012c6e000866b8eb

Updated imports and usage of WorkflowOriginEnum to ResourceOriginEnum in environment and workflow sync logic to align with changes in the shared module. This ensures consistency and compatibility with the updated enum naming.
Enhanced the environment diff logic to include step-level changes (added, modified, deleted, moved) in workflows. Updated DTOs, types, and sync strategies to support detailed step diffs and extended summary statistics. This provides more granular insight into workflow differences between environments.
The diff logic now returns an array of results, each representing a single entity (workflow) with its own entityId, entityName, diffs, and summary. DTOs, types, and tests were updated to reflect this structure, improving clarity and granularity of environment diff results.
Removed separate step-level change counters from diff summary DTOs, types, and aggregation logic. Now, added, modified, deleted, and unchanged counts include both workflows and steps, streamlining the summary structure and reducing redundancy.
Added the @exclude() decorator to the session property in workflow and message template command classes to prevent the session from being serialized in API responses. This change improves security and ensures sensitive session data is not exposed.
The userId is now passed from the controller to the GetMyEnvironmentsCommand. This allows use cases to access the user's ID when retrieving environments.
Refactored environment diff E2E tests to use beforeEach for better isolation. Added null checks for source and target workflows in WorkflowComparator to prevent errors. Marked the session property with @exclude in UpdateWorkflowCommand to avoid serializing it in responses.
@scopsy scopsy marked this pull request as ready for review July 6, 2025 20:22
Introduces the 'updatedBy' field to WorkflowResponseDto and WorkflowListResponseDto, allowing tracking of the user who last updated a workflow. Adds the 'type' field to EnvironmentResponseDto as an optional property. Also updates related schemas and types in the internal SDK, and exposes the 'slug' field in LayoutResponseDto. Removes @ApiExcludeController from LayoutsController and improves OpenAPI property annotations for user DTOs.
Added the @ApiExcludeController() decorator to prevent the LayoutsController from appearing in the generated Swagger API documentation.
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.

1 participant