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

Update gitpython (security) #6063

Merged
merged 5 commits into from Nov 23, 2023
Merged

Update gitpython (security) #6063

merged 5 commits into from Nov 23, 2023

Conversation

arm4b
Copy link
Member

@arm4b arm4b commented Nov 9, 2023

Taking one dependency at a time into a separated PRs from #6062 to see what could be merged safely ASAP.

This updates gitpython==3.1.37 (security fixed) under py3.8 and gitpython==3.1.18 (latest installable, but vulnerable) under py3.6

Checking the build artifacts for shipped gitpython versions:

  • U18 (py3.6) - gitpython==3.1.18 (build)
  • U20 (py3.8) - gitpython==3.1.37 (build)
  • EL7 (py3.6) - gitpython==3.1.18 (build)
  • EL8 (py3.8) - gitpython==3.1.37 (build)

We should drop the Python 3.6 support after the 3.8.1 patch release and pin githpython explicitly.

@arm4b arm4b added this to the 3.8.1 milestone Nov 9, 2023
@arm4b arm4b added this to In progress in StackStorm v3.8.1 via automation Nov 9, 2023
@pull-request-size pull-request-size bot added the size/XS PR that changes 0-9 lines. Quick fix/merge. label Nov 9, 2023
arm4b added a commit that referenced this pull request Nov 9, 2023
@pull-request-size pull-request-size bot added size/S PR that changes 10-29 lines. Very easy to review. and removed size/XS PR that changes 0-9 lines. Quick fix/merge. labels Nov 9, 2023
@arm4b arm4b mentioned this pull request Nov 9, 2023
@arm4b arm4b marked this pull request as ready for review November 9, 2023 19:05
@arm4b arm4b requested a review from a team November 9, 2023 19:06
@arm4b arm4b enabled auto-merge November 9, 2023 19:06
Copy link
Contributor

@amanda11 amanda11 left a comment

Choose a reason for hiding this comment

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

I'm approving, but I'm just wondering about the pants lock files as st2.lock and bandit.lock refer to version 3.1.18.

@arm4b
Copy link
Member Author

arm4b commented Nov 10, 2023

@amanda11 Experimented a bit and found that in the pants settings we rely on interval between python3.6 (inclusive) until python3.10:

st2/pants.toml

Lines 105 to 112 in 32a243a

[python]
# resolver_version is always "pip-2020-resolver". legacy is not supported.
enable_resolves = true
default_resolve = "st2"
interpreter_constraints = [
# python_distributions needs a single constraint (vs one line per python version).
# officially, we exclude 3.7 support, but that adds unnecessary complexity: "CPython>=3.6,!=3.7.*,<3.10",
"CPython>=3.6,<3.10",

According to that, gitpython==3.1.18 for py3.6 is the correct version for the pants lock as it satisfies all the python version requirements. I tried and it wasn't possible to install dynamically specific package version depending on the python_version marker.

Checking further, if we remove py3.6 from the pants settings, then it would allow using a higher version of gitpython in the lockfile. Not sure if we want to drop py3.6 from pants now or in the v3.9.0 per #6064

@arm4b
Copy link
Member Author

arm4b commented Nov 10, 2023

Update: Yeah, removing py3.6 from pants will try to regenerate all the requirements/lockfile - it probably fits a dedicated PR in the larger scope of v3.9.0.

@arm4b arm4b requested a review from a team November 22, 2023 21:54
@arm4b arm4b merged commit f7e0794 into master Nov 23, 2023
38 checks passed
StackStorm v3.8.1 automation moved this from In progress to Done Nov 23, 2023
@arm4b arm4b deleted the update/gitpython branch November 23, 2023 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement security size/S PR that changes 10-29 lines. Very easy to review.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants