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

Refactor git descriptors #913

Open
wants to merge 40 commits into
base: master
Choose a base branch
from

Conversation

mathbou
Copy link

@mathbou mathbou commented Aug 23, 2023

Hi there,

I was looking at my temp folder while doing some tests with the tk-core, and I saw that each time I reload an engine, a massive amount of temporary clone folders were created (associated with a big network load). By digging into the source code of git descriptors, I found that they clone repos each and every time they needs to execute a command in it.

So here is a PR with a big refactoring of the git, git_tag and git_branch descriptors:

  • replace git clone with git ls-remote when fetching tags/commit values, checking remote access
  • Add version pattern and get_latest support for git branch, and improve the logic for git tag
  • Add caching system to avoid processing the same repo multiple times

Mathieu added 26 commits August 23, 2023 23:04
@mathbou mathbou marked this pull request as draft August 24, 2023 01:08
@codecov
Copy link

codecov bot commented Aug 27, 2023

Codecov Report

Merging #913 (168e364) into master (e2e2173) will decrease coverage by 5.94%.
The diff coverage is 90.90%.

@@            Coverage Diff             @@
##           master     #913      +/-   ##
==========================================
- Coverage   78.91%   72.98%   -5.94%     
==========================================
  Files         182      182              
  Lines       20083    20116      +33     
==========================================
- Hits        15849    14681    -1168     
- Misses       4234     5435    +1201     
Files Changed Coverage Δ
python/tank/descriptor/io_descriptor/git.py 89.62% <87.77%> (+3.45%) ⬆️
python/tank/descriptor/io_descriptor/git_tag.py 95.09% <93.47%> (+3.33%) ⬆️
python/tank/descriptor/io_descriptor/git_branch.py 91.04% <96.29%> (+7.96%) ⬆️
python/tank/util/filesystem.py 86.58% <100.00%> (+0.55%) ⬆️

... and 47 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@mathbou mathbou marked this pull request as ready for review August 27, 2023 14:36
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.

1 participant