Skip to content
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

Added test for PR #1645 submodule path #1647

Merged
merged 2 commits into from
Sep 7, 2023

Conversation

CosmosAtlas
Copy link
Contributor

Following from here: #1645 (comment), I've added a test in the corresponding position.

Meanwhile, I've noticed there are test failures related to CVE-2022-39253. I did a quick fix in place by adding git configs in the Cmd.

Since I also had the chance to do a fresh start on testing, I updated the docs on where it was unclear to me and caused issues. Particularly, I highlighted that git fetch --tags should be ran first otherwise it would cause test failures regarding version 0.1.6 something something.

Each small change in clearly separated by commits, so if there is any change you don't like, it can be easily cherry picked.

Lastly, I would like to thank you for being so responsive in maintaining this wonderful project 😄

@EliahKagan
Copy link
Contributor

EliahKagan commented Sep 7, 2023

Does this (specifically, 69ab73b) close #1544?

I didn't notice that this PR had already recently been opened, when I subsequently opened #1648. This and #1648 partially overlap in what they fix: they both include changes to two of the existing tests in test_submodule.py, which take different approaches but solve the same problem. I am not sure which approach is better. I've stated the differences between our PRs that relate to #1544, as I understand them, in an edit at the top of #1648.

This pull request also contains improvements not covered in #1648, adding test_ignore_non_submodule_file and updating the readme. #1648 contains improvements not covered here, removing some formerly and newly unneeded git config commands from pythonpackage.yml and cygwin-test.yml workflows.

If this effectively fixes #1544, then it seems to me that it may make sense to extend it to also remove the commands setting protocol.file.allow in the test workflows, but I understand you might consider that beyond the scope of this PR.

@CosmosAtlas
Copy link
Contributor Author

CosmosAtlas commented Sep 7, 2023

For future proofness I think #1648 may be better, as I suggested in the original comment, I basically simply edited it for it to work.

Meanwhile, to address the same issue, there's also another approach that seems promising, but I couldn't get it working when tried for a bit.

GitPython supports editing the config file, so in the testing environment, it's possible to just modify the config for the local repo through something like the following

with repo.config_writer() as writer:
    writer.set_value("protocol.file.allow", "always")

@EliahKagan
Copy link
Contributor

If a config_writer-based approach were used, would it be used on the superproject (the repository that is going to have a submodule)? If so, I don't think that will work, because submodules don't inherit local configuration from the superprojects they are added to. I wasn't sure if that applied even to allowed protocols--intuitively it feels like it should not--but it seems it does:

ek@Kip:~/source/repos/example-superproject-ii (main =)$ ls /repos/example-submodule.git
branches  config  description  HEAD  hooks  info  objects  refs
ek@Kip:~/source/repos/example-superproject-ii (main =)$ git submodule add /repos/example-submodule.git
Cloning into '/home/ek/source/repos/example-superproject-ii/example-submodule'...
fatal: transport 'file' not allowed
fatal: clone of '/repos/example-submodule.git' into submodule path '/home/ek/source/repos/example-superproject-ii/example-submodule' failed
ek@Kip:~/source/repos/example-superproject-ii (main =)[128]$ git config protocol.file.allow always
ek@Kip:~/source/repos/example-superproject-ii (main =)$ git submodule add /repos/example-submodule.git
Cloning into '/home/ek/source/repos/example-superproject-ii/example-submodule'...
fatal: transport 'file' not allowed
fatal: clone of '/repos/example-submodule.git' into submodule path '/home/ek/source/repos/example-superproject-ii/example-submodule' failed

@CosmosAtlas
Copy link
Contributor Author

Thanks for the update. It explained why I couldn't get it working (because it shouldn't!).

Copy link
Member

@Byron Byron left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the test, it's much appreciated! Tests are the reason this project is still on life-support, after all.

Could you rebase onto main and see if the additional -c"protocol… line can the be removed?

Thanks you.


Lastly, I would like to thank you for being so responsive in maintaining this wonderful project 😄

Thank you :). I just don't know if it's a wonderful project, but I'll leave that to you ;).

@Byron Byron added this to the v3.1.35 - Bugfixes milestone Sep 7, 2023
@CosmosAtlas CosmosAtlas requested a review from Byron September 7, 2023 12:09
@Byron Byron merged commit 8017421 into gitpython-developers:main Sep 7, 2023
7 checks passed
renovate bot referenced this pull request in allenporter/flux-local Sep 8, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [GitPython](https://togithub.com/gitpython-developers/GitPython) |
`==3.1.34` -> `==3.1.35` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/GitPython/3.1.35?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/GitPython/3.1.35?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/GitPython/3.1.34/3.1.35?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/GitPython/3.1.34/3.1.35?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>gitpython-developers/GitPython (GitPython)</summary>

###
[`v3.1.35`](https://togithub.com/gitpython-developers/GitPython/releases/tag/3.1.35):
- a fix for CVE-2023-41040

[Compare
Source](https://togithub.com/gitpython-developers/GitPython/compare/3.1.34...3.1.35)

#### What's Changed

- Bump actions/checkout from 3 to 4 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/gitpython-developers/GitPython/pull/1643](https://togithub.com/gitpython-developers/GitPython/pull/1643)
- Fix 'Tree' object has no attribute '\_name' when submodule path is
normal path by [@&#8203;CosmosAtlas](https://togithub.com/CosmosAtlas)
in
[https://github.com/gitpython-developers/GitPython/pull/1645](https://togithub.com/gitpython-developers/GitPython/pull/1645)
- Fix CVE-2023-41040 by
[@&#8203;facutuesca](https://togithub.com/facutuesca) in
[https://github.com/gitpython-developers/GitPython/pull/1644](https://togithub.com/gitpython-developers/GitPython/pull/1644)
- Only make config more permissive in tests that need it by
[@&#8203;EliahKagan](https://togithub.com/EliahKagan) in
[https://github.com/gitpython-developers/GitPython/pull/1648](https://togithub.com/gitpython-developers/GitPython/pull/1648)
- Added test for PR
[#&#8203;1645](https://togithub.com/gitpython-developers/GitPython/issues/1645)
submodule path by
[@&#8203;CosmosAtlas](https://togithub.com/CosmosAtlas) in
[https://github.com/gitpython-developers/GitPython/pull/1647](https://togithub.com/gitpython-developers/GitPython/pull/1647)
- Fix Windows environment variable upcasing bug by
[@&#8203;EliahKagan](https://togithub.com/EliahKagan) in
[https://github.com/gitpython-developers/GitPython/pull/1650](https://togithub.com/gitpython-developers/GitPython/pull/1650)

#### New Contributors

- [@&#8203;CosmosAtlas](https://togithub.com/CosmosAtlas) made their
first contribution in
[https://github.com/gitpython-developers/GitPython/pull/1645](https://togithub.com/gitpython-developers/GitPython/pull/1645)
- [@&#8203;facutuesca](https://togithub.com/facutuesca) made their first
contribution in
[https://github.com/gitpython-developers/GitPython/pull/1644](https://togithub.com/gitpython-developers/GitPython/pull/1644)

**Full Changelog**:
gitpython-developers/GitPython@3.1.34...3.1.35

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/allenporter/flux-local).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi44My4wIiwidXBkYXRlZEluVmVyIjoiMzYuODMuMCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
otc-zuul bot pushed a commit to opentelekomcloud-infra/eyes_on_docs that referenced this pull request Sep 11, 2023
Bump gitpython from 3.1.32 to 3.1.35

Bumps gitpython from 3.1.32 to 3.1.35.

Release notes
Sourced from gitpython's releases.

3.1.35 - a fix for CVE-2023-41040
What's Changed

Bump actions/checkout from 3 to 4 by @​dependabot in gitpython-developers/GitPython#1643
Fix 'Tree' object has no attribute '_name' when submodule path is normal path by @​CosmosAtlas in gitpython-developers/GitPython#1645
Fix CVE-2023-41040 by @​facutuesca in gitpython-developers/GitPython#1644
Only make config more permissive in tests that need it by @​EliahKagan in gitpython-developers/GitPython#1648
Added test for PR #1645 submodule path by @​CosmosAtlas in gitpython-developers/GitPython#1647
Fix Windows environment variable upcasing bug by @​EliahKagan in gitpython-developers/GitPython#1650

New Contributors

@​CosmosAtlas made their first contribution in gitpython-developers/GitPython#1645
@​facutuesca made their first contribution in gitpython-developers/GitPython#1644

Full Changelog: gitpython-developers/GitPython@3.1.34...3.1.35
3.1.34 - fix resource leaking
What's Changed

util: close lockfile after opening successfully by @​skshetry in gitpython-developers/GitPython#1639

New Contributors

@​skshetry made their first contribution in gitpython-developers/GitPython#1639

Full Changelog: gitpython-developers/GitPython@3.1.33...3.1.34
v3.1.33 - with security fix
What's Changed

WIP Quick doc by @​LeoDaCoda in gitpython-developers/GitPython#1608
Partial clean up wrt mypy and black by @​bodograumann in gitpython-developers/GitPython#1617
Disable merge_includes in config writers by @​bodograumann in gitpython-developers/GitPython#1618
feat: full typing for "progress" parameter in Repo class by @​madebylydia in gitpython-developers/GitPython#1634
Fix CVE-2023-40590 by @​EliahKagan in gitpython-developers/GitPython#1636
#1566 Creating a lock now uses python built-in "open()" method to work arou… by @​HageMaster3108 in gitpython-developers/GitPython#1619

New Contributors

@​LeoDaCoda made their first contribution in gitpython-developers/GitPython#1608
@​bodograumann made their first contribution in gitpython-developers/GitPython#1617
@​EliahKagan made their first contribution in gitpython-developers/GitPython#1636
@​HageMaster3108 made their first contribution in gitpython-developers/GitPython#1619

Full Changelog: gitpython-developers/GitPython@3.1.32...3.1.33



Commits

c8e303f prepare next release
09e1b3d Merge pull request #1650 from EliahKagan/envcase
8017421 Merge pull request #1647 from CosmosAtlas/master
fafb4f6 updated docs to better describe testing procedure with new repo
9da24d4 add test for submodule path not owned by submodule case
eebdb25 Eliminate duplication of git.util.cwd logic
c7fad20 Fix Windows env var upcasing regression
7296e5c Make test helper script a file, for readability
d88372a Add test for Windows env var upcasing regression
11839ab Merge pull request #1648 from EliahKagan/file-protocol
Additional commits viewable in compare view




Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

@dependabot rebase will rebase this PR
@dependabot recreate will recreate this PR, overwriting any edits that have been made to it
@dependabot merge will merge this PR after your CI passes on it
@dependabot squash and merge will squash and merge this PR after your CI passes on it
@dependabot cancel merge will cancel a previously requested merge and block automerging
@dependabot reopen will reopen this PR if it is closed
@dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
@dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
@dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the Security Alerts page.

Reviewed-by: Vladimir Vshivkov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants