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

feat: replace rest_framework_swagger with drf_yasg #1502

Closed
wants to merge 2 commits into from

Conversation

NeOneSoft
Copy link
Contributor

This PR was created following edx/upgrades#17 to switch django rest swagger to drf-yasg

@NeOneSoft NeOneSoft requested a review from a team as a code owner December 15, 2021 19:42
@openedx-webhooks openedx-webhooks added needs triage open-source-contribution PR author is not from Axim or 2U labels Dec 15, 2021
@openedx-webhooks
Copy link

openedx-webhooks commented Dec 15, 2021

Thanks for the pull request, @NeOneSoft! I've created OSPR-6284 to keep track of it in JIRA, where we prioritize reviews. 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.

urlpatterns = oauth2_urlpatterns + [
re_path(r"^admin/", admin.site.urls),
re_path(r"^api/", include(("credentials.apps.api.urls", "api"), namespace="api")),
re_path(r"^api-auth/", include((oauth2_urlpatterns, "rest_framework"), namespace="rest_framework")),
re_path(r"^api-docs/", get_swagger_view(title="Credentials API"), name="api_docs"),
re_path(r"^api-docs/$", schema_view.with_ui('swagger', cache_timeout=0), name="api_docs"),,
Copy link
Contributor

Choose a reason for hiding this comment

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

@NeOneSoft Looks like we may have an extra comma here that is causing issues the config files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@justinhynes Thank you so much!!!

Copy link
Contributor

@justinhynes justinhynes left a comment

Choose a reason for hiding this comment

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

@NeOneSoft I think we're really close getting this PR wrapped up. It looks like we're running into a few quality issues. We should be able to use our existing tools to automate the fixes. Locally you can try running:
make isort - this should fix the error with the imports in the wrong order, then
black . - (note the period) black is a code formatter used in this repo to keep syntax common across all files.

From there you can run make quality locally to have isort/black/pylint run to point out any other potential quality issues.

I think after this we should be good to squash and merge the changes. :)

@NeOneSoft
Copy link
Contributor Author

@justinhynes !!!!Thank you so much for you instructions and support. I already apply the suggested commands and once our quality issues were checked I will be doing squash!!

@NeOneSoft
Copy link
Contributor Author

Hey@justinhynes!! after apply isort, black and quality we're still having and import issue on copy_catalog.py file but I think that the sort is correct.

@justinhynes
Copy link
Contributor

@NeOneSoft I'm sorry this is such a pain in the neck! I definitely didn't expect 126 files to be updated. I'm curious as to what is going on here. Going to take some extra time to think this through... thanks for your patience.

@NeOneSoft
Copy link
Contributor Author

No problem @justinhynes!!!!I'll be attending your comments, thanks again for all your support!!

@justinhynes
Copy link
Contributor

@NeOneSoft Hey there! Apologies that I haven't been able to return and triage your issues any further. I am wrapping up my day here soon and actually am off until January. If it's okay with you, we can try and get this sorted out shortly after the new year. Thanks for understanding and talk soon!

@NeOneSoft
Copy link
Contributor Author

Thank you so much @justinhynes, enjoy and happy holidays!!!!

@natabene
Copy link

@NeOneSoft Thanks so much for your contribution. @justinhynes Thank you for reviewing!

@hurtstotouchfire hurtstotouchfire self-requested a review March 18, 2022 20:26
@hurtstotouchfire
Copy link
Member

Hey @NeOneSoft, I'd like to get this merged but I think we will need to reduce the number of touched files. Are you able to rebase and do some commit cleanup? I would like to see 5f2d5ca fixed up to the commit before it (just in case we end up dividing up this PR, I don't want that fixup to be separated from the commit it fixes) and then pull out 93db679 for the time being. You could stash it in another branch for now, and then we can determine if we want to pull some of it in piecemeal. Does that sound doable?

@NeOneSoft
Copy link
Contributor Author

NeOneSoft commented Mar 22, 2022

Hi @hurtstotouchfire , thanks for your review I think that in the last fix I touched many files so I'll do you the cleanup for this as you mentioned to move forward.

@natabene
Copy link

natabene commented Apr 1, 2022

@NeOneSoft Please let us know once you are ready for this to be reviewed again.

@NeOneSoft
Copy link
Contributor Author

Hi @natabene of course, I'll be working on it this week!

@NeOneSoft
Copy link
Contributor Author

Hi @hurtstotouchfire!!,Are you agree if I store the changes of 94db679in another branch as you suggested and then I reset and squash to 5f25ca?Thanks in advance

feat: modify settings base.py and url.py files

feat: remove an extra comma from urls.py file

feat: resolve conflicted files

feat: resolve remaining conflicted files

feat: resolve conflicted files and requirment versions
Copy link
Member

@hurtstotouchfire hurtstotouchfire left a comment

Choose a reason for hiding this comment

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

As long as @justinhynes has no blocking concerns I think this is good to go from our perspective. I think you may need to resolve conflicts though.

@hurtstotouchfire hurtstotouchfire self-assigned this May 31, 2022
@justinhynes
Copy link
Contributor

justinhynes commented May 31, 2022

Hey @NeOneSoft,

I was taking another look at this and I think I found one final complaint. It looks like you did the right steps to add drf_yasg to the base.in file, and you added that package to the installed_apps list in base.py. However, it looks like the package dependency is missing from the requirements base.txt file.

Please run make upgrade locally. This make target will regenerate the requirements text files and will pull in the new drf_yasg package. Afterwards, please push these updated files to this PR.

Otherwise, if we were to merge this, the service won't come up successfully as the drf_yasg requirement won't be installed (but will be listed as a required app, which will cause an error).

So, to summarize:

  1. Run make upgrade locally
  2. Confirm that drf_yasg==<some_version> appears in the base.txt requirements file
  3. Push those changes to this PR

Afterwards, as long as all the tests pass, we should be good to go!

Copy link
Contributor

@justinhynes justinhynes left a comment

Choose a reason for hiding this comment

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

The drf_yasg package is missing from the base.txt file and will cause an issue if not included. Please see my latest comment on your PR to fix this issue. Thanks!

@NeOneSoft
Copy link
Contributor Author

Hi @justinhynes !!Thanks a lot for your review. I already run the commands are you suggested. I'll be glad to attend your comments and thanks again

@justinhynes
Copy link
Contributor

@NeOneSoft Great, thank you for those changes. I took a look and it looks good to go. I'm going to approve the PR.

@tuchfarber
Copy link
Contributor

🎉

@hurtstotouchfire
Copy link
Member

Hmmmm we have merge conflicts again. Sorry @NeOneSoft this tends to happen when there are dependency updates because we are also merging update PRs so they tend to conflict.

@NeOneSoft
Copy link
Contributor Author

No worries @hurtstotouchfire !!!, should we wait to get updated all our dependencies before apply make upgrade again?

@hurtstotouchfire
Copy link
Member

@NeOneSoft I had one more update PR to merge which may or may not conflict for you but after this you should be good to go.

This is the PR: #1689

Let us know when you're de-conflicted!

@NeOneSoft
Copy link
Contributor Author

Hi @hurtstotouchfire!!, I had errors rebasing this branch so I created a new one on PR with exactly the same changes but starting from updated master. I think that this should be solve the conflicts. For last, could you please review it to be sure that everything it's ok?. For know titled as "draft" but I will change it once this is ready for merge. Thanks a lot !!

@NeOneSoft
Copy link
Contributor Author

This PR can be closed on behalf of PR where the required changes were done and some issues regarding python 3.8 dependencies where solved. Thanks everyone for your all your support!!!!

@NeOneSoft NeOneSoft closed this Jun 29, 2022
@openedx-webhooks
Copy link

@NeOneSoft 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.

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.

6 participants