-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Check any migrations change #33636
base: master
Are you sure you want to change the base?
Check any migrations change #33636
Conversation
author Awais Qureshi <[email protected]> 1698834786 +0500 committer Awais Qureshi <[email protected]> 1701168550 +0500 build: capturing added or remove migrations. build: capturing added or remove migrations. build: capturing added or remove migrations. build: capturing added or remove migrations. build: capturing added or remove migrations. build: upgrading pillow. chore: fixing test. chore: minor change. chore: minor change. feat: Upgrade Python dependency social-auth-app-django (#33826) Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master` Co-authored-by: awais786 <[email protected]> chore: minor change.
4b764b7
to
8ce599f
Compare
Migrations added in this PR.
|
run: | | ||
pip freeze | ||
|
||
- name: Run Tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be renamed, since it doesn't actually run any tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
STUDIO_CFG: lms/envs/minimal.yml | ||
run: | | ||
echo "Running the LMS migrations." | ||
./manage.py lms makemigrations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this here to catch any code changes which should create migrations, but the author forgot to add them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
diff=$((number2 - number1)) | ||
if [ $number2 -gt $number1 ]; then | ||
data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select name from django_migrations ORDER by -id limit $diff;" edxapp;) | ||
echo "$data" > cleaned_data.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the "Migrations added in this PR." text that appeared in the comment, did I miss that or was it removed over the course of code edits?
number1=${{ env.FIRST_QUERY }} | ||
diff=$((number2 - number1)) | ||
if [ $number2 -gt $number1 ]; then | ||
data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select name from django_migrations ORDER by -id limit $diff;" edxapp;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also select and display app_label
so it's clear where each migration came from.
|
All changes done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is a POC, but I would love to make the comments more useful so we can merge this.
diff=$((number2 - number1)) | ||
if [ $number2 -gt $number1 ]; then | ||
data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) | ||
echo "$data" > cleaned_data.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding to what Jeremy said earlier. I appreciate the app name and tables being added to the output, but I think it would be useful to have the text saying 'Migrations added in this PR' so that reviewers have that context. I would also maybe add some text asking the reviewers to do things like check to make sure it won't break blue-green deployments.
data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) | ||
echo "$data" > cleaned_data.txt | ||
elif [ $number1 -gt $number2 ]; then | ||
echo "Your PR removed migrations." > cleaned_data.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think similar to above, maybe adding some lines about why it might be dangerous to remove migrations would help give this comment more context.
app name |
Migrations added in this PR |
Just a POC to identify any new migrations coming from edx-platform or any sitepackages.
Upgrade package has 2 migrations.
Added new workflow.
Now checkout current branch.
If there any difference between run this
select name from django_migrations ORDER by -id limit $diff
and share as comment on PR.