Skip to content

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.

@linear
Copy link

linear bot commented Jun 29, 2025

@netlify
Copy link

netlify bot commented Jun 29, 2025

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

Name Link
🔨 Latest commit d2cf7a2
🔍 Latest deploy log https://app.netlify.com/projects/dashboard-v2-novu-staging/deploys/68750093dc27870008221e0a

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.
Changed diff and publish API endpoints to use '/v2/environments/:targetEnvironmentId/diff' and '/v2/environments/:targetEnvironmentId/publish' instead of passing targetEnvironmentId in the request body. Updated DTOs, commands, use cases, controller, validation service, and tests to support this change. Also, sourceEnvironmentId is now optional and defaults to the development environment if not provided.
Improves e2e tests for environment diff and publish flows by clarifying workflow creation, adding skipped tests for known issues, and ensuring default source environment logic is tested. Refactors SDK class to use consistent import formatting and improves method argument formatting for readability.
Updated environment diff and publish e2e tests to create workflows using the novuClient SDK instead of the previous createWorkflow function. Also added a short delay after workflow creation to ensure workflows are fully created before proceeding with tests. Removed skipped tests related to workflow creation issues.
Introduces optional ClientSession parameters to workflow and notification template commands, usecases, and repository methods. This enables transactional operations for workflow creation, patching, upserting, and preference management, improving consistency and reliability in multi-step database operations.
Removed unnecessary comments and adjusted assertions in the environment publish E2E test. The test now expects the workflow to be skipped (successful: 0, skipped: 1) when publishing without a sourceEnvironmentId, reflecting updated behavior.
@scopsy scopsy merged commit 182ccd8 into next Jul 14, 2025
15 of 19 checks passed
@scopsy scopsy deleted the nv-6155-api-for-env-level-change branch July 14, 2025 13:05
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