-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
fix(api): Project hard sync existing entities deleted #660
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
@@ -1117,7 +1146,12 @@ export class ProjectService { | |||
) | |||
} | |||
|
|||
return [...createEnvironmentOps, ...createSecretOps, ...createVariableOps] | |||
return [ | |||
...deleteOps, |
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.
I feel that this wont work. This is because, we are not actually deleting the variables, secrets or environments. So the subsequent block wont work.
We need to refactor the missingEnvironments
section aswell to make sure that we don't do that comparison when we are doing a hard sync. Hope it makes sense
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.
I`ve tested it and it does delete all existing items from forked project then copies everything from the parent.
To my understanding this is what hard sync is about.
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.
Yes your understanding is correct. I was talking about the next block where in we are checking for existing environments. In case we are hard syncing a project, we would be deleting the environments. So there shouldn't be any environments left to check for. So, it would be the best to use that block optionally.
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.
I guess i pinned this in the wrong place. It's line 974 that im talking about.
6ba3a34
to
c81558c
Compare
c81558c
to
0c917d5
Compare
## [2.11.0-stage.11](v2.11.0-stage.10...v2.11.0-stage.11) (2025-02-04) ### 🐛 Bug Fixes * **api:** Project hard sync existing entities deleted ([#660](#660)) ([3632217](3632217))
🎉 This PR is included in version 2.11.0-stage.11 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
User description
Description
When hard syncing all the existing items are deleted in the fork
Fixes #454
Screenshots of relevant screens
Developer's checklist
If changes are made in the code:
Documentation Update
PR Type
Bug fix, Documentation
Description
Fixed unique constraint error during project hard sync.
Added deletion of existing entities in target project for hard sync.
Updated CLI documentation for
--hard-sync
option.Changes walkthrough 📝
project.service.ts
Add deletion logic for hard sync in projects
apps/api/src/project/service/project.service.ts
deleteOps
array to handle deletion operations.project.md
Update CLI documentation for hard sync
docs/cli/project.md
--hard-sync
option.