[BUG] `git.latest` function can fail if `fetch_url` is `None`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 5.6k
- Avg merge
- 2d 44m
- Merged PRs (30d)
- 80
Description
Description
I wonder that it is required to check fetch_url is None at line 1151 because the function redact_http_basic_auth at line 1155 does not allow None type and raises TypeError.
It is the result of my type checker, so I wanted to provide test cases but I couldn't.
If this is the correct behavior, I apologize for taking your time.
Setup
(Please provide relevant configs and/or SLS files (be sure to remove sensitive info. There is no general set-up of Salt.)
Please be as specific as possible and give set-up details.
- on-prem machine
- VM (Virtualbox, KVM, etc. please specify)
- VM running on a cloud service, please be explicit and add details
- container (Kubernetes, Docker, containerd, etc. please specify)
- or a combination, please be explicit
- jails if it is FreeBSD
- classic packaging
- onedir packaging
- used bootstrap to install
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in salt/states/git.py at lines 1144-1158 and inspect how git.latest handles a None fetch_url before calling redact_http_basic_auth. Reproduce the type-checker case and add regression coverage showing that the function no longer raises TypeError when fetch_url is None.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, python
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100