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

[INTERNAL] Resource#clone: Omit project association #459

Merged
merged 1 commit into from
Dec 22, 2022

Conversation

RandomByte
Copy link
Member

@RandomByte RandomByte commented Dec 22, 2022

When cloning a Resource, the new Resource instance should not be associated with any project. This allows for use cases where a resource is copied from one project to another.

The problematic behavior was introduced with #448 and motivated by the need of the memory adapter to clone resources while keeping the project association.

However, since memory adapters are always assigned a project, they can easily just assign that project to the cloned resource. This has been implemented in this PR.

@coveralls
Copy link

coveralls commented Dec 22, 2022

Coverage Status

Coverage decreased (-0.05%) to 88.722% when pulling 1ac5c24 on resource-clone-remove-project-assoc into 28dcdd6 on main.

@RandomByte RandomByte requested review from flovogt and a team December 22, 2022 10:11
When cloning a Resource, the new Resource instance should not be
associated with any project. This allows for use cases where a resource
is copied from one project to another.

The problematic behavior was introduced with
#448 and motivated by the need of the
memory adapter to clone resources while keeping the project association.

However, since memory adapters are always assigned a project, they can
easily just assign that project to the cloned resource. This has been
implemented in this PR.
@RandomByte RandomByte force-pushed the resource-clone-remove-project-assoc branch from 957cdfb to 1ac5c24 Compare December 22, 2022 11:10
@RandomByte RandomByte merged commit 4927296 into main Dec 22, 2022
@RandomByte RandomByte deleted the resource-clone-remove-project-assoc branch December 22, 2022 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants