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

Backfill migration for LMSGroupSet #6838

Merged
merged 2 commits into from
Nov 5, 2024
Merged

Backfill migration for LMSGroupSet #6838

merged 2 commits into from
Nov 5, 2024

Conversation

marcospri
Copy link
Member

@marcospri marcospri commented Nov 4, 2024

For:

After storing new group sets in #6837 we'll backfill thet new table based on information from Grouping.extra

Testing

  • Start configuring an assignment with groups. We record the group sets the moment we list them in the creation screen, no need to to finish the configuration process.

For example:

https://hypothesis.instructure.com/courses/125/assignments/7412/edit?name=Assignment%20creation%20-%20test%20&due_at=&points_possible=0

  • Remove the rows on the new table
truncate lms_group_set;
  • Run the migration
tox -e dev --run-command 'alembic upgrade head'     
dev run-test-pre: PYTHONHASHSEED='2142052960'
dev run-test-pre: commands[0] | pip-sync-faster requirements/dev.txt --pip-args --disable-pip-version-check
dev run-test: commands[0] | alembic upgrade head
INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade 4b813a44a6c9 -> ba295703738b, Backfill LMSGroupSet
  • Check the rows in lms_group_set have been created based on the information in grouping:
select * from lms_group_set;
 id | lms_id |               name               | lms_course_id |          created           |          updated           
----+--------+----------------------------------+---------------+----------------------------+----------------------------
 29 | 121    | Test group set                   |           105 | 2024-11-05 08:43:51.641694 | 2024-11-05 08:43:51.641694
 30 | 122    | Empty group set                  |           105 | 2024-11-05 08:43:51.641694 | 2024-11-05 08:43:51.641694
 31 | 125    | PoC                              |           105 | 2024-11-05 08:43:51.641694 | 2024-11-05 08:43:51.641694
 32 | 129    | Group Set with No Students in It |           105 | 2024-11-05 08:43:51.641694 | 2024-11-05 08:43:51.641694
 33 | 389    | everyone                         |           105 | 2024-11-05 08:43:51.641694 | 2024-11-05 08:43:51.641694
(5 rows)

@@ -15,7 +15,7 @@ class TestGetPage:
def test_when_no_next_page(self, pyramid_request, db_session):
pyramid_request.parsed_params = {"limit": 100}
courses = factories.Course.create_batch(5)
query = select(Course)
query = select(Course).order_by(Course.id)
Copy link
Member Author

Choose a reason for hiding this comment

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

Fix more of these flaky tests.

Base automatically changed from group-set-code to main November 5, 2024 11:14
@marcospri marcospri merged commit 0765b53 into main Nov 5, 2024
9 checks passed
@marcospri marcospri deleted the group-set-backfill branch November 5, 2024 11:29
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.

2 participants