-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: add picasso commands in simple way #2
Conversation
6e9c13c
to
c544e98
Compare
b0c99b2
to
dceae00
Compare
dceae00
to
c740aa4
Compare
6d5ab6f
to
4d3bf9f
Compare
4d3bf9f
to
f977bd3
Compare
8d842b4
to
924b175
Compare
83239a9
to
6b384ad
Compare
d07a938
to
a078a8b
Compare
I forget to mention this important proposal change: I proposed to change the structure of the input: DISTRO_MY_PACKAGE_NAME_DPKG:
index: git
name: eox-package # directory name
# ---- git package variables
repo: eox-package # git repository name
domain: github.com
path: eduNEXT
protocol: ssh
# ---- end git package variables
version: master
private: true
variables:
development: {}
production: {} PICASSO_<YOUR_PACKAGE_NAME>_DPKG:
name: <your_package_name>
repo: <your SSH URL for cloning the repo. e.g., [email protected]:yourorg/package.git>
version: <your branch, tag o release for cloning. e.g., v5.2.0> DISTRO_THEMES:
- domain: github.com
name: my-theme
path: my-account
protocol: ssh
repo: my-openedx-theme
version: release-compatible PICASSO_THEMES:
- name: <your_theme_name>
repo: <your SSH URL for cloning the repo. e.g., [email protected]:yourorg/theme.git>
version: <your branch, tag o release for cloning. e.g., edunext/redwood.master>
- name: <another_theme_name>
repo: <your SSH URL for cloning the repo. e.g., [email protected]:yourorg/another_theme.git>
version: <your branch, tag o release for cloning. e.g., edunext/redwood.blue> |
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 left a few other suggestions for you to review and apply if you see fit. Thank you so much for addressing all my previous comments! Great work here :)
Thank you, @MaferMazu. Your proposal #2 (comment) looks way cleaner than what we currently use, so I have no objections. |
1e326cf
to
e1ad584
Compare
Hello goodnight, I was following the instructions to test this plugin on the last redwood version (18.1.3) and when I try to enable the plugin using tutor plugins enable picasso I get the following error: tutor plugins enable picasso However, when I do tutor plugins list I do see the plugin installed. |
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'll leave my approval once these last suggestions are addressed. Thank you!
context = click.get_current_context().obj | ||
tutor_root = context.root | ||
tutor_conf = tutor_config.load(tutor_root) | ||
|
||
tutor_version_obj = Version(tutor_version) | ||
# Define Quince version as the method for installing private packages changes from this version | ||
quince_version_obj = Version("v17.0.0") | ||
|
||
# Use these specific paths as required by Tutor < Quince | ||
private_requirements_root = f"{tutor_root}/env/build/openedx/requirements" | ||
packages = get_picasso_packages(tutor_conf) | ||
|
||
# Create necessary directory if it doesn't exist | ||
if not os.path.exists(private_requirements_root): | ||
os.makedirs(private_requirements_root) | ||
|
||
for package, info in packages.items(): | ||
if not {"name", "repo", "version"}.issubset(info): | ||
raise click.ClickException( | ||
f"{package} is missing one of the required keys: 'name', 'repo', 'version'" | ||
) | ||
|
||
if os.path.isdir(f'{private_requirements_root}/{info["name"]}'): | ||
subprocess.call( | ||
["rm", "-rf", f'{private_requirements_root}/{info["name"]}'] | ||
) | ||
|
||
subprocess.call( | ||
["git", "clone", "-b", info["version"], info["repo"]], | ||
cwd=private_requirements_root, | ||
) | ||
|
||
if tutor_version_obj < quince_version_obj: | ||
private_requirements_txt = f"{private_requirements_root}/private.txt" | ||
_enable_private_packages_before_quince(info, private_requirements_txt) | ||
else: | ||
_enable_private_packages(info, private_requirements_root) |
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.
What do you think about doing something like this: 7c6ccc3.
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.
[nit] We're using both packages and requirements in naming. Could we decide whether to use packages or requirements?
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.
Thanks a lot. I applied 7c6ccc3 and also refactored a little bit the names of the functions.
Regarding naming, I propose that in the context of Picasso, we use the name package (to read the package information and enable packages, but for the context of Tutor, we use the name requirements); I don't know if there is a good place to put it.
I maintained the package command to avoid being so far to tutor-contrib-edunext-distro
; but later, we can question the use of package instead of requirements.
"Take a look at the official Tutor commands: " | ||
"https://docs.tutor.edly.io/reference/cli/index.html" | ||
) | ||
return error_message |
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.
question: if multiple commands have errors, will this only return the first it encounters? what if returns them all 87e8503?
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.
Thanks for this. I applied 87e8503 and applied a little fix. You can check and verify if everything is okay.
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.
@MaferMazu, thanks a lot for this PR. I only pointed out some minor things
Co-authored-by: Brayan Cerón <[email protected]>
1540bd4
to
0203763
Compare
@Asespinel, I couldn't replicate the error. Step by step in local (It works): tvm project init picasso_v1813 v18.1.3
cd picasso_v1813/
source .tvm/bin/activate
pip install git+https://github.com/eduNEXT/tutor-contrib-picasso@mfmz/simple-picasso
tutor plugins enable picasso Also, in the integration test, we test this plugin in Tutor == 18.1.3 in the <19.0.0 integration test. For more information: https://github.com/eduNEXT/tutor-contrib-picasso/actions/runs/10532688714/job/29187320715 (Or you can check the <19.0.0 integration test) Please let me know if the problem persists. |
9cf3ec5
to
5d8dc5b
Compare
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.
Thank you so much for addressing all my comments. LGTM!
@Asespinel I already fix the problem. I couldn't replicate it before because I was using Python 3.10, and the issue was for version < 3.9. It was because I couldn't call |
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.
LGTM! 👯
Description
This PR simply adds the following commands:
For more information on how the plugin does it, follow the README.
How to test
Integration Tests
They are in the workflows.
Manually
Support
✅ Tested in Redwood, Quince, Palm, and Olive.
Warning
We recommend Quince >= v17.0.3 because add an important fix related to the
enable-private-package
command. Ref: overhangio/tutor#1016Warning
If you want to use tutor plugin indexes, you need an Olive tutor version >= 15.3.0. (With this plugin the tutor plugin indexes is the only way to install other tutor plugins)
Important notes, and I want your feedback about it
My proposal here does not follow the release convention of the tutor plugin. To avoid major release when it is not needed. Another plugin with this system is Aspects: https://github.com/openedx/tutor-contrib-aspects. So, this plugin should be compatible with Palm and Quince.
Another proposal is only having those three commands. The
syntax-validator
andrepository-validator
don't add functionality to the build. If we want to still use it, we can use it in the GA or Jenkins pipeline through the scripts we have here: https://github.com/eduNEXT/dedalo-scripts/tree/main/jenkins.Another important change is I proposed to change the structure of the input: