Skip to content

Fix certificate generation without persistent grades#29793

Closed
dyudyunov wants to merge 2 commits intoopenedx:open-release/maple.masterfrom
raccoongang:dyudyunov/maple/fix-certificate-generation-without-persistent-grades
Closed

Fix certificate generation without persistent grades#29793
dyudyunov wants to merge 2 commits intoopenedx:open-release/maple.masterfrom
raccoongang:dyudyunov/maple/fix-certificate-generation-without-persistent-grades

Conversation

@dyudyunov
Copy link
Copy Markdown
Contributor

Description

Fix for an error related to endless recursion

Dev Notes:
The student gets the passing grade
-> CourseGradeFactory sends the COURSE_GRADE_NOW_PASSED signal after the grade calculation
-> listen_for_passing_grade receives the signal and calls generate_certificate_task
-> generate_certificate_task calls _generate_regular_certificate_task
-> _generate_regular_certificate_task trying to get grade by calling the _get_course_grade
-> _get_course_grade calls CourseGradeFactory().read() but I have persistent grades off, so actually that ends with CourseGradeFactory().update()
-> CourseGradeFactory().update() sends the COURSE_GRADE_NOW_PASSED
And so on

Related PR to master:

@openedx-webhooks
Copy link
Copy Markdown

openedx-webhooks commented Jan 20, 2022

Thanks for the pull request, @dyudyunov! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@openedx-webhooks openedx-webhooks added needs triage open-source-contribution PR author is not from Axim or 2U labels Jan 20, 2022
@dyudyunov dyudyunov force-pushed the dyudyunov/maple/fix-certificate-generation-without-persistent-grades branch from 90388fb to 91e7b9f Compare January 20, 2022 12:22
@dyudyunov
Copy link
Copy Markdown
Contributor Author

Failed tests are already fixed: #29773 (comment)

@natabene
Copy link
Copy Markdown
Contributor

@dyudyunov Thank you for your contribution. @BbrSofiane Please line this up for your review.

@dyudyunov dyudyunov force-pushed the dyudyunov/maple/fix-certificate-generation-without-persistent-grades branch 2 times, most recently from e97f76c to 6962b25 Compare March 21, 2022 11:03
@mariajgrimaldi
Copy link
Copy Markdown
Member

Hello! Can you please fix the failing tests?

@mariajgrimaldi
Copy link
Copy Markdown
Member

mariajgrimaldi commented Jun 22, 2022

I can take this one @BbrSofiane, if it's OK with you. (I already reviewed this PR targetting master)

@dyudyunov dyudyunov force-pushed the dyudyunov/maple/fix-certificate-generation-without-persistent-grades branch from 6962b25 to 461aa5d Compare June 23, 2022 11:54
@dyudyunov
Copy link
Copy Markdown
Contributor Author

@mariajgrimaldi hi

failing tests all have the following error:

Run sudo /etc/init.d/mongodb start
sudo: /etc/init.d/mongodb: command not found
Error: Process completed with exit code 1.

It seems to be a general error connected to test runs. I can't find anything that could break the tests in this PR.

@mariajgrimaldi
Copy link
Copy Markdown
Member

Now there's a new error: https://github.com/openedx/edx-platform/runs/7032568957?check_suite_focus=true#step:10:78
Those test failures match the errors in the last merge targeting maple.master:
https://github.com/openedx/edx-platform/runs/6906637249?check_suite_focus=true#step:10:78

I'll research what could have happened

@mariajgrimaldi
Copy link
Copy Markdown
Member

Those failures are not related to the PR, it might be cache related? The library that's failing isn't even in the requirements for master.maple, it was added to master a few weeks ago in this PR.

What do you usually do when there's a cache situation with a requirement? @natabene

@mariajgrimaldi
Copy link
Copy Markdown
Member

Can we rebase again to trigger the tests? @dyudyunov

Fix for an error related to endless recursion

Dev Notes:
The student gets the passing grade
-> CourseGradeFactory sends the `COURSE_GRADE_NOW_PASSED` signal after the grade calculation
-> `listen_for_passing_grade` receives the signal and calls `generate_certificate_task`
-> `generate_certificate_task` calls `_generate_regular_certificate_task`
-> `_generate_regular_certificate_task` trying to get grade by calling the `_get_course_grade`
-> `_get_course_grade` calls `CourseGradeFactory().read()` but I have persistent grades off, so actually that ends with `CourseGradeFactory().update()`
-> `CourseGradeFactory().update()` sends the `COURSE_GRADE_NOW_PASSED`
And so on
@dyudyunov dyudyunov force-pushed the dyudyunov/maple/fix-certificate-generation-without-persistent-grades branch from 461aa5d to b26343a Compare July 13, 2022 07:13
@dyudyunov
Copy link
Copy Markdown
Contributor Author

Now the test errors say:

  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/learner_pathway_progress/signals.py", line 10, in <module>
    from learner_pathway_progress.utilities import (
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/learner_pathway_progress/utilities.py", line 9, in <module>
    from openedx.core.djangoapps.catalog.utils import check_catalog_integration_and_get_user, get_catalog_api_base_url
ImportError: cannot import name 'get_catalog_api_base_url' from 'openedx.core.djangoapps.catalog.utils' (/runner/_work/edx-platform/edx-platform/openedx/core/djangoapps/catalog/utils.py)

The interesting part is that learner-pathway-progress seems to be added in the master branch, but not to the open-release/maple.master. I can run tests locally without issues too.

@mariajgrimaldi do you know anything about this? How can I help with fixing it?

@mariajgrimaldi
Copy link
Copy Markdown
Member

I believe it is a cache issue. Let me research a bit more to see if this has happened before.

@mariajgrimaldi
Copy link
Copy Markdown
Member

Update: I left a comment asking about this in the BTR wg in charge of release branches

@kdmccormick
Copy link
Copy Markdown
Member

@mariajgrimaldi I agree that the test failures seem to be cache-related -- perhaps the edX-hosted unit test runners are leaking some state between this branch's build and the master branch's build. I have to admit that I don't how I would fix it... I will try to find someone at edX to take a look at the problem.

In the meantime, though, I don't want this PR to have to remain stuck for much longer. If we could confirm in some other way that the changes here pass the unit testing suite, then I could force-merge this PR despite the testing errors.

@mariajgrimaldi or @dyudyunov , could one of you please:

  • push the open-release/maple.master branch to your own organization's fork of edx-platform
  • open this PR against your fork's open-release/maple.master branch

That would cause the unit test suite to run using GitHub-hosted runners instead of edX-hosted runners. If the test suite passed on the fork PR, then I would be happy to merge this PR despite the caching issues here.

@mariajgrimaldi
Copy link
Copy Markdown
Member

Thanks for the insight & the help @kdmccormick!

@dyudyunov can you run the tests with gh-hosted runners as Kyle mentioned? Thank you 🙏

@dyudyunov dyudyunov force-pushed the dyudyunov/maple/fix-certificate-generation-without-persistent-grades branch from b26343a to 9e7d617 Compare August 1, 2022 11:44
@dyudyunov
Copy link
Copy Markdown
Contributor Author

dyudyunov commented Aug 1, 2022

@mariajgrimaldi I've opened the PR in our fork, but unit test jobs are stacked in the Queued status for more than 3 hours for now. I'll try to find the reason when having some free time. Give me a clue if any))

PS: I've tried to restart jobs - I've got the same result - same jobs passed and same jobs stacked in the Queued state

@mariajgrimaldi
Copy link
Copy Markdown
Member

mariajgrimaldi commented Aug 1, 2022

@dyudyunov you might need to change this line to ubuntu-20.04, but that might fail as well for missing packages. But at least you could get pass that error

@dyudyunov
Copy link
Copy Markdown
Contributor Author

@dyudyunov you might need to change this line to ubuntu-20.04

I'll try, thanks

@dyudyunov dyudyunov force-pushed the dyudyunov/maple/fix-certificate-generation-without-persistent-grades branch 6 times, most recently from 2edccab to 5225be6 Compare August 1, 2022 16:18
@mariajgrimaldi
Copy link
Copy Markdown
Member

Let me know if that worked for you @dyudyunov

@dyudyunov
Copy link
Copy Markdown
Contributor Author

@mariajgrimaldi

@dyudyunov you might need to change this line to ubuntu-20.04, but that might fail as well for missing packages. But at least you could get pass that error

your suggestion works but I've got problems with pip installing packages. Need more time to fix.

Let me know if that worked for you @dyudyunov

I'll ping you when I have any results, but I don't know when I'll find time for it

@mphilbrick211
Copy link
Copy Markdown

Hi @dyudyunov! Just checking in to see if you are planning to pursue this PR? If so, looks like you will need to re-run some failing tests. Thanks!

@mphilbrick211 mphilbrick211 added the waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. label Dec 16, 2022
@dyudyunov dyudyunov force-pushed the dyudyunov/maple/fix-certificate-generation-without-persistent-grades branch from 5225be6 to b87ba33 Compare December 19, 2022 08:46
@openedx-webhooks openedx-webhooks removed the waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. label Dec 19, 2022
@dyudyunov
Copy link
Copy Markdown
Contributor Author

hi, @mphilbrick211

Considering these changes are already in the master and maple is no longer supported I believe there is no reason to spend more time on this. Feel free to close it

@mphilbrick211
Copy link
Copy Markdown

Closing per author.

@openedx-webhooks
Copy link
Copy Markdown

@dyudyunov Even though your pull request wasn’t merged, please take a moment to answer a two question survey so we can improve your experience in the future.

@GlugovGrGlib GlugovGrGlib deleted the dyudyunov/maple/fix-certificate-generation-without-persistent-grades branch September 5, 2023 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants