fix(push): redact URL credentials and close the review findings of PR 18
quality clean.default-value: trusted_repo passes --object-format only when the checkout sets extensions.objectFormat; _old_tip refuses an unsigned HEAD only when HEAD is in the pushed range, without a .get fallback. CodeRabbit: _config_all reads git config -z --get-all and splits on NUL, so one pushurl value with a newline stays one value and url_allowed rejects it; file_url uses Path.as_uri; redact_urls replaces URL userinfo with *** in the GitRunError text of _tgit_run and in every push.py refusal, failure, preview and status line while the argv given to git is unchanged; fetch_heads splits ls-remote records at the TAB; _track sets and reads the upstream of the validated branch. Tests: the mirror fixture drops GIT_DIR, GIT_WORK_TREE and GIT_INDEX_FILE, the planted-after-check test asserts the second check ran, and test_push_trusted_review.py covers each fix. | 🌿 Branch | 📊 Diff stat | 🎯 Fix | 💥 Break | 💸 Tokens | ⏱️ Velocity | 🛡️ Security | 🏆 Score | Gate | | --- | --- | --- | --- | --- | --- | --- | --- | --- | | fix/push-trusted-gitdir | 5 files +173/-22 | 90 % | 5 % | – | – | 100 % | 86 | ✅ 90/5, tokens and velocity <= 100, security 100 % | Evidence: tests/unit + tests/integration with PYTHONPATH=src 860 passed; the 33 fake-SSH push fixture tests fail identically on the previous HEAD in the agent sandbox and pass in PR CI, so PR CI is the proof for the push paths; 2 known gpg-in-sandbox failures in test_publish_integration. quality check --staged 0 findings, ruff clean, MEDUSA 100 %, critical 0. Hub review f31edb8114253cb6. Refs https://github.com/kevinveenbirkenbach/package-manager/pull/18 Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6c7ca613fc
commit
db7532f9b4
5 files changed
+173
-22
No files matched your search
@@ -56,12 +56,16 @@ class SignedRemotesCase(unittest.TestCase):
|
||||
self.gitconfig = root / ".gitconfig"
|
||||
self._write_gitconfig(root)
|
||||
self.env = {
|
||||
**os.environ,
|
||||
**{
|
||||
key: value
|
||||
for key, value in os.environ.items()
|
||||
if key not in ("GIT_DIR", "GIT_WORK_TREE", "GIT_INDEX_FILE")
|
||||
},
|
||||
"GIT_CONFIG_GLOBAL": str(self.gitconfig),
|
||||
"GIT_CONFIG_NOSYSTEM": "1",
|
||||
}
|
||||
for patcher in (
|
||||
patch.dict(os.environ, self.env),
|
||||
patch.dict(os.environ, self.env, clear=True),
|
||||
patch("pkgmgr.core.git.run._passwd_home", return_value=self.root),
|
||||
):
|
||||
patcher.start()
|
||||
|
||||
Reference in new issue
Block a user