Skip to content

Remove legacy APIs & transitional code for project workflow #3267

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

Merged
merged 2 commits into from
May 9, 2025

Conversation

CarsonF
Copy link
Member

@CarsonF CarsonF commented Jul 10, 2024

UI is migrated to new paths & doesn't reference these type names.

@CarsonF CarsonF added the 💥 Breaking Change Introduces changes that are not backward compatible and may require modifications in other systems label Jul 10, 2024
Copy link

github-actions bot commented Jul 10, 2024

🗞 GraphQL Summary

View schema changes
@@ -896,9 +896,8 @@
   primaryLocationId: ID
 
   """Defaults to High, only available on internship projects"""
   sensitivity: Sensitivity
-  step: ProjectStep
   tags: [String!] = []
   type: ProjectType!
 }
 
@@ -5045,30 +5044,8 @@
   """@order 26"""
   Terminated
 }
 
-"""
-A transition for the project workflow.
-
-This is not a normalized entity.
-A transition represented by its `key` can have different field values
-based on the workflow's state.
-"""
-type ProjectStepTransition {
-  disabled: Boolean!
-  disabledReason: String
-
-  """
-  An local identifier for this transition.
-  It cannot be used to globally identify a transition.
-  It is passed to the transition mutation.
-  """
-  key: ID!
-  label: String!
-  to: ProjectStep!
-  type: TransitionType!
-}
-
 enum ProjectType {
   """@order 2"""
   Internship
 
@@ -5103,12 +5080,34 @@
   notes: SecuredRichTextNullable!
   to: ProjectStep!
 
   """The transition taken, null if workflow was bypassed"""
-  transition: ProjectStepTransition
+  transition: ProjectWorkflowTransition
   who: SecuredActor!
 }
 
+"""
+A transition for the project workflow.
+
+This is not a normalized entity.
+A transition represented by its `key` can have different field values
+based on the workflow's state.
+"""
+type ProjectWorkflowTransition {
+  disabled: Boolean!
+  disabledReason: String
+
+  """
+  An local identifier for this transition.
+  It cannot be used to globally identify a transition.
+  It is passed to the transition mutation.
+  """
+  key: ID!
+  label: String!
+  to: ProjectStep!
+  type: TransitionType!
+}
+
 type Prompt {
   """Whether the requesting user can delete this resource"""
   canDelete: Boolean!
   createdAt: DateTime!
@@ -6663,9 +6662,9 @@
   canEdit: Boolean!
   canRead: Boolean!
 
   """The transitions currently available to execute for this project"""
-  transitions: [ProjectStepTransition!]!
+  transitions: [ProjectWorkflowTransition!]!
   value: ProjectStep
 }
 
 """
@@ -7789,9 +7788,8 @@
   primaryLocationId: ID
 
   """Update only available to internship projects"""
   sensitivity: Sensitivity
-  step: ProjectStep
   tags: [String!]
 }
 
 input UpdateProjectChangeRequest {

🚨 Breaking Changes

  • ProjectStepTransition was removed.
  • CreateProject.step was removed.
  • ProjectWorkflowEvent.transition changed type from ProjectStepTransition to ProjectWorkflowTransition.
  • SecuredProjectStep.transitions changed type from [ProjectStepTransition!]! to [ProjectWorkflowTransition!]!.
  • UpdateProject.step was removed.

@CarsonF CarsonF force-pushed the drop-old-project-step-mutation branch 2 times, most recently from 10478a3 to 662c4cf Compare July 11, 2024 21:56
@CarsonF CarsonF changed the base branch from develop to tests/new-project-workflow-kinda July 11, 2024 21:56
@CarsonF CarsonF force-pushed the drop-old-project-step-mutation branch from 662c4cf to 960c901 Compare July 11, 2024 22:27
Base automatically changed from tests/new-project-workflow-kinda to develop July 12, 2024 17:40
@CarsonF CarsonF force-pushed the drop-old-project-step-mutation branch from 960c901 to 2c50e17 Compare May 9, 2025 14:06
Copy link

coderabbitai bot commented May 9, 2025

📝 Walkthrough

Walkthrough

This change removes the deprecated and legacy handling of the step property from the project creation and update process. All references to the step field, related enum imports, and legacy workflow transition logic are eliminated from DTOs, services, repositories, and workflow modules. The code is refactored to simplify control flow and remove unused dependencies.

Changes

Files / Areas Change Summary
src/components/project/dto/create-project.dto.ts,
src/components/project/dto/update-project.dto.ts
Removed the optional step field of type ProjectStep from both CreateProject and UpdateProject DTOs. Corresponding imports of ProjectStep were also deleted.
src/components/project/project.repository.ts The step variable in the create method is now always set to ProjectStep.EarlyConversations, ignoring any provided input.
src/components/project/project.service.ts Removed unused imports and dependencies (PartnerService, ConfigService, ProjectWorkflowService). Refactored the update method to remove legacy workflow transition logic and simplify change detection.
src/components/project/workflow/dto/workflow-transition.dto.ts Removed the explicit name argument from the @ObjectType decorator on ProjectWorkflowTransition, letting the type name default.
src/components/project/workflow/migrations/step-history-to-workflow-events.migration.ts Added a TypeScript expect-error comment above a migration property to indicate its removal, with no functional code changes.
src/components/project/workflow/project-workflow.service.ts Removed the import of ProjectStep and deleted the deprecated executeTransitionLegacy method from ProjectWorkflowService.
src/components/project/workflow/transitions/dynamic-step.ts Removed the migrationPrevSteps property from the ResolveParams interface and updated the resolve method in BackTo to no longer use or check for migrationPrevSteps, simplifying the control flow.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 020d0e7 and c89326a.

📒 Files selected for processing (8)
  • src/components/project/dto/create-project.dto.ts (0 hunks)
  • src/components/project/dto/update-project.dto.ts (0 hunks)
  • src/components/project/project.repository.ts (1 hunks)
  • src/components/project/project.service.ts (3 hunks)
  • src/components/project/workflow/dto/workflow-transition.dto.ts (1 hunks)
  • src/components/project/workflow/migrations/step-history-to-workflow-events.migration.ts (1 hunks)
  • src/components/project/workflow/project-workflow.service.ts (1 hunks)
  • src/components/project/workflow/transitions/dynamic-step.ts (1 hunks)
💤 Files with no reviewable changes (2)
  • src/components/project/dto/create-project.dto.ts
  • src/components/project/dto/update-project.dto.ts
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/components/project/workflow/dto/workflow-transition.dto.ts (1)
src/components/project/dto/project-step.enum.ts (1)
  • ObjectType (43-46)
⏰ Context from checks skipped due to timeout of 90000ms (12)
  • GitHub Check: E2E Tests (neo4j 6/6)
  • GitHub Check: E2E Tests (neo4j 5/6)
  • GitHub Check: E2E Tests (neo4j 4/6)
  • GitHub Check: E2E Tests (neo4j 3/6)
  • GitHub Check: E2E Tests (neo4j 2/6)
  • GitHub Check: Generate (head)
  • GitHub Check: E2E Tests (neo4j 1/6)
  • GitHub Check: Generate (base)
  • GitHub Check: lint
  • GitHub Check: Clean
  • GitHub Check: Unit
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (9)
src/components/project/workflow/dto/workflow-transition.dto.ts (1)

5-7:

✅ Verification successful

Ensure GraphQL type name change is intentional and clients are updated
You’ve removed the explicit name ('ProjectStepTransition') from the @ObjectType decorator, so the GraphQL type will now default to ProjectWorkflowTransition. This is a breaking change for any existing client queries or schema dependencies. Please verify that:

  1. All frontend or downstream consumers have been updated to use ProjectWorkflowTransition.
  2. Any documentation or schema snapshots have been regenerated.

Run this script to catch any lingering references to the old type name:


🏁 Script executed:

#!/bin/bash
# Search codebase for usages of the deprecated GraphQL type name
rg --color always -n "ProjectStepTransition" src/

Length of output: 49


🏁 Script executed:

#!/bin/bash
# Search entire repository for any lingering references to the old GraphQL type name
rg --color always -n "ProjectStepTransition"
# Also search in GraphQL schema or fragment files
rg --color always -n "ProjectStepTransition" -g "*.graphql"

Length of output: 253


GraphQL type rename verified—no lingering references found
Our searches across the codebase (including .ts and .graphql files) returned no matches for ProjectStepTransition. The rename to ProjectWorkflowTransition appears safe. Please proceed with updating any downstream clients and regenerating schema snapshots as needed.

src/components/project/workflow/migrations/step-history-to-workflow-events.migration.ts (1)

80-81: Appropriate use of @ts-expect-error comment.

The comment clearly explains that the migrationPrevSteps property has been removed from the source code but is being retained in this migration file for reference purposes. This approach allows the migration to continue functioning while acknowledging the codebase changes.

src/components/project/project.repository.ts (1)

160-160: Good simplification of project creation.

This change ensures all new projects are consistently created with the step ProjectStep.EarlyConversations, regardless of any input value. This aligns with the PR objective of removing legacy workflow APIs and transitional code, and simplifies the project creation process.

src/components/project/workflow/project-workflow.service.ts (1)

16-16: Appropriate removal of unused import.

The ProjectStep type import has been removed as it's no longer needed in this service. This is consistent with the PR's goal of removing legacy workflow APIs.

According to the AI summary, the deprecated method executeTransitionLegacy was also removed from this file, which further contributes to cleaning up the legacy workflow transition code.

src/components/project/workflow/transitions/dynamic-step.ts (1)

18-22: Simplified resolve implementation.

The method has been streamlined to remove the legacy migration-specific logic. Now it follows a clearer control flow:

  1. Query the repository for the most recent matching step
  2. Fall back to the first step in the provided array if nothing found
  3. Default to ProjectStep.EarlyConversations as the final fallback

This simplification aligns with the removal of transitional code across the project workflow system.

src/components/project/project.service.ts (4)

26-26: Imports cleaned up and simplified

The import statement has been simplified to focus on the necessary dependencies, which aligns with the PR's objective of removing legacy code and unused elements.


284-284: Successfully removed legacy step extraction

The destructuring of step from this.repo.getActualChanges() result has been removed, which aligns with eliminating the deprecated workflow transition logic.


288-288: Simplified empty changes check

The conditional check for empty changes has been simplified to only check Object.keys(changes).length instead of also checking for changedStep. This is a cleaner approach after removing the step-related workflow logic.


325-325: Streamlined update process

The update logic has been simplified by directly assigning the result of this.repo.update() to a constant, removing the previous workflow transition execution step. This makes the code more maintainable and removes the legacy workflow transition handling.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@CarsonF CarsonF force-pushed the drop-old-project-step-mutation branch from 2c50e17 to c89326a Compare May 9, 2025 14:58
@CarsonF
Copy link
Member Author

CarsonF commented May 9, 2025

@bryanjnelson thoughts here? We aren't using this in UI, DOMO, or multiplication sync? :shipit: ?

@CarsonF CarsonF requested a review from bryanjnelson May 9, 2025 15:22
@bryanjnelson
Copy link
Contributor

@bryanjnelson thoughts here? We aren't using this in UI, DOMO, or multiplication sync? :shipit: ?

Originally we said we thought we were still going to be using this path from the multiplication sync. I guess we landed on not doing that? 🤔

@CarsonF
Copy link
Member Author

CarsonF commented May 9, 2025

Originally we said we thought we were still going to be using this path from the multiplication sync. I guess we landed on not doing that? 🤔

Right we aren't doing that. We decided to the proper thing there and look at the available transitions.

Copy link
Contributor

@bryanjnelson bryanjnelson left a comment

Choose a reason for hiding this comment

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

Out with the old! :shipit:

@CarsonF CarsonF merged commit 1bd9d1c into develop May 9, 2025
17 of 18 checks passed
@CarsonF CarsonF deleted the drop-old-project-step-mutation branch May 9, 2025 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💥 Breaking Change Introduces changes that are not backward compatible and may require modifications in other systems
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants