Skip to content
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

feat(server): Projects Recycle bin #1169

Merged
merged 8 commits into from
Oct 10, 2024
Merged

feat(server): Projects Recycle bin #1169

merged 8 commits into from
Oct 10, 2024

Conversation

hexaforce
Copy link
Contributor

@hexaforce hexaforce commented Oct 3, 2024

Overview

Add deleted flag to project

What I've done

  1. Deletion flag added to Project.

  2. To update the delete flag, please use the UpdateProject mutation.
    Please note that the existing deleteProject mutation physically deletes the project from the database, so caution is required.

  3. I have added DeletedProjects to the GraphQL query.
    This retrieves all entries where the delete flag is set to true.

  4. I have removed the includeArchived flag from the GetProjects GraphQL query.
    While the frontend currently does not make queries using includeArchived, the backend will no longer support it.

What I haven't done

How I tested

Testing with Test Code

Which point I want you to review particularly

Please remove includeArchived from the web code.
The update for the delete flag will be similar to the usage of ARCHIVE_PROJECT.
DeletedProjects will be used similarly to StarredProjects.

Memo

https://www.notion.so/eukarya/BE-Projects-Recycle-bin-82ca047f781740febd354db58aa2acea

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced functionality to manage project deletion status, including the ability to mark projects as deleted and retrieve deleted projects.
    • Added a new query for fetching deleted projects by team ID.
    • Enhanced project management capabilities with updated GraphQL schema and API.
    • New focused testing approach with the addition of a failcheck target for unit tests.
  • Bug Fixes

    • Improved error handling and transaction management during project deletion.
  • Tests

    • Expanded test coverage for project creation and import functionalities to include new deletion attributes.

These updates enhance user experience by providing better project management tools and ensuring data integrity.

Copy link

coderabbitai bot commented Oct 3, 2024

Walkthrough

The pull request introduces updates to enhance project management functionality within the server codebase. Key changes include the addition of a failcheck target in the Makefile for running unit tests, enhancements to the GraphQL schema for managing project deletion status, and the implementation of new methods to retrieve deleted projects across various components. Modifications to the go.mod file reflect changes in dependency management, specifically the addition of the github.com/oklog/ulid dependency.

Changes

File Path Change Summary
server/Makefile Added failcheck target for unit tests with -failfast and -p 1 options.
server/e2e/gql_project_test.go Introduced TestDeleteProjects to test project deletions via GraphQL mutations.
server/go.mod Added github.com/oklog/ulid v1.3.1 dependency; removed it from indirect requirements.
server/gql/project.graphql Added isDeleted field to Project, updated UpdateProjectInput, and added deletedProjects query.
server/internal/adapter/gql/generated.go Added IsDeleted and DeletedProjects methods in ComplexityRoot; updated Projects method.
server/internal/adapter/gql/loader_project.go Added FindDeletedByWorkspace method to ProjectLoader.
server/internal/adapter/gql/resolver_mutation_project.go Updated UpdateProject method to handle new Deleted parameter.
server/internal/adapter/gql/resolver_query.go Updated Projects method to remove includeArchived parameter; added DeletedProjects method.
server/internal/infrastructure/memory/project.go Added FindDeletedByWorkspace method to retrieve deleted projects.
server/internal/infrastructure/mongo/mongodoc/project.go Added Deleted field to ProjectDocument and updated related methods.
server/internal/infrastructure/mongo/project.go Added FindDeletedByWorkspace method for MongoDB to fetch deleted projects.
server/internal/usecase/interactor/project.go Added FindDeletedByWorkspace method; updated Update method to handle Deleted parameter.
server/internal/usecase/interactor/project_test.go Updated tests to include CoreSupport and isDeleted fields.
server/internal/usecase/interfaces/project.go Added Deleted field to UpdateProjectParam and FindDeletedByWorkspace method to Project interface.
server/internal/usecase/repo/project.go Added FindDeletedByWorkspace method to the Project interface.
server/pkg/project/project.go Added isDeleted field to Project struct with getter and setter methods.

Possibly related PRs

Suggested reviewers

  • mkumbobeaty
  • pyshx
  • airslice

Poem

🐇 In the garden where projects grow,
A new path for deletions now flows.
With tests that run fast, and fields anew,
We track what's gone, and what's left to pursue.
Hopping along, our code's in bloom,
In the world of projects, there's always room! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.

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 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.

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.

Copy link

netlify bot commented Oct 3, 2024

Deploy Preview for reearth-web canceled.

Name Link
🔨 Latest commit c556940
🔍 Latest deploy log https://app.netlify.com/sites/reearth-web/deploys/670770377cbac70008c798d1

@github-actions github-actions bot added the web label Oct 3, 2024
@hexaforce hexaforce changed the title add delete api feat(server): Projects Recycle bin Oct 4, 2024
@hexaforce hexaforce marked this pull request as ready for review October 4, 2024 00:59
@github-actions github-actions bot requested a review from m-abe-dev October 4, 2024 00:59
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 8

🧹 Outside diff range and nitpick comments (26)
server/Makefile (1)

23-25: LGTM! Consider enhancing the comment for clarity.

The new failcheck target is a valuable addition to the Makefile. It provides a way to run tests with fail-fast and single-threaded execution, which is useful for quickly identifying and isolating test failures.

Consider updating the comment to be more descriptive:

-# make failcheck TEST_DIR=./internal/usecase/interactor
+# Example usage: make failcheck TEST_DIR=./internal/usecase/interactor
+# This runs tests in the specified directory with fail-fast and no parallel execution.

This change would provide more context about the target's purpose and usage.

server/internal/usecase/repo/project.go (3)

26-26: LGTM! Consider adding documentation.

The new FindDeletedByWorkspace method is a good addition that aligns with the PR objectives of introducing a deleted flag to the project management system. The method signature is consistent with other methods in the interface.

Consider adding a comment to document the purpose and behavior of this method, especially regarding the deleted flag. For example:

// FindDeletedByWorkspace retrieves all projects marked as deleted for the given workspace.
// It returns a slice of deleted projects and an error if the operation fails.
FindDeletedByWorkspace(context.Context, accountdomain.WorkspaceID) ([]*project.Project, error)

Line range hint 1-71: Summary and Next Steps

The changes in this file successfully introduce the FindDeletedByWorkspace method to the Project interface, aligning with the PR objectives of implementing a projects recycle bin feature. The existing code, including the IterateProjectsByWorkspace function, remains compatible with this new addition.

Next steps:

  1. Implement the FindDeletedByWorkspace method in the concrete types that implement the Project interface.
  2. Update the GraphQL schema and resolvers to utilize the new method for the DeletedProjects query mentioned in the PR objectives.
  3. Consider adding a new IterateDeletedProjectsByWorkspace function if needed.
  4. Ensure that all references to includeArchived have been properly removed or updated throughout the codebase.
  5. Add appropriate unit tests for the new functionality.

Verification of includeArchived Removal Revealed Remaining Implementations

The includeArchived flag is still present in several Go files, indicating incomplete removal:

  • server/internal/adapter/gql/resolver_team.go
  • server/internal/adapter/gql/generated.go
🔗 Analysis chain

Line range hint 33-71: Consider additional improvements and verifications.

While the IterateProjectsByWorkspace function remains unchanged, the introduction of the deleted flag and the removal of the includeArchived flag (as mentioned in the PR objectives) might require some adjustments:

  1. Consider adding a new function IterateDeletedProjectsByWorkspace to handle iteration over deleted projects, similar to IterateProjectsByWorkspace.

  2. Verify that the removal of the includeArchived flag from the GetProjects GraphQL query doesn't break any existing functionality.

To verify the impact of removing the includeArchived flag, you can run the following script:

This script will help ensure that all references to includeArchived have been properly removed or updated.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining usage of 'includeArchived' in GraphQL queries

# Test: Search for 'includeArchived' in GraphQL files
rg --type graphql 'includeArchived'

# Test: Search for 'includeArchived' in Go files (in case it's used in resolvers)
rg --type go 'includeArchived'

Length of output: 1684

server/internal/usecase/interfaces/project.go (3)

49-49: LGTM! Consider adding a comment for clarity.

The addition of the Deleted *bool field to the UpdateProjectParam struct aligns well with the PR objective of introducing a deletion flag for projects. The use of a pointer to a boolean is consistent with other similar fields in the struct.

Consider adding a brief comment to explain the purpose of this field, for example:

Deleted           *bool // Indicates whether the project is marked as deleted (true) or not (false)

67-67: LGTM! Consider adding pagination for consistency.

The addition of the FindDeletedByWorkspace method to the Project interface aligns well with the PR objective of introducing a new query to retrieve deleted projects. The method signature is consistent with other similar methods in the interface.

For consistency with the FindByWorkspace method, consider adding pagination support:

FindDeletedByWorkspace(context.Context, accountdomain.WorkspaceID, *usecasex.Pagination, *usecase.Operator) ([]*project.Project, *usecasex.PageInfo, error)

This would allow for more efficient querying of large numbers of deleted projects.


Remove or Deprecate the Archived Field

The Archived field is still actively used in several parts of the codebase, including:

  • server/internal/infrastructure/mongo/mongodoc/project.go
  • server/internal/adapter/gql/resolver_mutation_project.go
  • server/internal/adapter/gql/gqlmodel/convert_project.go
  • server/internal/adapter/gql/generated.go

Given the removal of the includeArchived flag from the GetProjects GraphQL query, it's recommended to deprecate or remove the Archived field to maintain consistency and avoid potential conflicts or confusion.

🔗 Analysis chain

Line range hint 1-85: Clarify the relationship between "deleted" and "archived" states

With the introduction of the "deleted" state, it's important to clarify its relationship with the existing "archived" state. Additionally, the PR objectives mention removing the includeArchived flag from the GetProjects GraphQL query, but the Archived field is still present in the UpdateProjectParam struct.

Please clarify the following points:

  1. How do the "deleted" and "archived" states interact? Are they mutually exclusive, or can a project be both archived and deleted?
  2. Is the Archived field still in use, given the removal of includeArchived from the GraphQL query? If not, should it be deprecated or removed?
  3. Are there any plans to update other methods in the Project interface to handle the new "deleted" state?

To help verify the usage of the Archived field, you can run the following script:

This will help determine if the Archived field is still being used in non-test code.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for usages of the Archived field in the codebase
rg --type go 'Archived\s*:' -g '!*_test.go'

Length of output: 636

server/internal/infrastructure/mongo/mongodoc/project.go (2)

Line range hint 84-134: Add Deleted field to Model method

The Model method is not currently including the Deleted status when constructing the project.Project instance. This omission could lead to data loss or inconsistencies when converting between ProjectDocument and Project.

Please update the Model method to include the Deleted status. Add the following line to the project.New() chain, just before the Build() call:

 		Starred(d.Starred).
+		IsDeleted(d.Deleted).
 		Build()

This change ensures that the deletion status is preserved when converting from ProjectDocument to Project.


includeArchived flag still present in multiple files

The includeArchived flag was intended to be removed from the GetProjects GraphQL query. However, references to includeArchived were found in the following files:

  • web/src/services/gql/__gen__/graphql.ts
  • server/gql/workspace.graphql
  • server/internal/adapter/gql/resolver_team.go
  • server/internal/adapter/gql/generated.go

Please ensure that all instances of includeArchived are removed or updated accordingly to maintain consistency with the PR objectives.

🔗 Analysis chain

Line range hint 1-134: Verify removal of includeArchived flag

The PR objectives mention removing the includeArchived flag from the GetProjects GraphQL query. However, this change is not reflected in the current file. To ensure consistency across the codebase:

Please run the following script to check for any remaining references to includeArchived:

If any results are found, please ensure that these references are updated or removed as necessary to maintain consistency with the removal of the includeArchived flag.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for references to 'includeArchived' in the codebase

# Test: Search for 'includeArchived' in all files
rg --type-add 'code:*.{go,graphql,js,ts,jsx,tsx}' --type code 'includeArchived'

Length of output: 1906

server/internal/adapter/gql/loader_project.go (1)

104-124: LGTM! Consider a minor optimization for clarity.

The implementation of FindDeletedByWorkspace looks good and aligns well with the PR objectives. It follows a consistent pattern with the existing FindStarredByWorkspace method, which is great for maintainability.

For improved clarity and consistency with other methods in this file (e.g., FindByWorkspace), consider using named return values and separating the edge creation. Here's a suggested refactor:

-func (c *ProjectLoader) FindDeletedByWorkspace(ctx context.Context, wsID gqlmodel.ID) (*gqlmodel.ProjectConnection, error) {
+func (c *ProjectLoader) FindDeletedByWorkspace(ctx context.Context, wsID gqlmodel.ID) (connection *gqlmodel.ProjectConnection, err error) {
 	tid, err := gqlmodel.ToID[accountdomain.Workspace](wsID)
 	if err != nil {
 		return nil, err
 	}

 	res, err := c.usecase.FindDeletedByWorkspace(ctx, tid, getOperator(ctx))
 	if err != nil {
 		return nil, err
 	}

 	nodes := make([]*gqlmodel.Project, 0, len(res))
+	edges := make([]*gqlmodel.ProjectEdge, 0, len(res))
 	for _, p := range res {
-		nodes = append(nodes, gqlmodel.ToProject(p))
+		prj := gqlmodel.ToProject(p)
+		nodes = append(nodes, prj)
+		edges = append(edges, &gqlmodel.ProjectEdge{
+			Node:   prj,
+			Cursor: usecasex.Cursor(prj.ID),
+		})
 	}

-	return &gqlmodel.ProjectConnection{
+	connection = &gqlmodel.ProjectConnection{
+		Edges:      edges,
 		Nodes:      nodes,
 		TotalCount: len(nodes),
-	}, nil
+	}
+	return
 }

This refactor improves consistency with other methods and provides more information in the returned ProjectConnection, which might be useful for pagination in the future.

server/pkg/project/project.go (1)

187-189: LGTM with a minor suggestion: Addition of SetDeleted() method

The SetDeleted() method has been correctly implemented as a setter for the isDeleted field. It follows Go conventions and maintains proper encapsulation.

For consistency with other setter methods in this file (e.g., SetArchived()), consider renaming this method to SetIsDeleted().

-func (p *Project) SetDeleted(isDeleted bool) {
+func (p *Project) SetIsDeleted(isDeleted bool) {
 	p.isDeleted = isDeleted
 }
server/internal/infrastructure/memory/project.go (1)

108-128: LGTM with minor suggestions.

The FindDeletedByWorkspace method is well-implemented and aligns with the PR objectives. It follows the existing code patterns and correctly handles thread safety and permission checks. Here are a few suggestions for improvement:

  1. Consider implementing pagination for large datasets.
  2. Add explicit error handling beyond the permission check.

Consider adding a comment to explain the method's purpose and behavior:

// FindDeletedByWorkspace retrieves all deleted projects for a given workspace.
// It returns the projects sorted by their update time in descending order.
// This method is thread-safe and respects workspace read permissions.
func (r *Project) FindDeletedByWorkspace(ctx context.Context, id accountdomain.WorkspaceID) ([]*project.Project, error) {
    // ... (existing implementation)
}
server/internal/infrastructure/mongo/project.go (1)

112-123: LGTM! Consider adding a comment for consistency.

The implementation of FindDeletedByWorkspace looks good and aligns well with the PR objectives. It follows the same pattern as FindStarredByWorkspace and correctly handles access control and query construction.

For consistency with other methods in the file, consider adding a brief comment describing the method's purpose:

// FindDeletedByWorkspace retrieves all deleted projects for the given workspace
func (r *Project) FindDeletedByWorkspace(ctx context.Context, id accountdomain.WorkspaceID) ([]*project.Project, error) {
    // ... (existing implementation)
}
server/internal/usecase/interactor/project_test.go (3)

Line range hint 67-68: LGTM! Consider adding a test case for default CoreSupport value.

The changes to TestProject_Create function look good. The new CoreSupport field is correctly added to the CreateProjectParam structure and the expected project object. Both normal (CoreSupport: false) and experimental (CoreSupport: true) scenarios are covered.

Consider adding a test case where the CoreSupport field is not explicitly set in the CreateProjectParam. This would ensure that the default behavior is also tested.

Also applies to: 102-103, 114-115


221-221: LGTM! Consider adding test cases for deleted projects.

The addition of the isDeleted field to the expected project data structure in TestImportProject function is correct and aligns with the PR objectives. The default value of false for a newly imported project is appropriate.

To ensure comprehensive testing, consider adding the following test cases:

  1. Importing a project with isDeleted set to true in the input data.
  2. Verifying that the DeletedProjects query returns only projects with isDeleted set to true.
  3. Testing the behavior of the UpdateProject mutation when modifying the isDeleted flag.

These additional test cases would help ensure the robustness of the new deletion flag feature.


Line range hint 1-238: Overall changes align well with PR objectives.

The modifications to TestProject_Create and TestImportProject functions effectively incorporate the new CoreSupport and isDeleted fields, respectively. These changes are consistent with the PR objectives of introducing a deletion flag and enhancing the project management system.

To further strengthen the implementation:

  1. Ensure that the DeletedProjects query is thoroughly tested in a separate test function.
  2. Verify that the removal of the includeArchived flag from the GetProjects query is reflected in the relevant test cases.
  3. Consider adding integration tests that cover the interaction between the new deletion flag and other project operations (e.g., archiving, updating, etc.).

These steps will help maintain the robustness of the project management system as new features are introduced.

server/internal/adapter/gql/resolver_mutation_project.go (1)

Line range hint 117-129: Consider clarifying the permanent nature of DeleteProject.

Given the introduction of the soft-delete functionality with the new deleted flag, it might be beneficial to emphasize that the DeleteProject method performs a permanent deletion. Consider either:

  1. Renaming the method to PermanentlyDeleteProject for clarity, or
  2. Adding a comment above the method to highlight its permanent nature.

This change would help prevent accidental use of this method when a soft-delete is intended.

Example implementation:

+// PermanentlyDeleteProject removes the project from the database without possibility of recovery.
+// For soft-delete functionality, use UpdateProject with the deleted flag instead.
 func (r *mutationResolver) DeleteProject(ctx context.Context, input gqlmodel.DeleteProjectInput) (*gqlmodel.DeleteProjectPayload, error) {
     // ... (existing implementation)
 }
server/e2e/gql_project_test.go (2)

503-533: LGTM: Deleted projects query and verification

The implementation of the deleted projects query and the subsequent verification looks correct. It properly checks the total count of deleted projects and verifies the name of the deleted project.

A minor suggestion for improved readability:

Consider extracting the GraphQL query string into a separate constant at the top of the file. This would make the test more maintainable and easier to read. For example:

const deletedProjectsQuery = `
  query GetDeletedProjects($teamId: ID!) {
    deletedProjects(teamId: $teamId) {
      nodes {
        id
        name
        isDeleted
      }
      totalCount
    }
  }`

// Then in the test function:
requestBody = GraphQLRequest{
  OperationName: "GetDeletedProjects",
  Query:         deletedProjectsQuery,
  Variables: map[string]any{
    "teamId": wID,
  },
}

458-534: Suggestions for additional test coverage

The TestDeleteProjects function provides good coverage for the new deletion flag functionality. However, to fully align with the PR objectives, consider adding the following test cases:

  1. Verify that the GetProjects query no longer includes the includeArchived flag.
  2. Test that the deleteProject mutation still permanently removes a project from the database.

These additional tests will ensure that all aspects of the PR objectives are covered and that existing functionality remains intact.

Would you like assistance in drafting these additional test cases?

server/internal/usecase/interactor/project.go (3)

92-94: LGTM! Consider adding input validation.

The FindDeletedByWorkspace function is a good addition that aligns with the PR objectives. It correctly fetches deleted projects for a given workspace.

Consider adding input validation for the id parameter to ensure it's not empty before calling projectRepo.FindDeletedByWorkspace.


235-237: LGTM! Consider handling side effects of deletion.

The addition of the Deleted flag handling in the Update function is correct and aligns with the PR objectives.

Consider if there are any side effects of marking a project as deleted that should be handled here, such as:

  1. Notifying relevant users or systems
  2. Updating related entities (e.g., scenes, assets)
  3. Triggering any cleanup processes

If such side effects exist, it might be worth implementing them or adding a TODO comment for future implementation.


Removal of includeArchived Flag Incomplete

The includeArchived flag is still present in several files, including resolver_team.go and generated.go. This indicates that the flag has not been fully removed from the GetProjects GraphQL query as intended in the PR objectives.

🔗 Analysis chain

Line range hint 1-724: Verify removal of includeArchived flag

The changes implementing the deletion flag for projects look good. However, I couldn't find any changes related to removing the includeArchived flag from the GetProjects GraphQL query as mentioned in the PR objectives.

Please ensure that the includeArchived flag has been removed from the relevant GraphQL query definition, which is likely in a different file. You can use the following script to locate and verify the changes:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Locate GraphQL query definitions and check for includeArchived flag removal

# Search for GraphQL query definitions containing 'GetProjects'
echo "Searching for GetProjects GraphQL query definition:"
rg --type go "type.*GetProjects.*{" -A 10

# Search for occurrences of 'includeArchived' in Go files
echo "\nSearching for 'includeArchived' occurrences:"
rg --type go "includeArchived"

Length of output: 1986

server/internal/adapter/gql/gqlmodel/models_gen.go (2)

1177-1177: LGTM! Consider adding a comment for the new field.

The addition of the IsDeleted field is correct and aligns with the PR objectives. The field is properly typed and tagged.

Consider adding a comment to explain the purpose of this field, for example:

// IsDeleted indicates whether the project has been marked as deleted.
IsDeleted bool `json:"isDeleted"`

1873-1873: LGTM! Consider adding a comment for the new field.

The addition of the Deleted field in the UpdateProjectInput struct is correct and aligns with the PR objectives. The field is properly typed as *bool and tagged with omitempty.

Consider adding a comment to explain the purpose of this field, for example:

// Deleted, if set, updates the deletion status of the project.
Deleted *bool `json:"deleted,omitempty"`
server/internal/adapter/gql/generated.go (1)

Line range hint 62283-62288: Field Ordering in UpdateProjectInput Initialization

The field deleted is added to the UpdateProjectInput struct. Ensure that the fields are ordered logically, possibly placing deleted near other status-related fields like archived for better readability.

server/gql/project.graphql (1)

148-148: Improve grammar in the comment

The comment # not included deleted projects could be clearer. Consider revising it to # does not include deleted projects for better readability.

Apply this diff to correct the comment:

-): ProjectConnection! # not included deleted projects
+): ProjectConnection! # does not include deleted projects
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 6f6112a and d2676d8.

⛔ Files ignored due to path filters (1)
  • web/src/services/gql/__gen__/graphql.ts is excluded by !**/__gen__/**
📒 Files selected for processing (17)
  • server/Makefile (1 hunks)
  • server/e2e/gql_project_test.go (1 hunks)
  • server/go.mod (1 hunks)
  • server/gql/project.graphql (3 hunks)
  • server/internal/adapter/gql/generated.go (22 hunks)
  • server/internal/adapter/gql/gqlmodel/models_gen.go (2 hunks)
  • server/internal/adapter/gql/loader_project.go (1 hunks)
  • server/internal/adapter/gql/resolver_mutation_project.go (1 hunks)
  • server/internal/adapter/gql/resolver_query.go (2 hunks)
  • server/internal/infrastructure/memory/project.go (1 hunks)
  • server/internal/infrastructure/mongo/mongodoc/project.go (2 hunks)
  • server/internal/infrastructure/mongo/project.go (1 hunks)
  • server/internal/usecase/interactor/project.go (2 hunks)
  • server/internal/usecase/interactor/project_test.go (1 hunks)
  • server/internal/usecase/interfaces/project.go (2 hunks)
  • server/internal/usecase/repo/project.go (1 hunks)
  • server/pkg/project/project.go (3 hunks)
🔇 Additional comments (27)
server/internal/infrastructure/mongo/mongodoc/project.go (3)

38-38: LGTM: Addition of Deleted field

The new Deleted boolean field in the ProjectDocument struct aligns well with the PR objective of introducing a deletion flag to the project management system. The field type and name are appropriate for its purpose.


81-81: LGTM: Initialization of Deleted field in NewProject

The Deleted field is correctly initialized in the NewProject function using project.IsDeleted(). This approach is consistent with the initialization of other fields and leverages existing methods in the Project model.


Line range hint 1-134: Summary of review

The changes in this file generally align with the PR objectives of introducing a deletion flag to the project management system. However, there are a couple of points that need attention:

  1. The Model method needs to be updated to include the Deleted status when constructing the project.Project instance.
  2. The removal of the includeArchived flag needs to be verified across the codebase.

Please address these points to ensure consistency and completeness of the implementation.

server/internal/adapter/gql/loader_project.go (1)

Line range hint 1-125: Verify the removal of the includeArchived flag.

The PR objectives mention removing the includeArchived flag from the GetProjects GraphQL query. However, this change is not visible in the current file. To ensure all PR objectives are met, we need to verify this change.

Please run the following commands to check for the removal of the includeArchived flag:

#!/bin/bash
# Search for the GetProjects query definition
echo "Searching for GetProjects query definition:"
rg --type go 'type.*GetProjectsInput' server/internal/adapter/gql

# Search for any remaining usage of includeArchived
echo "Searching for any remaining usage of includeArchived:"
rg --type go 'includeArchived' server/internal/adapter/gql

This will help us confirm that the includeArchived flag has been removed from the GetProjects query and that there are no remaining usages of this flag in the GraphQL layer.

server/pkg/project/project.go (2)

41-41: LGTM: Addition of isDeleted field

The isDeleted boolean field has been correctly added to the Project struct. This addition aligns with the PR objectives and follows Go conventions for struct field placement.


145-147: LGTM: Addition of IsDeleted() method

The IsDeleted() method has been correctly implemented as a getter for the isDeleted field. It follows Go conventions and maintains proper encapsulation.

server/internal/infrastructure/mongo/project.go (1)

Line range hint 1-123: Verify implementation of deleted flag and permanent deletion

While the new FindDeletedByWorkspace method correctly uses the deleted flag, I couldn't find where this flag is set or how permanent deletion is handled. To ensure complete implementation of the PR objectives:

  1. Verify that there's a method to set the deleted flag (e.g., in the Save method or a new MarkAsDeleted method).
  2. Confirm that the Remove method performs permanent deletion, as mentioned in the PR objectives for the deleteProject mutation.

To check for the implementation of setting the deleted flag and permanent deletion, run the following script:

Please review the results to ensure that the deleted flag can be set and that permanent deletion is handled correctly.

server/internal/adapter/gql/resolver_mutation_project.go (1)

82-82: LGTM! Verify removal of includeArchived.

The addition of the Deleted parameter to the UpdateProjectParam struct aligns with the PR objectives of introducing a deletion flag. This change looks good and maintains the existing functionality of the UpdateProject method.

However, the PR objectives also mention the removal of the includeArchived flag from the GetProjects GraphQL query. While this change is not visible in this file, it's important to ensure that it has been implemented correctly elsewhere in the codebase.

To verify the removal of includeArchived, please run the following script:

This script will help confirm that includeArchived has been removed from the relevant parts of the codebase.

server/internal/adapter/gql/resolver_query.go (2)

263-265: LGTM: New DeletedProjects method added, but consider access control and testing.

The addition of the DeletedProjects method aligns well with the PR objectives to introduce a "recycle bin" feature for projects. The implementation looks correct and consistent with other similar methods in the file.

However, please consider the following suggestions:

  1. Ensure proper access control checks are in place to prevent unauthorized access to deleted projects. You might want to verify if the user has the necessary permissions to view deleted projects for the given team.

  2. Add unit tests for this new functionality to ensure it behaves as expected under various scenarios (e.g., when there are no deleted projects, when there are multiple deleted projects, etc.).

To verify the access control implementation, you can run the following command to check for any existing access control patterns in the codebase:

If this command returns results, consider implementing similar access control checks in the DeletedProjects method.

Would you like assistance in generating unit tests for the DeletedProjects functionality?


239-241: LGTM: Simplified method signature, but verify impact.

The removal of the includeArchived parameter from the Projects method aligns with the PR objectives and simplifies the method signature. This is a good change.

However, please ensure the following:

  1. Verify that this change doesn't break existing API consumers who might be passing the includeArchived parameter.
  2. Update any relevant API documentation to reflect this change.
  3. Consider adding a deprecation notice in the GraphQL schema if this is a breaking change, to give API consumers time to adapt.

To verify the impact of this change, you can run the following command to check for any remaining usage of includeArchived in GraphQL queries:

If this command returns any results, those areas of the codebase will need to be updated.

✅ Verification successful

Verification Successful: No Usage of includeArchived Found

The search for includeArchived in GraphQL queries returned no results. This indicates that removing the includeArchived parameter from the Projects method does not impact existing API consumers.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for GraphQL queries using includeArchived
rg --type typescript --type javascript 'query.*Projects.*includeArchived' 

Length of output: 110


Script:

#!/bin/bash
# Search for GraphQL queries using includeArchived in TypeScript and JavaScript files
rg --type ts --type js 'query.*Projects.*includeArchived'

Length of output: 59

server/go.mod (1)

26-26: LGTM: Addition of ULID library as a direct dependency.

The addition of github.com/oklog/ulid v1.3.1 as a direct dependency is appropriate. This library provides functionality for generating and working with ULIDs (Universally Unique Lexicographically Sortable Identifiers), which can be useful for creating unique, sortable identifiers for projects or other entities in the system.

To ensure this dependency is being used correctly, please run the following script to check its usage in the codebase:

✅ Verification successful

**** The ULID library github.com/oklog/ulid v1.3.1 is actively used in the codebase, confirming that its addition as a direct dependency is appropriate and necessary.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the newly added ULID library in the codebase.

# Test: Search for import statements and function calls using the ULID library
echo "Searching for ULID library usage:"
rg --type go 'github.com/oklog/ulid' -A 5

Length of output: 759


Script:

#!/bin/bash
# Description: Check for ULID function calls and variable usages in resolver_mutation_project.go

echo "Searching for ULID function calls and variable usages in resolver_mutation_project.go:"
rg --type go 'ulid\.' server/internal/adapter/gql/resolver_mutation_project.go

Length of output: 391

server/e2e/gql_project_test.go (2)

458-469: LGTM: Test setup looks good

The test setup is well-structured. It initializes the server with appropriate configurations and creates three test projects. This provides a good foundation for testing the deletion functionality.


471-501: Verify the deleted field in the mutation response

The mutation to mark a project as deleted is correctly implemented. However, the response structure in the GraphQL query doesn't include the deleted field. Instead, it uses isDeleted.

To ensure consistency, please run the following script to check if isDeleted is the correct field name used in the Project type:

If the script confirms that isDeleted is the correct field name, update the mutation query to include this field in the response:

 Query: `mutation UpdateProject($input: UpdateProjectInput!) {
   updateProject(input: $input) {
     project {
       id
       name
-      isDeleted
+      deleted
       updatedAt
       __typename
     }
     __typename
   }
 }`,
server/internal/adapter/gql/gqlmodel/models_gen.go (1)

Line range hint 1-2453: Overall, the changes implement the deletion flag as intended.

The additions to the Project and UpdateProjectInput structs correctly implement the new "deleted" flag functionality as described in the PR objectives. These changes allow for marking projects as deleted and updating their deletion status.

To ensure these changes are properly utilized, let's check for any usage of these new fields:

server/internal/adapter/gql/generated.go (12)

846-846: Addition of IsDeleted Complexity Function Looks Good

The IsDeleted field is correctly added to handle complexity calculations for the isDeleted field in the Project type.


6586-6597: Correct Complexity Handling for DeletedProjects Query

The complexity calculation for the DeletedProjects query is implemented. Confirm that it correctly accounts for childComplexity and any arguments to ensure accurate complexity estimation.


9601-9601: Inclusion of deleted Field in UpdateProjectInput

The input field deleted: Boolean is added to UpdateProjectInput. This allows clients to update the deletion status of a project. Ensure that the server-side update logic correctly handles this new field.


12642-12656: Arguments Parsing for DeletedProjects Query

The argument parser field_Query_deletedProjects_args correctly processes the teamId argument. Ensure that this method aligns with the expected GraphQL arguments to prevent issues during query execution.


39878-39921: Resolver for Project.isDeleted Field Implemented

The resolver function _Project_isDeleted is correctly implemented to return the IsDeleted field of a Project object. This ensures that the isDeleted field is accessible in GraphQL queries.


71187-71191: Handling of isDeleted in Field Marshal Function

The isDeleted case is added to the field marshal function to correctly serialize the isDeleted field when returning Project objects. Verify that this serialization works as expected and that the field is correctly included in the GraphQL response.


73089-73110: Concurrency Handling for deletedProjects Field

In the resolver map, the deletedProjects field is correctly set up to handle concurrent execution. Ensure that this aligns with how other fields are handled and that there are no race conditions or data inconsistencies.


9665-9668: deletedProjects Query Added; includeArchived Flag Removed

The deletedProjects query is introduced, and the includeArchived flag is removed from the projects query. Verify that clients are updated to use deletedProjects where necessary and that the removal of includeArchived doesn't affect existing functionality.

Run this script to identify client-side usages:

#!/bin/bash
# Description: Find usages of 'includeArchived' in client code.

rg --type js,ts 'includeArchived' web/

6675-6675: Removal of includeArchived from Projects Complexity Function

The complexity function for Projects has been updated to remove the includeArchived argument. Verify that this change is consistent throughout the complexity calculations and that no residual references remain.

Use the following script to check for any remaining references:

#!/bin/bash
# Description: Search for any remaining 'includeArchived' references.

rg --type go 'includeArchived' server/

5755-5761: Verify Complexity Function for Project.isDeleted

The complexity calculation for Project.isDeleted is added. Ensure that the function e.complexity.Project.IsDeleted is properly defined and returns the expected complexity value.

Check the definition of the complexity function:

#!/bin/bash
# Description: Verify definition of IsDeleted complexity function.

rg --type go 'IsDeleted\s*func' server/internal/adapter/gql/generated.go

12762-12788: Removal of includeArchived in Projects Arguments Parsing

The includeArchived argument is removed from the Projects query arguments parsing. Confirm that this change is consistently applied and that no residual code attempts to access includeArchived.

Run the following script:

#!/bin/bash
# Description: Ensure 'includeArchived' is not used in argument parsing.

rg --type go 'includeArchived' server/internal/adapter/gql/

1013-1020: Ensure Proper Complexity Calculation for New Queries

The addition of the DeletedProjects complexity function and the updated Projects function reflect the schema changes. Please verify that the complexity estimations for these functions are accurate to prevent performance issues.

Run the following script to check for any discrepancies in complexity calculations:

server/gql/project.graphql (1)

84-84: Approved: Addition of deleted field to UpdateProjectInput

The inclusion of the deleted field in UpdateProjectInput appropriately aligns with the new isDeleted flag, allowing for updates to a project's deletion status.

server/internal/adapter/gql/loader_project.go Show resolved Hide resolved
server/pkg/project/project.go Show resolved Hide resolved
server/internal/adapter/gql/generated.go Show resolved Hide resolved
server/internal/adapter/gql/generated.go Show resolved Hide resolved
server/gql/project.graphql Show resolved Hide resolved
server/gql/project.graphql Show resolved Hide resolved
Copy link
Contributor

@pyshx pyshx left a comment

Choose a reason for hiding this comment

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

Thanks, the implementation looks good to me.
Please fix the comments.

server/Makefile Outdated
@@ -20,6 +20,7 @@ lint:
test:
go test -race -short -v ./...

# make failcheck TEST_DIR=./internal/usecase/interactor
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove all of the unnecessary files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes

server/e2e/gql_project_test.go Show resolved Hide resolved
server/gql/project.graphql Show resolved Hide resolved
server/go.mod Outdated
@@ -23,6 +23,7 @@ require (
github.com/kennygrant/sanitize v1.2.4
github.com/labstack/echo/v4 v4.11.4
github.com/mitchellh/mapstructure v1.5.0
github.com/oklog/ulid v1.3.1
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this direct dependency now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I'll put it back.
For some reason, in my environment, it happens when I run make gql.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (3)
server/e2e/gql_project_test.go (3)

456-531: LGTM! Consider expanding test coverage.

The TestDeleteProjects function effectively tests the basic functionality of marking a project as deleted and retrieving deleted projects. This aligns well with the PR objectives.

To further improve the test coverage, consider adding the following scenarios:

  1. Verify that non-deleted projects are not returned in the deletedProjects query.
  2. Test the ability to undelete a project (if supported).
  3. Ensure that deleted projects are not returned in the regular projects query.

Would you like me to provide example code for these additional test scenarios?


454-454: Remove unnecessary comment

This commented line appears to be a command for running the test. It's generally good practice to keep the code free of commented-out code or commands. Consider removing this line to maintain code cleanliness.

- //  go test -v -run TestDeleteProjects ./e2e/...

Removal of includeArchived Flag Incomplete

The includeArchived flag is still present in several .go files, specifically in server/internal/adapter/gql/resolver_team.go and server/internal/adapter/gql/generated.go. Please ensure that the flag is fully removed from all relevant parts of the codebase to meet the PR objectives.

🔗 Analysis chain

Line range hint 1-531: Verify removal of includeArchived flag

The PR objectives mention removing the includeArchived flag from the GetProjects GraphQL query. However, this change is not visible in the current file. Please ensure that this removal has been implemented in the appropriate files.

To confirm the removal of the includeArchived flag, you can run the following script:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for the presence of 'includeArchived' in GraphQL queries and schema

# Search for 'includeArchived' in .graphql files
echo "Searching for 'includeArchived' in .graphql files:"
rg --type graphql 'includeArchived'

# Search for 'includeArchived' in Go files
echo "Searching for 'includeArchived' in Go files:"
rg --type go 'includeArchived'

# If 'includeArchived' is not found, it has likely been removed as intended

Length of output: 1906

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between d2676d8 and dae58a0.

📒 Files selected for processing (1)
  • server/e2e/gql_project_test.go (1 hunks)

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between dae58a0 and d6312e8.

📒 Files selected for processing (1)
  • server/internal/adapter/gql/generated.go (22 hunks)
🔇 Additional comments (18)
server/internal/adapter/gql/generated.go (18)

846-846: LGTM: Addition of IsDeleted complexity calculation

The IsDeleted field has been correctly added to the ComplexityRoot type for the Project object. This addition aligns with the PR objective of introducing a deleted flag to the project management system.


1013-1013: LGTM: Addition of DeletedProjects complexity calculation

The DeletedProjects field has been correctly added to the ComplexityRoot type for the Query object. This addition aligns with the PR objective of introducing a new GraphQL query for retrieving deleted projects.


5755-5761: LGTM: Added complexity calculation for Project.isDeleted

The complexity calculation for the Project.isDeleted field has been correctly implemented. It follows the same pattern as other fields in the Project type and aligns with the PR objective of introducing a deleted flag to the project management system.


6586-6597: LGTM: Added complexity calculation for Query.deletedProjects

The complexity calculation for the Query.deletedProjects field has been correctly implemented. It follows the same pattern as other query fields and aligns with the PR objective of introducing a new GraphQL query for retrieving deleted projects.


6675-6675: LGTM: Updated complexity calculation for Query.projects

The complexity calculation for the Query.projects field has been correctly updated to remove the includeArchived parameter. This change aligns with the PR objective of removing the includeArchived flag from the GetProjects GraphQL query.


9601-9601: LGTM: Added deleted field to UpdateProjectInput type

The deleted: Boolean field has been correctly added to the UpdateProjectInput type. This addition aligns with the PR objective of allowing users to modify the deletion flag using the UpdateProject mutation. The nullable nature of the field (Boolean instead of Boolean!) allows for partial updates without necessarily changing the deletion status.


9668-9668: LGTM: Added deletedProjects query to Query type

The deletedProjects(teamId: ID!): ProjectConnection! query has been correctly added to the Query type. This addition aligns with the PR objective of introducing a new GraphQL query for retrieving deleted projects. The query structure is appropriate, taking a teamId parameter and returning a ProjectConnection for paginated results.


12642-12656: LGTM: Added argument parsing for deletedProjects query

The argument parsing logic for the deletedProjects query has been correctly implemented. It follows the same pattern as other queries in the file and properly handles the teamId argument of type gqlmodel.ID.


12762-12788: LGTM: Updated argument parsing for projects query

The argument parsing for the projects query has been correctly updated to remove the includeArchived parameter. This change aligns with the PR objective of removing the includeArchived flag from the GetProjects GraphQL query. The parsing for the remaining arguments (pagination, keyword, and sort) has been properly maintained.


39878-39920: LGTM: Added _Project_isDeleted resolver

The _Project_isDeleted resolver has been correctly implemented for the isDeleted field of the Project type. It follows the same pattern as other field resolvers in the file and properly handles potential errors and null cases.


40149-40150: LGTM: Updated Project type field context functions

The isDeleted field has been correctly added to the field context functions for the Project type in multiple locations. These consistent additions ensure that the isDeleted field is properly handled in various GraphQL operations.

Also applies to: 40386-40387, 40484-40485


45237-45237: LGTM: Updated Projects query resolver

The Projects query resolver has been correctly updated to remove the includeArchived parameter. This change aligns with the PR objective of removing the includeArchived flag from the GetProjects GraphQL query. The resolver now uses the updated method signature correctly.


45414-45477: LGTM: Added DeletedProjects query resolver

The _Query_deletedProjects resolver has been correctly implemented for the deletedProjects query. It follows the same pattern as other query resolvers in the file, properly handles potential errors and null cases, and uses the appropriate method from the Query interface.


47875-47876: LGTM: Updated Project type field resolvers

The isDeleted field has been correctly added to the field resolvers for the Project type. This addition ensures that the isDeleted field is properly resolved in GraphQL operations and follows the same pattern as other field resolvers in the Project type.


62283-62283: LGTM: Updated UpdateProjectInput type

The deleted field has been correctly added to the UpdateProjectInput type:

  1. It has been included in the list of fields in order.
  2. The unmarshaling logic for the input type has been updated to handle the deleted field.

These changes align with the PR objective of allowing users to modify the deletion flag using the UpdateProject mutation. The unmarshaling logic correctly handles the nullable nature of the deleted field.

Also applies to: 62423-62429


71187-71191: LGTM: Updated Project type field selection

The isDeleted field has been correctly added to the field selection logic for the Project type. This addition ensures that the isDeleted field can be properly selected in GraphQL queries and follows the same pattern as other fields in the Project type.


73089-73110: LGTM: Added deletedProjects query to root resolver

The deletedProjects query has been correctly added to the root resolver logic. This addition ensures that the deletedProjects query can be executed at the root level of GraphQL operations and follows the same pattern as other root-level queries.


9544-9544: LGTM: Added isDeleted field to Project type

The isDeleted: Boolean! field has been correctly added to the Project type. This addition aligns with the PR objective of introducing a deleted flag to the project management system.

To ensure that the isDeleted field is properly implemented and populated, please run the following verification script:

This script will help us verify that the IsDeleted resolver is properly implemented for the Project type.

✅ Verification successful

Verified: isDeleted field implementation confirmed

The IsDeleted resolver for the Project type is properly implemented in the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for the implementation of the isDeleted field in the Project resolver

rg --type go 'func \(.*\) IsDeleted\(' server/

Length of output: 115

Comment on lines +1705 to +1708
Projects(ctx context.Context, teamID gqlmodel.ID, pagination *gqlmodel.Pagination, keyword *string, sort *gqlmodel.ProjectSort) (*gqlmodel.ProjectConnection, error)
CheckProjectAlias(ctx context.Context, alias string) (*gqlmodel.ProjectAliasAvailability, error)
StarredProjects(ctx context.Context, teamID gqlmodel.ID) (*gqlmodel.ProjectConnection, error)
DeletedProjects(ctx context.Context, teamID gqlmodel.ID) (*gqlmodel.ProjectConnection, error)
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Issue Found: includeArchived Still Present in GraphQL Schema

The includeArchived parameter is still found in the GraphQL schema:

  • server/gql/workspace.graphql:
    projects(includeArchived: Boolean, first: Int, last: Int, after: Cursor, before: Cursor): ProjectConnection!

Please remove or update this parameter to ensure consistency with the QueryResolver interface changes.

🔗 Analysis chain

LGTM: Updated Projects method and added DeletedProjects method

The changes to the QueryResolver interface are consistent with the PR objectives:

  1. The includeArchived parameter has been removed from the Projects method.
  2. A new DeletedProjects method has been added.

These changes align with the removal of the includeArchived flag and the introduction of a new query for retrieving deleted projects.

To ensure that the removal of includeArchived doesn't break existing functionality, please run the following verification script:

If this script returns any results, we should review those occurrences to ensure they are updated or removed as necessary.


Let's rerun the verification to accurately check for any remaining usage of includeArchived in GraphQL queries or mutations.


Let's update the verification script to correctly search for includeArchived in GraphQL files by specifying the appropriate file extensions.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining usage of 'includeArchived' in GraphQL queries or mutations

rg --type graphql 'includeArchived'

Length of output: 115


Script:

#!/bin/bash
# Description: Check for any remaining usage of 'includeArchived' in GraphQL queries or mutations

rg --type graphql 'includeArchived'

Length of output: 67


Script:

#!/bin/bash
# Description: Check for any remaining usage of 'includeArchived' in GraphQL queries or mutations

rg 'includeArchived' --glob '*.graphql' --glob '*.gql'

Length of output: 194

Copy link

codecov bot commented Oct 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 13.85%. Comparing base (e33d88e) to head (c556940).
Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1169   +/-   ##
=======================================
  Coverage   13.85%   13.85%           
=======================================
  Files         595      595           
  Lines       64056    64062    +6     
  Branches      660      660           
=======================================
+ Hits         8873     8877    +4     
- Misses      55183    55185    +2     
Flag Coverage Δ
web 13.85% <100.00%> (+<0.01%) ⬆️
web-beta 13.85% <100.00%> (+<0.01%) ⬆️
web-classic 13.85% <100.00%> (+<0.01%) ⬆️
web-utils 13.85% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
web/src/services/gql/__gen__/graphql.ts 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

@hexaforce hexaforce merged commit e1f1b0f into main Oct 10, 2024
17 checks passed
@hexaforce hexaforce deleted the feat/project-delete-api branch October 10, 2024 06:18
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.

4 participants