Added namespace progress report#2168
Conversation
845d131 to
8b1afc8
Compare
|
|
||
| tasks = [] | ||
| msg = _("Parsing Namespace Metadata") | ||
| async with ProgressReport(message=msg, code="sync.parsing.namespace", total=0) as pr: |
There was a problem hiding this comment.
| async with ProgressReport(message=msg, code="sync.parsing.namespace", total=0) as pr: | |
| async with ProgressReport(message=msg, code="sync.parsing.namespace", total=len(self.namespace_shas)) as pr: |
| for namespace, namespace_sha in self.namespace_shas.items(): | ||
| tasks.append(loop.create_task(self._add_namespace(namespace, namespace_sha))) | ||
| await asyncio.gather(*tasks) | ||
| pr.total = pr.done |
There was a problem hiding this comment.
| pr.total = pr.done |
Since we know the total before hand we don't have to set it to done. In fact the amount we are going to add vs the amount that did get added can differ, so maybe let it be reflected in the done vs total amounts.
There was a problem hiding this comment.
I kept this because I only increment when the download succeeds,
so this would adjust the total of downloads
| await self.parsing_namespace_progress_bar.aincrement() | ||
| return True | ||
|
|
||
| return False |
There was a problem hiding this comment.
We don't need the
| await self.parsing_namespace_progress_bar.aincrement() | |
| return True | |
| return False | |
| await self.parsing_namespace_progress_bar.aincrement() | |
| log.info("Failed to find namespace...") |
The return True/False is no longer needed, so maybe we add some log statements for when we fail to add the namespace metadata.
| if pr.message == "Parsing CollectionVersion Metadata": | ||
| assert pr.total == pr.done | ||
| if pr.message == "Parsing Namespace Metadata": | ||
| assert pr.total == pr.done |
There was a problem hiding this comment.
| assert pr.total == pr.done | |
| assert pr.total == pr.done == 1 |
I feel that we should know the total amount for this test sync since it is only one collection.
fixes: pulp#2138 Signed-off-by: Fabricio Aguiar <fabricio.aguiar@gmail.com>
Backport to 0.21: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply bf4079b on top of patchback/backports/0.21/bf4079b75aa35790229b51850041726626978a42/pr-2168 Backporting merged PR #2168 into main
🤖 @patchback |
Backport to 0.20: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply bf4079b on top of patchback/backports/0.20/bf4079b75aa35790229b51850041726626978a42/pr-2168 Backporting merged PR #2168 into main
🤖 @patchback |
Backport to 0.24: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply bf4079b on top of patchback/backports/0.24/bf4079b75aa35790229b51850041726626978a42/pr-2168 Backporting merged PR #2168 into main
🤖 @patchback |
No description provided.