From d0d960188c0785c7907af7b5f6844972af9fb948 Mon Sep 17 00:00:00 2001 From: Brian van de Boogaard Date: Tue, 5 Nov 2024 10:11:42 -0700 Subject: [PATCH 1/8] DEV-28818 Test Snyk --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0c7e3757..cd680db6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # B2 Command Line Tool +Don't merge this awesome PR; just checking Snyk. + [![CI](https://github.com/Backblaze/B2_Command_Line_Tool/actions/workflows/ci.yml/badge.svg)](https://github.com/Backblaze/B2_Command_Line_Tool/actions/workflows/ci.yml) [![License](https://img.shields.io/pypi/l/b2.svg?label=License)](https://pypi.python.org/pypi/b2) [![python versions](https://img.shields.io/pypi/pyversions/b2.svg?label=python%20versions)](https://pypi.python.org/pypi/b2) [![PyPI version](https://img.shields.io/pypi/v/b2.svg?label=PyPI%20version)](https://pypi.python.org/pypi/b2) [![Docs](https://readthedocs.org/projects/b2-command-line-tool/badge/?version=master)](https://b2-command-line-tool.readthedocs.io/en/master/?badge=master) The command-line tool that gives easy access to all of the capabilities of B2 Cloud Storage. @@ -43,7 +45,7 @@ You can install the `b2` without them: ### Docker -For a truly platform independent solution, use the official docker image: +For a truly platform independent solution, use the official docker image: ```bash docker run backblazeit/b2:latest ... From 68ec1bf510aa791c558432cb50971a31a555ece0 Mon Sep 17 00:00:00 2001 From: Brian van de Boogaard Date: Tue, 5 Nov 2024 10:17:10 -0700 Subject: [PATCH 2/8] Add changelog --- changelog.d/+test_snyk.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/+test_snyk.md diff --git a/changelog.d/+test_snyk.md b/changelog.d/+test_snyk.md new file mode 100644 index 00000000..351e8242 --- /dev/null +++ b/changelog.d/+test_snyk.md @@ -0,0 +1 @@ +Just testing Snyk From 782b7db3a59ee4087cae367c3812f5b5eef6302f Mon Sep 17 00:00:00 2001 From: Brian van de Boogaard Date: Tue, 5 Nov 2024 10:26:30 -0700 Subject: [PATCH 3/8] Try changelog again --- changelog.d/+test_snyk.md | 1 - changelog.d/test_snyk.changed.md | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 changelog.d/+test_snyk.md create mode 100644 changelog.d/test_snyk.changed.md diff --git a/changelog.d/+test_snyk.md b/changelog.d/+test_snyk.md deleted file mode 100644 index 351e8242..00000000 --- a/changelog.d/+test_snyk.md +++ /dev/null @@ -1 +0,0 @@ -Just testing Snyk diff --git a/changelog.d/test_snyk.changed.md b/changelog.d/test_snyk.changed.md new file mode 100644 index 00000000..ffe35cfb --- /dev/null +++ b/changelog.d/test_snyk.changed.md @@ -0,0 +1 @@ +Test Snyk From f32736e12e10a2a781f24dee613efae584358eb7 Mon Sep 17 00:00:00 2001 From: Brian van de Boogaard Date: Tue, 5 Nov 2024 10:28:27 -0700 Subject: [PATCH 4/8] Add + --- changelog.d/{test_snyk.changed.md => +test_snyk.changed.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename changelog.d/{test_snyk.changed.md => +test_snyk.changed.md} (100%) diff --git a/changelog.d/test_snyk.changed.md b/changelog.d/+test_snyk.changed.md similarity index 100% rename from changelog.d/test_snyk.changed.md rename to changelog.d/+test_snyk.changed.md From d860aaabe7ae7de64afd1b07f7e3228e5b0bf9e5 Mon Sep 17 00:00:00 2001 From: Brian van de Boogaard Date: Tue, 5 Nov 2024 10:32:19 -0700 Subject: [PATCH 5/8] Add full stop --- changelog.d/+test_snyk.changed.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/+test_snyk.changed.md b/changelog.d/+test_snyk.changed.md index ffe35cfb..a3f9fec5 100644 --- a/changelog.d/+test_snyk.changed.md +++ b/changelog.d/+test_snyk.changed.md @@ -1 +1 @@ -Test Snyk +Test Snyk. From 8a2e214248cf22038fbd795fd2ad8ee9f9b9c459 Mon Sep 17 00:00:00 2001 From: Brian van de Boogaard Date: Tue, 5 Nov 2024 12:39:20 -0700 Subject: [PATCH 6/8] Attempt to add new Snyk issue --- b2/_internal/console_tool.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/b2/_internal/console_tool.py b/b2/_internal/console_tool.py index cbb23797..a6d1adf5 100644 --- a/b2/_internal/console_tool.py +++ b/b2/_internal/console_tool.py @@ -1913,6 +1913,20 @@ def _represent_legal_hold(cls, legal_hold: LegalHold): raise ValueError(f'Unsupported legal hold: {legal_hold}') def _print_file_attribute(self, label, value): + + # This chunk of code seems to trigger a Snyk issue. + fd_handle, output_filepath_str = tempfile.mkstemp( + prefix='prefix', + suffix='file_extension', + dir='output_directory', + ) + # Close the handle, so the file is not locked. + # This file is no longer 100% "safe", but that's acceptable. + os.close(fd_handle) + + # "Normal" file created by Python has readable for everyone, writable for user only. + # We change the permissions, to match the default ones. + os.chmod(output_filepath_str, 0o644) self._print((label + ':').ljust(20) + ' ' + value) def get_local_output_filepath( From 8d122535359f40ff38533e50e5f23cefd668fda3 Mon Sep 17 00:00:00 2001 From: Brian van de Boogaard Date: Tue, 5 Nov 2024 12:52:59 -0700 Subject: [PATCH 7/8] Revert "Attempt to add new Snyk issue" This reverts commit 8a2e214248cf22038fbd795fd2ad8ee9f9b9c459. --- b2/_internal/console_tool.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/b2/_internal/console_tool.py b/b2/_internal/console_tool.py index a6d1adf5..cbb23797 100644 --- a/b2/_internal/console_tool.py +++ b/b2/_internal/console_tool.py @@ -1913,20 +1913,6 @@ def _represent_legal_hold(cls, legal_hold: LegalHold): raise ValueError(f'Unsupported legal hold: {legal_hold}') def _print_file_attribute(self, label, value): - - # This chunk of code seems to trigger a Snyk issue. - fd_handle, output_filepath_str = tempfile.mkstemp( - prefix='prefix', - suffix='file_extension', - dir='output_directory', - ) - # Close the handle, so the file is not locked. - # This file is no longer 100% "safe", but that's acceptable. - os.close(fd_handle) - - # "Normal" file created by Python has readable for everyone, writable for user only. - # We change the permissions, to match the default ones. - os.chmod(output_filepath_str, 0o644) self._print((label + ':').ljust(20) + ' ' + value) def get_local_output_filepath( From 5c8119b4866ad6e838b283bd49131cd0eaba632a Mon Sep 17 00:00:00 2001 From: Brian van de Boogaard Date: Fri, 22 Nov 2024 09:34:14 -0700 Subject: [PATCH 8/8] Add change --- README.release.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.release.md b/README.release.md index 3bd2d666..b59fc04a 100644 --- a/README.release.md +++ b/README.release.md @@ -1,4 +1,5 @@ # Release Process +. - Run `nox -s make_release_commit -- X.Y.Z` where `X.Y.Z` is the version you're releasing - Copy the main usage string (from `b2 --help`) to `README.md`. Handy command for consistent format: `COLUMNS=4000 b2 --help | awk '/^usages:/ {p=1; next} p {sub(/^ */, "", $0); print}'`