feat(cmd-version): add automatic repository un-shallowing to version workflow#1366
Merged
codejedi365 merged 6 commits intopython-semantic-release:masterfrom Nov 9, 2025
Conversation
de3525b to
06c6906
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds automatic shallow clone detection and unshallowing functionality to Python Semantic Release. The changes eliminate the need for users to manually specify fetch-depth: 0 in GitHub Actions workflows, as PSR now automatically converts shallow clones to full clones when needed for proper commit history analysis.
Key changes:
- Added
is_shallow_clone()andgit_unshallow()methods to theGitProjectclass - Integrated shallow clone detection into the version command workflow
- Updated documentation to reflect that
fetch-depth: 0is no longer required
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/semantic_release/gitproject.py | Adds new methods for detecting and converting shallow clones to full clones |
| src/semantic_release/cli/commands/version.py | Integrates shallow clone detection early in the version command workflow |
| tests/unit/semantic_release/test_gitproject.py | Adds comprehensive unit tests for the new shallow clone functionality with improved test fixtures |
| tests/e2e/cmd_version/test_version_shallow.py | Adds end-to-end tests for version command with shallow repositories |
| docs/configuration/automatic-releases/github-actions.rst | Updates documentation to reflect that fetch-depth is no longer required |
| docs/configuration/configuration-guides/uv_integration.rst | Removes fetch-depth requirement from uv integration examples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…workflow NOTICE: If you were previously handling the unshallowing of a repository clone in your CI/CD pipelines, you may now remove that step from your workflow. PSR will now detect a shallow repository and unshallow it before evaluating the commit history.
…heckout's fetch depth
…heckout's fetch depth
06c6906 to
f06e780
Compare
Contributor
Author
🎉 This PR has been published as part of v10.5.0 🎉You can find more information about this release on the GitHub Releases page. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Rationale
How did you test?
How to Verify
PR Completion Checklist
Reviewed & followed the Contributor Guidelines
Changes Implemented & Validation pipeline succeeds
Commits follow the Conventional Commits standard
and are separated into the proper commit type and scope (recommended order: test, build, feat/fix, docs)
Appropriate Unit tests added/updated
Appropriate End-to-End tests added/updated
Appropriate Documentation added/updated and syntax validated for sphinx build (see Contributor Guidelines)