Skip to content

Add LFS template bundle with comprehensive test suite#574

Open
Copilot wants to merge 19 commits intomainfrom
copilot/introduce-lfs-template
Open

Add LFS template bundle with comprehensive test suite#574
Copilot wants to merge 19 commits intomainfrom
copilot/introduce-lfs-template

Conversation

Copy link
Contributor

Copilot AI commented Feb 7, 2026

Implement Git LFS Template

  • Create .rhiza/make.d/09-lfs.mk with Git LFS installation targets
    • lfs-install: Cross-platform git-lfs installation (macOS arm64/amd64, Linux)
    • lfs-pull: Download all LFS files for current branch
    • lfs-track: List all LFS-tracked patterns
    • lfs-status: Show LFS file status
  • Add LFS bundle to template-bundles.yml
  • Add documentation in docs/LFS.md
  • Update .phony targets in rhiza.mk (removed - not needed)
  • Verify makefile syntax and test targets
  • Address all code review feedback:
    • Use GitHub API for reliable version detection
    • Add comprehensive error handling
    • Use sudo automatically on Linux when not root
    • Use POSIX-compliant find flags (-perm +111)
    • Add error handling to GitLab CI example
    • Provide clear error messages throughout
  • Remove unnecessary phony declarations from rhiza.mk (local declarations in 09-lfs.mk are sufficient)
  • Add comprehensive test suite (28 tests total):
    • Structure tests (16 tests) in .rhiza/tests/structure/test_lfs_structure.py: Verify file existence, target definitions, cross-platform support, error handling, bundle configuration, and documentation completeness
    • Integration tests (12 tests) in .rhiza/tests/integration/test_lfs.py: Test makefile target execution, platform-specific logic, GitHub API usage, sudo privilege handling, and actual execution scenarios

Testing

  • ✅ Makefile syntax validated
  • ✅ All LFS targets verified in make help output
  • ✅ Cross-platform logic tested (macOS arm64/amd64, Linux)
  • ✅ Error handling validated
  • ✅ 28 automated tests covering functionality, structure, and documentation
  • ✅ Tests follow repository conventions and patterns

The implementation provides a complete, tested, and documented Git LFS template that can be included in downstream Rhiza projects via .rhiza/template.yml.

Original prompt

This section details on the original issue you should resolve

<issue_title>Introduce a lfs template</issue_title>
<issue_description> @# -----------------------------
@# Git LFS install (cross-platform)
@# -----------------------------
@UNAME_S=$$(uname -s);
UNAME_M=$$(uname -m);
if [ "$$UNAME_S" = "Darwin" ]; then
printf "${BLUE}[INFO] macOS detected ($$UNAME_M)${RESET}\n";
mkdir -p .local/bin .local/tmp;
GIT_LFS_VERSION=$$(curl -sI https://github.com/git-lfs/git-lfs/releases/latest | grep -i '^location:' | sed 's/.tag/v//;s/[[:space:]]$$//');
printf "${BLUE}[INFO] Installing git-lfs v$$GIT_LFS_VERSION${RESET}\n";
if [ "$$UNAME_M" = "arm64" ]; then
curl -fL -o .local/tmp/git-lfs.zip
"https://github.com/git-lfs/git-lfs/releases/download/v$$GIT_LFS_VERSION/git-lfs-darwin-arm64-v$$GIT_LFS_VERSION.zip";
else
curl -fL -o .local/tmp/git-lfs.zip
"https://github.com/git-lfs/git-lfs/releases/download/v$$GIT_LFS_VERSION/git-lfs-darwin-amd64-v$$GIT_LFS_VERSION.zip";
fi;
unzip -o -q .local/tmp/git-lfs.zip -d .local/tmp;
cp .local/tmp/git-lfs-*/git-lfs .local/bin/;
chmod +x .local/bin/git-lfs;
PATH=$$PWD/.local/bin:$$PATH git-lfs install;
rm -rf .local/tmp;
elif [ "$$UNAME_S" = "Linux" ]; then
printf "${BLUE}[INFO] Linux detected${RESET}\n";
if ! command -v git-lfs >/dev/null 2>&1; then
printf "${BLUE}[INFO] Installing git-lfs via apt...${RESET}\n";
apt-get update && apt-get install -y git-lfs;
fi;
git lfs install;
else
printf "${RED}[ERROR] Unsupported OS: $$UNAME_S${RESET}\n";
exit 1;
fi</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits February 7, 2026 07:26
Co-authored-by: tschm <2046079+tschm@users.noreply.github.com>
Co-authored-by: tschm <2046079+tschm@users.noreply.github.com>
Co-authored-by: tschm <2046079+tschm@users.noreply.github.com>
Co-authored-by: tschm <2046079+tschm@users.noreply.github.com>
Copilot AI changed the title [WIP] Introduce a Git LFS template for installation Add LFS template bundle Feb 7, 2026
Copilot AI requested a review from tschm February 7, 2026 07:30
@tschm tschm marked this pull request as ready for review February 7, 2026 07:38
@tschm
Copy link
Member

tschm commented Feb 7, 2026

@copilot avoid the update of rhiza.mk

Co-authored-by: tschm <2046079+tschm@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 7, 2026

@copilot avoid the update of rhiza.mk

Done. Removed the phony target declarations from rhiza.mk in commit 3f4c01f. The LFS targets are now only declared locally in 09-lfs.mk, consistent with other make.d files.

@tschm
Copy link
Member

tschm commented Feb 7, 2026

@copilot Please implement some tests for this functionality

Co-authored-by: tschm <2046079+tschm@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 7, 2026

@copilot Please implement some tests for this functionality

Done. Added comprehensive test suite in commit 84f8706:

Structure Tests (16 tests) in .rhiza/tests/structure/test_lfs_structure.py:

  • File existence checks (makefile, documentation)
  • Target definitions and phony declarations
  • Cross-platform support verification
  • Error handling validation
  • Bundle configuration checks

Integration Tests (12 tests) in .rhiza/tests/integration/test_lfs.py:

  • Makefile target execution (dry-run mode)
  • Platform-specific logic (macOS, Linux)
  • GitHub API usage verification
  • Sudo privilege handling
  • Actual execution tests (when git-lfs is installed)

Total: 28 tests covering functionality, structure, and documentation.

Copilot AI changed the title Add LFS template bundle Add LFS template bundle with comprehensive test suite Feb 7, 2026
tschm and others added 3 commits February 7, 2026 12:08
Add suppression comment for py/incomplete-url-substring-sanitization alert.
The flagged code is a test assertion checking command output, not URL
validation for security purposes.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Remove trailing whitespace
- Remove unused pytest import
- Add blank lines after imports per PEP 8
- Fix conftest.py root path for relocated file

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Change from multiline comment to inline lgtm suppression format
that CodeQL properly recognizes.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Thomas Schmelzer <thomas.schmelzer@gmail.com>
@tschm tschm requested a review from HarryCampion February 7, 2026 08:32
Copy link
Collaborator

Choose a reason for hiding this comment

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

think we can get rid of this?

Copy link
Member

Choose a reason for hiding this comment

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

Careful, I need the hook for some local tests in tests/test_rhiza. Please note that template-bundles is not copied into the different downstream repos. Maybe it should be outside .rhiza?

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.

Introduce a lfs template

3 participants