Skip to content

Conversation

@JayZ12138
Copy link
Contributor

If a user calls set-maintenance but doesn't do anything and the report
was originally empty, then the last_updated_by field would be None,
this would lead to crash when set-maintenance is called again, since
the last_updated_by field couldn't be None.
Now, while exporting the report, make it to default value if the field
last_updated_by is None.

If user call set-maintenance but doesn't do anything and the report
was originally empty, then the last_updated_by field would be None,
this would lead to crash when set-maintenance is called again, since
the last_updated_by field couldn't be None.
Now, while exporting the report, make it to default value if field
last_updated_by is None.
negillett
negillett previously approved these changes Dec 19, 2019
Copy link
Member

@midnightercz midnightercz left a comment

Choose a reason for hiding this comment

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

It's little strange that you don't have to change test_create_export_report, could you check that?

@JayZ12138
Copy link
Contributor Author

It's little strange that you don't have to change test_create_export_report, could you check that?

Since the data given in the test has the last_updated_by value.

Copy link
Contributor

@rohanpm rohanpm left a comment

Choose a reason for hiding this comment

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

I'd also prefer seeing the style-only changes excluded from the commit. If they're introduced because black behavior changed, I think a commit/PR dedicated to just fixing the style is the way to go.

@JayZ12138
Copy link
Contributor Author

I'd also prefer seeing the style-only changes excluded from the commit. If they're introduced because black behavior changed, I think a commit/PR dedicated to just fixing the style is the way to go.

Seems like it's because I'm using an older version of black.
I was using black 19.3 while the newest version is 19.10. With the old version, it reformats that line automatically, after I upgrade it to the newest version, either format is acceptable by black, so I can change it back.

Copy link
Contributor

@rohanpm rohanpm left a comment

Choose a reason for hiding this comment

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

I just realized that no autotests had to be updated for these behavior changes. Seems like we are missing some tests we really ought to have, then. Are you willing to look into that as part of this PR?

@JayZ12138
Copy link
Contributor Author

I just realized that no autotests had to be updated for these behavior changes. Seems like we are missing some tests we really ought to have, then. Are you willing to look into that as part of this PR?

sure.

self,
entries=new_entries,
last_updated_by=owner,
last_updated=datetime.datetime.utcnow(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you explain this part a little? The change here was to add/overwrite last_updated on any change. It might be correct, but all of the commit message, PR message and changelog only refer to changes to last_updated_by, a different field.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm, I thought the problem was here for the first time and did this change, but it's not actually.
I'll remove this since it's unrelated change

@JayZ12138 JayZ12138 requested a review from rohanpm January 9, 2020 03:40
@JayZ12138 JayZ12138 merged commit bd88c21 into release-engineering:master Jan 10, 2020
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.

4 participants