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

Commit field back population migration #28287

Merged
merged 4 commits into from
Aug 7, 2020
Merged

Conversation

AliRizvi1
Copy link
Contributor

#27839
A feature of the above CEP, related to #28234 which added the commit field.

SUMMARY

Add a migration to hqadmin that back populates the commit field detailed in the PR above based on the diff_url.

PRODUCT DESCRIPTION

User's commit field in the HqDeploy model will now be back populated with commits based on their diff_url, and those changes will be reflected in the standalone Deploy History Report.

@AliRizvi1
Copy link
Contributor Author

@esoergel I can't request a review, so I'll just tag you here.

@AliRizvi1 AliRizvi1 requested a review from esoergel August 4, 2020 17:49
@AliRizvi1 AliRizvi1 added product/admin Change affects admin pages only visible to super users / staff reindex/migration Reindex or migration will be required during or before deploy labels Aug 4, 2020
def back_populate(apps, schema_editor):
HqDeploy = apps.get_model('hqadmin', 'hqdeploy')
for deploy in HqDeploy.objects.all():
if not deploy.commit:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if not deploy.commit:
if deploy.diff_url and not deploy.commit:

diff_url is sometimes None

@esoergel esoergel merged commit 3b46940 into dimagi:master Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product/admin Change affects admin pages only visible to super users / staff reindex/migration Reindex or migration will be required during or before deploy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants