Skip to content

Commit c1e7885

Browse files
Merge remote-tracking branch 'reef/master' into test-commons-2
* reef/master: release 4.4.2 Bump pypa/gh-action-pypi-publish in /.github/workflows Fix b2id:// uri support in file unhide command
2 parents 7557405 + 57f8bae commit c1e7885

File tree

8 files changed

+60
-7
lines changed

8 files changed

+60
-7
lines changed

.github/workflows/cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
files: ${{ steps.build.outputs.asset_path }}
5757
- name: Upload the distribution to PyPI
5858
if: ${{ env.B2_PYPI_PASSWORD != '' && steps.prerelease_check.outputs.prerelease == 'false' }}
59-
uses: pypa/gh-action-pypi-publish@v1.3.1
59+
uses: pypa/gh-action-pypi-publish@v1.13.0
6060
with:
6161
user: __token__
6262
password: ${{ secrets.B2_PYPI_PASSWORD }}

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,22 @@ upcoming release can be found in [changelog.d](changelog.d).
99

1010
<!-- towncrier release notes start -->
1111

12+
## [4.4.2](https://github.com/Backblaze/B2_Command_Line_Tool/releases/tag/v4.4.2) - 2025-09-10
13+
14+
15+
### Fixed
16+
17+
- Handle filenames starting with / or ending with # or ?. ([#1090](https://github.com/Backblaze/B2_Command_Line_Tool/issues/1090))
18+
- Avoid failing on missing extra dependencies in `b2 license` command. ([#1106](https://github.com/Backblaze/B2_Command_Line_Tool/issues/1106))
19+
- Fix `b2id://` uri support in `file unhide` command. ([#1114](https://github.com/Backblaze/B2_Command_Line_Tool/issues/1114))
20+
21+
### Infrastructure
22+
23+
- Prepare Linux binary for ARM. ([#1099](https://github.com/Backblaze/B2_Command_Line_Tool/issues/1099))
24+
- Address duplicate bucket names issue in integration tests by redesigning the seed generation mechanism.
25+
- Bump pypa/gh-action-pypi-publish from 1.3.1 to 1.13.0 in /.github/workflows.
26+
27+
1228
## [4.4.1](https://github.com/Backblaze/B2_Command_Line_Tool/releases/tag/v4.4.1) - 2025-07-30
1329

1430

b2/_internal/console_tool.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2273,8 +2273,16 @@ def _setup_parser(cls, parser):
22732273

22742274
def _run(self, args):
22752275
b2_uri = self.get_b2_uri_from_arg(args)
2276-
bucket = self.api.get_bucket_by_name(b2_uri.bucket_name)
2277-
file_id_and_name = bucket.unhide_file(b2_uri.path, args.bypass_governance)
2276+
2277+
if isinstance(b2_uri, B2FileIdURI):
2278+
file_version = self.api.get_file_info_by_uri(b2_uri)
2279+
bucket = self.api.get_bucket_by_id(file_version.bucket_id)
2280+
file_name = file_version.file_name
2281+
else:
2282+
bucket = self.api.get_bucket_by_name(b2_uri.bucket_name)
2283+
file_name = b2_uri.path
2284+
2285+
file_id_and_name = bucket.unhide_file(file_name, args.bypass_governance)
22782286
self._print_json(file_id_and_name)
22792287
return 0
22802288

changelog.d/+duplicate_bucket_ci.infrastructure.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog.d/1090.fixed.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog.d/1099.infrastructure.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog.d/1106.fixed.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/unit/test_console_tool.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2161,6 +2161,39 @@ def test_get_bucket_with_hidden(self):
21612161
expected_json_in_stdout=expected_json,
21622162
)
21632163

2164+
@pytest.mark.apiver(from_ver=4)
2165+
def test_unhide_b2id(self):
2166+
self._authorize_account()
2167+
self._create_my_bucket()
2168+
2169+
bucket = self.b2_api.get_bucket_by_name('my-bucket')
2170+
stdout, stderr = self._get_stdouterr()
2171+
console_tool = self.console_tool_class(stdout, stderr)
2172+
2173+
file_version = bucket.upload(UploadSourceBytes(b'test'), 'test.txt')
2174+
bucket.hide_file('test.txt')
2175+
2176+
console_tool.run_command(['b2', 'file', 'unhide', f'b2id://{file_version.id_}'])
2177+
2178+
expected_json = {
2179+
'accountId': self.account_id,
2180+
'bucketId': 'bucket_0',
2181+
'bucketInfo': {},
2182+
'bucketName': 'my-bucket',
2183+
'bucketType': 'allPublic',
2184+
'corsRules': [],
2185+
'defaultServerSideEncryption': {'mode': 'none'},
2186+
'fileCount': 1,
2187+
'lifecycleRules': [],
2188+
'options': [],
2189+
'revision': 1,
2190+
'totalSize': 4,
2191+
}
2192+
self._run_command(
2193+
['bucket', 'get', '--show-size', 'my-bucket'],
2194+
expected_json_in_stdout=expected_json,
2195+
)
2196+
21642197
def test_get_bucket_complex(self):
21652198
self._authorize_account()
21662199
self._create_my_bucket()

0 commit comments

Comments
 (0)