Skip to content

[Bugfix:System] Set Initial Gradeable Notification State#11852

Merged
bmcutler merged 5 commits into
mainfrom
default-grade-released-data-bug-fix
Jul 10, 2025
Merged

[Bugfix:System] Set Initial Gradeable Notification State#11852
bmcutler merged 5 commits into
mainfrom
default-grade-released-data-bug-fix

Conversation

@jeffrey-cordero

Copy link
Copy Markdown
Contributor

Why is this Change Important & Necessary?

The initial sample data insertion for gradeables doesn't account for the existing notification state. Therefore, all gradeables released in the past will have their release flag initialized as false by default, causing the first cron job script run to release them in a large batch for new system installations. Related to #10358.

notification

What is the New Behavior?

The installation scripts related to inserting electronic gradeable data for the testing courses will have the notification state set to true if the gradeable release date is in the past, similar to how the initial migration command handled it.

What steps should a reviewer take to reproduce or test the bug or new feature?

  1. Visit a course database through the CLI to reset notification states or skip the following steps through verification via vagrant up
  • $ su postgres
  • $ psql
  • $ \c submitty_f25_sample (update f25 to suit your existing system)
  • $ UPDATE electronic_gradeable_version SET g_notification_sent = FALSE;
  1. Run the recreate_sample_courses command as the root user
  2. Using the initial steps in step 1, visit the testing database and run the following command to ensure the script worked as intended.
  • SELECT * FROM electronic_gradeable_version WHERE g_notification_sent IS TRUE; (should be non-empty)

Automated Testing & Documentation

N/A

Other information

N/A

@codecov

codecov Bot commented Jul 2, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 20.70%. Comparing base (6cc6c8b) to head (2ae58eb).
Report is 18 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##               main   #11852   +/-   ##
=========================================
  Coverage     20.70%   20.70%           
  Complexity     9191     9191           
=========================================
  Files           265      265           
  Lines         35215    35215           
  Branches        458      458           
=========================================
  Hits           7292     7292           
  Misses        27469    27469           
  Partials        454      454           
Flag Coverage Δ
autograder 21.34% <ø> (ø)
js 2.14% <ø> (ø)
migrator 100.00% <ø> (ø)
php 19.38% <ø> (ø)
python_submitty_utils 80.08% <ø> (ø)
submitty_daemon_jobs 88.88% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jeffrey-cordero jeffrey-cordero changed the title [Bugfix:System] Set Notification State for Test Gradable [Bugfix:System] Set Initial Gradeable Notification State Jul 2, 2025

@Chriun Chriun left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested and it does successfully remove all notifications for sample courses when running recreate_sample_courses/installing new VM.

@github-project-automation github-project-automation Bot moved this from Seeking Reviewer to Awaiting Maintainer Review in Submitty Development Jul 9, 2025
@bmcutler
bmcutler merged commit 1ee572f into main Jul 10, 2025
24 checks passed
@bmcutler
bmcutler deleted the default-grade-released-data-bug-fix branch July 10, 2025 03:00
@github-project-automation github-project-automation Bot moved this from Awaiting Maintainer Review to Done in Submitty Development Jul 10, 2025
williamschen23 pushed a commit that referenced this pull request Jul 18, 2025
<!-- Include any GitHub issue that is fixed/closed using "Fixes
Alternately write "Partially addresses #<number>" or "Related to

The initial sample data insertion for gradeables doesn't account for the
existing notification state. Therefore, all gradeables released in the
past will have their release flag initialized as false by default,
causing the first cron job script run to release them in a large batch
for new system installations. Related to #10358.

![notification](https://github.com/user-attachments/assets/6b72ea9d-169c-4837-9844-6bed30432f0c)

<!-- Include before & after screenshots/videos if the user interface has
changed. -->

The installation scripts related to inserting electronic gradeable data
for the testing courses will have the notification state set to true if
the gradeable release date is in the past, similar to how the initial
migration command handled it.

new feature?

1. Visit a course database through the CLI to reset notification states
or skip the following steps through verification via `vagrant up`
 - `$ su postgres`
 - `$ psql`
- `$ \c submitty_f25_sample` (update `f25` to suit your existing system)
- `$ UPDATE electronic_gradeable_version SET g_notification_sent =
FALSE;`
3. Run the `recreate_sample_courses` command as the root user
4. Using the initial steps in step 1, visit the testing database and run
the following command to ensure the script worked as intended.
- `SELECT * FROM electronic_gradeable_version WHERE g_notification_sent
IS TRUE;` (should be non-empty)

<!-- Is this feature sufficiently tested by unit tests and end-to-end
tests?
If this PR does not add/update the necessary automated tests, write a
new GitHub issue and link it below.
Is this feature sufficiently documented on submitty.org?
Link related PRs or new GitHub issue to update documentation. -->

N/A

<!-- Is this a breaking change?
Does this PR include migrations to update existing installations?
Are there security concerns with this PR? -->

N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants