-
Notifications
You must be signed in to change notification settings - Fork 262
feat(cmd-version): add automatic repository un-shallowing to version workflow #1366
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
feat(cmd-version): add automatic repository un-shallowing to version workflow #1366
Conversation
de3525b to
06c6906
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
🎉 This PR has been published as part of v10.5.0 🎉You can find more information about this release on the GitHub Releases page. |
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)