Skip to content

[feat] Allow git sparse checkouts and passing arbitrary git options when cloning a repo from sourcesdir#3629

Merged
vkarak merged 8 commits intoreframe-hpc:developfrom
victorusu:sparse_checkout
Apr 24, 2026
Merged

[feat] Allow git sparse checkouts and passing arbitrary git options when cloning a repo from sourcesdir#3629
vkarak merged 8 commits intoreframe-hpc:developfrom
victorusu:sparse_checkout

Conversation

@victorusu
Copy link
Copy Markdown
Contributor

@victorusu victorusu commented Feb 23, 2026

This expands the sourcesdir syntax to include a dictionary format. In this case, the git url is passed via the url key.
Additional command options can be added via the opts key. This capability was previously available in the git_clone function, but not accessible to the sourcesdir git clone interface.

The git sparse-checkout path is available when one defines the files keys with a list of files to checkout.
In this case, instead of emitting a git clone ... command the framework will emit the following set of commands

git clone --no-checkout --depth=1 ...
git sparse-checkout set --no-cone ${file list}
git checkout

where, ${file list} is the list of files defined in the files list.

An example test is this.

@rfm.simple_test
class git_clone_test(rfm.CompileOnlyRegressionTest):
    sourcesdir = {
         'url': 'https://github.com/eth-cscs/alps-gh200-reproducers.git',
         'files' : ['intranode-pinned-host-comm'],
         'opts' : ['--no-optional-locks', '--no-advice', '--no-pager']
    }
    build_system = 'SingleSource'
    sourcepath = 'intranode-pinned-host-comm/intranode_pinned_host_comm.cpp'
    valid_systems = ['*']
    valid_prog_environs = ['*']

Please note that I haven't added any unit tests because the framework does not include any unit tests for the original git_clone function.

closes #3627
closes #3053

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.02%. Comparing base (fb7473a) to head (31fedb4).
⚠️ Report is 9 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3629   +/-   ##
========================================
  Coverage    92.02%   92.02%           
========================================
  Files           62       62           
  Lines        13727    13745   +18     
========================================
+ Hits         12632    12649   +17     
- Misses        1095     1096    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@victorusu victorusu requested review from ekouts and vkarak February 25, 2026 08:14
@vkarak vkarak added this to the ReFrame 4.10 milestone Feb 25, 2026
@vkarak vkarak changed the title Git sparse checkout for sourcesdir [feat] Git sparse checkout for sourcesdir Feb 25, 2026
Comment thread reframe/core/pipeline.py Outdated
Comment thread reframe/core/pipeline.py Outdated
Comment thread reframe/utility/osext.py
@github-project-automation github-project-automation Bot moved this from Todo to In Progress in ReFrame Backlog Mar 9, 2026
Copy link
Copy Markdown
Contributor

@vkarak vkarak left a comment

Choose a reason for hiding this comment

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

@victorusu I have updated and rebased your PR. Can you give it a try? I will likely need to add another unit test to increase coverage, but other than that lgtm now.

@vkarak
Copy link
Copy Markdown
Contributor

vkarak commented Apr 20, 2026

Something was messed with the rebase.

@vkarak vkarak force-pushed the sparse_checkout branch 3 times, most recently from bb1aba4 to 9e44488 Compare April 23, 2026 20:45
victorusu and others added 8 commits April 24, 2026 10:54
Co-authored-by: Vasileios Karakasis <vkarak@gmail.com>
Signed-off-by: Vasileios Karakasis <vkarak@gmail.com>
Signed-off-by: Vasileios Karakasis <vkarak@gmail.com>
Signed-off-by: Vasileios Karakasis <vkarak@gmail.com>
@vkarak vkarak changed the title [feat] Git sparse checkout for sourcesdir [feat] Allow git sparse checkouts and passing arbitrary git options when cloning a repo from sourcesdir Apr 24, 2026
@vkarak vkarak enabled auto-merge April 24, 2026 08:55
@vkarak vkarak merged commit eb56bfd into reframe-hpc:develop Apr 24, 2026
56 of 57 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in ReFrame Backlog Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

only clone a subdirectory of a git repo Consider using depth of 1 when automatically cloning a git repo

2 participants