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

Replace ProgressBar with ProgressReport #293

Merged
merged 1 commit into from Sep 20, 2019
Merged

Replace ProgressBar with ProgressReport #293

merged 1 commit into from Sep 20, 2019

Conversation

fao89
Copy link
Member

@fao89 fao89 commented Sep 10, 2019

@@ -386,17 +386,6 @@ class Migration(migrations.Migration):
},
bases=('core.progressreport',),
),
migrations.CreateModel(
Copy link
Member

Choose a reason for hiding this comment

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

Can we apply this as a new migration instead? That will allow us to keep pre-production upgrades simpler.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, I will change it

@bmbouter
Copy link
Member

This PR started as a bugfix, but then it transitioned more into doing the work of 5444 which I believe is right because we want to get the big parts right and then handle bugs on them. Can this PR become dedicated to 5444 and not include the bugfix? My concern is that we would be spreading out the 5444 (possible breaking change) across more PRs and time instead of all at once. What do you think?

fao89 added a commit to fao89/pulp_file that referenced this pull request Sep 17, 2019
fao89 added a commit to fao89/pulpcore-plugin that referenced this pull request Sep 17, 2019
fao89 added a commit to fao89/pulpcore-plugin that referenced this pull request Sep 17, 2019
fao89 added a commit to fao89/pulpcore-plugin that referenced this pull request Sep 17, 2019
fao89 added a commit to fao89/pulp_file that referenced this pull request Sep 17, 2019
@@ -0,0 +1 @@
Using `ProgressReport` for known and unknown items count.
Copy link
Member

Choose a reason for hiding this comment

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

This would be good as a .feature so it can be shown (because of the misc template not being shown).


class Meta:
proxy = True

def increment(self):
"""
Increment done count and save the progress bar.
Copy link
Member

Choose a reason for hiding this comment

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

Can progress bar be updated please.

fao89 added a commit to fao89/pulpcore-plugin that referenced this pull request Sep 17, 2019
@@ -31,8 +31,7 @@ class ProgressReport(Model):
code (models.CharField): identifies the type of progress report
Copy link
Member

Choose a reason for hiding this comment

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

Can L#25 be updated since it's no longer a base model, but to be used directly.

@@ -106,8 +105,8 @@ def __exit__(self, type, value, traceback):
See the context manager documentation for more info on __exit__ parameters
"""
self._using_context_manager = False
if self.total is None and self.done != 0:
self.total = self.done
if self.total is None:
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure why we have this conditional case. Can we do away with this part?

@fao89 fao89 changed the title ProgressBar for known and unknown items count Replace ProgressBar with ProgressReport Sep 17, 2019
@dralley
Copy link
Contributor

dralley commented Sep 17, 2019

Since we need to redo migrations for this change anyways, I decided to make another small change that would also require redoing the migrations, and we can merge them around the same time to avoid doing it more than once.

#301

fao89 added a commit to fao89/pulp-2to3-migration that referenced this pull request Sep 18, 2019
fao89 added a commit to fao89/pulp_deb that referenced this pull request Sep 18, 2019
fao89 added a commit to fao89/pulp_rpm that referenced this pull request Sep 18, 2019
fao89 added a commit to fao89/pulp_python that referenced this pull request Sep 18, 2019
fao89 added a commit to fao89/pulp_docker that referenced this pull request Sep 18, 2019
fao89 added a commit to fao89/pulp-2to3-migration that referenced this pull request Sep 19, 2019
@@ -20,8 +20,6 @@

class ProgressReport(Model):
"""
A base model for all progress reporting.
Copy link
Member

Choose a reason for hiding this comment

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

I would keep that line and just remove the 'base'.

You can also use this short form which handles all necessary save() calls:

>>> with ProgressSpinner(message='Publishing Metadata'):
>>> publish_metadata()
Copy link
Member

Choose a reason for hiding this comment

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

It's a pity, that we loose all those good code examples.

Copy link
Member

Choose a reason for hiding this comment

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

I agree and didn't realize that. @fabricio-aguiar can we move these back to the docstrings we are keeping?

share the same in-memory instance. Django does not synchronize in-memory model instances, so
multiple instances of a specific ProgressBar will diverge as they are written to from separate
threads.
"""
Copy link
Member

Choose a reason for hiding this comment

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

... I think the documentation should transmogrified into the foremer base model.

daviddavis pushed a commit to daviddavis/pulp_ansible that referenced this pull request Sep 19, 2019
daviddavis pushed a commit to daviddavis/pulp_ansible that referenced this pull request Sep 19, 2019
daviddavis pushed a commit to daviddavis/pulp_ansible that referenced this pull request Sep 19, 2019
fao89 added a commit to fao89/pulp_rpm that referenced this pull request Sep 19, 2019
fao89 added a commit to fao89/pulp_python that referenced this pull request Sep 19, 2019
fao89 added a commit to fao89/pulp_docker that referenced this pull request Sep 19, 2019
fao89 added a commit to fao89/pulp_rpm that referenced this pull request Sep 19, 2019
Copy link
Member

@bmbouter bmbouter left a comment

Choose a reason for hiding this comment

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

I believe all of this is correct.

fao89 added a commit to fao89/pulp_docker that referenced this pull request Sep 20, 2019
fao89 added a commit to fao89/pulp_rpm that referenced this pull request Sep 20, 2019
@bmbouter bmbouter merged commit 6503991 into pulp:master Sep 20, 2019
ThikaXer pushed a commit to ATIX-AG/pulp_deb that referenced this pull request Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants