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

chore: Upgrade to later version of gcp-uploader and protobuf #1741

Merged
merged 20 commits into from
Jan 19, 2023

Conversation

lqiu96
Copy link
Contributor

@lqiu96 lqiu96 commented Dec 21, 2022

Update to use the latest version of gcp-uploader package and unpin the dependencies.

@mpeddada1
Copy link
Contributor

@lqiu96 After this change, we will be able to re-enable renovate-bot for these files:

"ignorePaths": ["*/**", "synthtool/gcp/templates/java_library/.kokoro/requirements.txt", "synthtool/docker/owlbot/java/src/requirements.txt"],

@lqiu96
Copy link
Contributor Author

lqiu96 commented Dec 21, 2022

Seeing this error:

Step #9: ERROR: In --require-hashes mode, all requirements must have their versions pinned with ==. These do not:
Step #9:     SecretStorage>=3.2 from https://files.pythonhosted.org/packages/54/24/b4293291fa1dd830f353d2cb163295742fa87f179fcc8a20a306a81978b7/SecretStorage-3.3.3-py3-none-any.whl (from keyring==23.4.1->-r requirements.txt (line 223))

@lqiu96
Copy link
Contributor Author

lqiu96 commented Dec 21, 2022

@lqiu96 After this change, we will be able to re-enable renovate-bot for these files:

"ignorePaths": ["*/**", "synthtool/gcp/templates/java_library/.kokoro/requirements.txt", "synthtool/docker/owlbot/java/src/requirements.txt"],

@mpeddada1 Any objections if I include that change in this PR?

I think the change would be

"ignorePaths": ["*/**", "synthtool/gcp/templates/java_library/.kokoro/requirements.txt", "synthtool/docker/owlbot/java/src/requirements.txt"]

becomes

"ignorePaths": ["*/**"],

Is that right?

@mpeddada1
Copy link
Contributor

@mpeddada1 Any objections if I include that change in this PR?

I think the change would be

"ignorePaths": ["*/**", "synthtool/gcp/templates/java_library/.kokoro/requirements.txt", "synthtool/docker/owlbot/java/src/requirements.txt"]

becomes

"ignorePaths": ["*/**"],

Is that right?

Making the change in this PR sounds good! And yup, it would become ["*/**"]. Oh one note, could you also update https://github.com/googleapis/synthtool/blob/master/docker/owlbot/java/src/requirements.in before removing it from the ignorePaths option?

Copy link
Contributor

@mpeddada1 mpeddada1 left a comment

Choose a reason for hiding this comment

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

Thanks @lqiu96!

@lqiu96
Copy link
Contributor Author

lqiu96 commented Jan 3, 2023

Oh one note, could you also update https://github.com/googleapis/synthtool/blob/master/docker/owlbot/java/src/requirements.in before removing it from the ignorePaths option?

@mpeddada1 What did you mean by update? Should I just unpin the dependencies or pin the current latest versions or something else?

@mpeddada1
Copy link
Contributor

@mpeddada1 What did you mean by update? Should I just unpin the dependencies or pin the current latest versions or something else?

I think we can now update the dependencies in the associated requirement.txt to the latest version now that we're using Python 3.9. It'll help us resolve these open PRs: #1480, #1731.

And for requirements.in, mostly a clean up but afaik, pinning is only required to freeze the version/prevent a dep from being upgraded to the latest. This may not be needed anymore with the Python upgrade so we should be fine with unpinning the versions there. wdyt?

@lqiu96
Copy link
Contributor Author

lqiu96 commented Jan 4, 2023

@mpeddada1 What did you mean by update? Should I just unpin the dependencies or pin the current latest versions or something else?

I think we can now update the dependencies in the associated requirement.txt to the latest version now that we're using Python 3.9. It'll help us resolve these open PRs: #1480, #1731.

And for requirements.in, mostly a clean up but afaik, pinning is only required to freeze the version/prevent a dep from being upgraded to the latest. This may not be needed anymore with the Python upgrade so we should be fine with unpinning the versions there. wdyt?

Sounds good. I'll unpin the versions

@lqiu96
Copy link
Contributor Author

lqiu96 commented Jan 4, 2023

Adding Do Not Merge to this PR. Plan is to merge after the next release of the libraries-bom (~approximately 2 weeks from now).

@lqiu96 lqiu96 marked this pull request as ready for review January 4, 2023 19:58
@lqiu96 lqiu96 requested review from bcoe and a team as code owners January 4, 2023 19:58
@lqiu96 lqiu96 requested a review from a team January 4, 2023 19:58
@lqiu96 lqiu96 added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Jan 4, 2023
@blakeli0
Copy link
Contributor

blakeli0 commented Jan 5, 2023

And for requirements.in, mostly a clean up but afaik, pinning is only required to freeze the version/prevent a dep from being upgraded to the latest

@mpeddada1 Did you validate this approach with other languages lead or rennie, based on his "Pip install vulnerability" doc, I think we may still need it.

@@ -23,4 +23,4 @@ commandTests:
expectedError: ["google-java-format: Version 1.7"]
- name: "python"
command: ["python", "--version"]
expectedOutput: ["Python 3.6.1"]
expectedOutput: ["Python 3.9.13"]
Copy link
Member

Choose a reason for hiding this comment

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

@lqiu96 Would you add an assertion that this python module synthtool.languages.java is available? I think it would look like this:

python3 -c 'import synthtool.languages.java; print("import successs")'

An example failure would look like this:

suztomo@suztomo:~/java-storage$ docker run --user "$(id -u):$(id -g)" --entrypoint /bin/bash --rm -it  a8e0ab6765a4
I have no name!@752c3d65c2dd:/workspace$ python3 -c 'import synthtool.languages.java; print("import successs")'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'synthtool.languages'
I have no name!@752c3d65c2dd:/workspace$ 

It gives more confidence that a change for OwlBot Postprocessor works fine in owlbot.py (example location)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I can add that validation in

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added the new validation in as java synthtool validation which runs the commands above.

FYI, couldn't find the docs for schemaVersion 1.0.0 and the docs on https://github.com/GoogleContainerTools/container-structure-test were showing docs for 2.0.0, so I used that for local testing

Copy link
Member

Choose a reason for hiding this comment

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

Thank you.

@mpeddada1
Copy link
Contributor

And for requirements.in, mostly a clean up but afaik, pinning is only required to freeze the version/prevent a dep from being upgraded to the latest

@mpeddada1 Did you validate this approach with other languages lead or rennie, based on his "Pip install vulnerability" doc, I think we may still need it.

@blakeli0 sorry I missed your comment earlier! Yup, according to the document pip install --require-hashes -r /synthtool/requirements.txt line ensures that we mitigate the vulnerability. The pinning of versions was a java-specific issue and we needed it because we were still using an older version of Python that wasn't always compatible with the latest versions of the dependencies. Languages like Python don't pin the versions (for example: https://github.com/googleapis/synthtool/blob/master/synthtool/gcp/templates/python_library/.kokoro/requirements.in).

@@ -23,4 +23,4 @@ commandTests:
expectedError: ["google-java-format: Version 1.7"]
- name: "python"
command: ["python", "--version"]
expectedOutput: ["Python 3.6.1"]
expectedOutput: ["Python 3.9.13"]
Copy link
Member

Choose a reason for hiding this comment

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

Thank you.

@lqiu96
Copy link
Contributor Author

lqiu96 commented Jan 19, 2023

Removing the Do Not Merge label... Planning on releasing python v3.9.

@lqiu96 lqiu96 removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Jan 19, 2023
@lqiu96 lqiu96 enabled auto-merge (squash) January 19, 2023 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants