Skip to content

fix: use tutor config on codejail service and add patches to edit it DS-894#55

Merged
MaferMazu merged 4 commits intomainfrom
mfmz/tutor-settings
May 24, 2024
Merged

fix: use tutor config on codejail service and add patches to edit it DS-894#55
MaferMazu merged 4 commits intomainfrom
mfmz/tutor-settings

Conversation

@MaferMazu
Copy link
Contributor

Description

This PR aims to solve issue #44 by changing the FLASK_APP_SETTINGS variable to use the tutor file and adding patches to edit the configuration values.

How to test it

  1. Have a tutor environment with this plugin installed and enabled.
  2. Run tutor dev/local do init --limit codejail.
  3. Create a patch with Python configurations (More info below)
  4. Run tutor config save
  5. Run tutor dev/local start codejailservice
  6. Enter in the codejailservice container and run flask shell
  7. Inside the flask shell, run app.config['NAME_OF_YOUR_VARIABLE']
  8. You should be able to see the correct value

Other information

How to create a patch

You can clone this plugin and add a file with the patch name, and inside the file, add the Python configuration. The file needs to be inside the patches folder: https://github.com/eduNEXT/tutor-contrib-codejail/tree/main/tutorcodejail/patches. You should have something like tutorcodejail/patches/codejail-common-settings, and inside:

NAME_OF_YOUR_VARIABLE = <value>    # Example: True

Or you can add the patch in another plugin following this documentation: https://docs.tutor.edly.io/tutorials/plugin.html#modifying-existing-files-with-patches

@MaferMazu MaferMazu linked an issue May 16, 2024 that may be closed by this pull request
@MaferMazu MaferMazu force-pushed the mfmz/tutor-settings branch from cd33297 to 5693dac Compare May 16, 2024 01:22
@MaferMazu MaferMazu changed the title fix: use tutor config on codejail service and add patches to edit it fix: use tutor config on codejail service and add patches to edit it DS-894 May 16, 2024
Copy link

@bra-i-am bra-i-am left a comment

Choose a reason for hiding this comment

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

Working as expected!!

Before installing this branch, the variable added with the tutor plugin does not appear among the app.config variables
image

After installing it, it appears:
image

@MaferMazu
Copy link
Contributor Author

@bra-i-am, thanks for your feedback and for noting the inconsistent information in the dev environments. I already fixed it. Can you check to make sure it worked as expected?

@bra-i-am
Copy link

@MaferMazu, thanks a lot for the fix, I confirm everything is working!

Evidence:
image

@MaferMazu MaferMazu requested a review from MoisesGSalas May 22, 2024 22:28
@MaferMazu
Copy link
Contributor Author

Thanks for the feedback. Can you review this again @MoisesGSalas?

@MaferMazu MaferMazu merged commit 03111d1 into main May 24, 2024
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.

["BUG"] tutor.py is not being used.

5 participants