Skip to content

feat: Allow pinning dependency to a specific commit#8

Open
BatteredBunny wants to merge 21 commits intoRedFox20:masterfrom
BatteredBunny:git_pinning
Open

feat: Allow pinning dependency to a specific commit#8
BatteredBunny wants to merge 21 commits intoRedFox20:masterfrom
BatteredBunny:git_pinning

Conversation

@BatteredBunny
Copy link
Contributor

@BatteredBunny BatteredBunny commented Feb 10, 2026

  • Adds support for pinning to a specific commit via git_tag= or git_commit=
  • Sets up infra for pytest tests and adds 2 tests which test tag & commit pinning along with pin changing behaviour.
  • Adds github action workflow which runs the tests.
  • Fixes infinite recursion bug in mama deploy

For tests it uses https://github.com/BatteredBunny/MamaExampleRemote repo since the original was missing tags to test.

RedFox20
RedFox20 previously approved these changes Feb 16, 2026
Copy link
Owner

@RedFox20 RedFox20 left a comment

Choose a reason for hiding this comment

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

Looks mostly good to me, I think this can be squashed and merged

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds git dependency pinning improvements (including commit-hash pin behavior), introduces a pytest-based test suite to validate git pinning and papa deploy/parse flows, and wires CI to run tests. Also includes a fix intended to prevent infinite recursion during directory copy operations.

Changes:

  • Extend git dependency handling to support treating hex strings as commit pins and improve fetch/checkout behavior for tag/branch/commit transitions.
  • Add pytest test infrastructure + multiple integration-style tests for pinning, pin changes, papa deploy/parse, and stale dependency recovery.
  • Add a GitHub Actions workflow to run tests, plus documentation updates and minor test-project CMake adjustments.

Reviewed changes

Copilot reviewed 23 out of 24 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
mama/types/git.py Updates git fetch/checkout logic; adds helpers for hex detection and status formatting.
mama/util.py Attempts to prevent recursive copying by skipping the output directory during os.walk.
pyproject.toml Configures pytest to discover tests under tests/.
tests/conftest.py Adds tests/ to sys.path to allow import testutils.
tests/testutils.py Adds shared test helpers for shelling out, filesystem checks, and platform detection.
tests/test_git_pinning/* Adds integration test + mamafile for tag/commit pinning behavior.
tests/test_git_pin_change/* Adds integration test + mamafile to validate switching pins across commits/tags/branches.
tests/test_stale_dep/* Adds integration test + mamafile to simulate a stale dependency and validate updating.
tests/test_papa_deploy/* Adds integration test + minimal C++/CMake consumer to validate deploy output.
tests/test_papa_parse/* Adds parsing test + sample papa.txt.
tests/test/example_library/* Updates test library to std::filesystem and bumps CMake/C++ standard settings.
tests/test/example_consumer/* Adjusts workspace + pins a git dependency commit; simplifies CMake target sources.
README.md Adds contributor test-running instructions and minor whitespace fixes.
.gitignore Ignores packages/ and bin/ build artifacts.
.github/workflows/tests.yml Adds CI workflow to run pytest.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants