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

fix: Avoid a copy of sync.Mutex in Repository #603

Merged
merged 2 commits into from
Sep 26, 2023

Conversation

ktarplee
Copy link
Contributor

Closes #600

@codecov-commenter
Copy link

codecov-commenter commented Sep 19, 2023

Codecov Report

Merging #603 (9d1be18) into main (cb8c8bc) will increase coverage by 0.02%.
The diff coverage is 100.00%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@            Coverage Diff             @@
##             main     #603      +/-   ##
==========================================
+ Coverage   74.64%   74.67%   +0.02%     
==========================================
  Files          59       59              
  Lines        5266     5271       +5     
==========================================
+ Hits         3931     3936       +5     
  Misses        983      983              
  Partials      352      352              
Files Coverage Δ
registry/remote/repository.go 71.19% <100.00%> (+0.13%) ⬆️

Copy link
Member

@TerryHowe TerryHowe left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link
Member

@Wwwsylvia Wwwsylvia left a comment

Choose a reason for hiding this comment

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

nit: Can we follow the conventional commits to update the PR title?

registry/remote/repository.go Show resolved Hide resolved
registry/remote/repository.go Show resolved Hide resolved
@ktarplee ktarplee changed the title Avoid a copy of sync.Mutex in Repository fix: Avoid a copy of sync.Mutex in Repository Sep 20, 2023
Copy link
Member

@Wwwsylvia Wwwsylvia left a comment

Choose a reason for hiding this comment

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

LGTM

@Wwwsylvia
Copy link
Member

@ktarplee Can we rebase this PR?

registry/remote/repository_test.go Outdated Show resolved Hide resolved
registry/remote/repository_test.go Show resolved Hide resolved
@ktarplee
Copy link
Contributor Author

@ktarplee Can we rebase this PR?

Done

@Wwwsylvia
Copy link
Member

Wwwsylvia commented Sep 25, 2023

This needs to be rebased again before we can merge it.

sibling() was copying the entire Respoitory struct which contains a
sync.Mutex.  Added a clone() to consolidate the code that performs a
limited copy.

fix: added HandleWarning to clone()

Signed-off-by: Kyle M. Tarplee <[email protected]>
Signed-off-by: Kyle M. Tarplee <[email protected]>
@ktarplee
Copy link
Contributor Author

ktarplee commented Sep 25, 2023

This needs to be rebased again before we can merge it.

I rebased it again. Why do you guys care so much about linear Git history? It seems like an unnecessary obstacle to development efficiency and an issue with scaling to more developers. @Wwwsylvia

@Wwwsylvia
Copy link
Member

This needs to be rebased again before we can merge it.

I rebased it again. Why do you guys care so much about linear Git history? It seems like an unnecessary obstacle to development efficiency and an issue with scaling to more developers. @Wwwsylvia

@ktarplee Sorry for the inconvenience. Currently this repository is configured to allow squash merge only for a clearer Git history. @shizhMSFT may comment more on this.

Copy link
Member

@Wwwsylvia Wwwsylvia left a comment

Choose a reason for hiding this comment

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

LGTM

@Wwwsylvia Wwwsylvia merged commit e5cabfa into oras-project:main Sep 26, 2023
7 checks passed
@shizhMSFT
Copy link
Contributor

Conventional commits are also applied to this repository. However, it is too hard to enforce it for all contributors, especially beginners. Therefore, we choose "squash merge" as a workaround.

@ktarplee
Copy link
Contributor Author

I'm glad to contribute. I hope to have more to contribute in the future.

Wwwsylvia pushed a commit to Wwwsylvia/oras-go that referenced this pull request Oct 19, 2023
shizhMSFT pushed a commit that referenced this pull request Oct 20, 2023
@Wwwsylvia Wwwsylvia mentioned this pull request Oct 20, 2023
4 tasks
@Wwwsylvia Wwwsylvia mentioned this pull request Jan 26, 2024
4 tasks
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.

sibling() is copying a sync.Mutex
5 participants