Skip to content

Conversation

@olmar
Copy link
Contributor

@olmar olmar commented Dec 23, 2013

Refactor stub implementation of LTI Provider.

Issue: https://edx-wiki.atlassian.net/browse/BLD-601.

@auraz please review.
@wedaly please review.

Copy link
Contributor

Choose a reason for hiding this comment

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

Don't commit commented-out code to the repository.

@olmar
Copy link
Contributor Author

olmar commented Dec 30, 2013

@wedaly I`m looking for how it possible to launch such stubs manually. Do you know smth about it?

Copy link
Contributor

Choose a reason for hiding this comment

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

The superclass defines a send_response method that accepts a headers kwarg. You should use that to send the headers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@wedaly
Copy link
Contributor

wedaly commented Jan 9, 2014

  1. Take another look at the StubHttpService base class -- you can re-use the helper methods defined there instead of re-implementing them in the subclass.

  2. I don't understand why the stub needs different configuration for unit/acceptance/manual testing. For unit tests, you should use mock.patch to mock requests.post. I don't understand why manual testing is handled as a separate case.

  3. Please check for pylint/pep8 style violations.

  4. Rebase onto master and resolve merge conflicts.

Please let me know when you're ready for me to take another look.

@wedaly
Copy link
Contributor

wedaly commented Jan 9, 2014

In terms of starting the server manually, you can add a short Python script that starts the server on a particular port. I'd recommend adding this directly in common/djangoapps/terrain/stubs/lti.py for now. It should look something like this:

 if __name__ == "__main__":
     service = StubLtiService()
     service.start()
     try:
          while true:
               pass
     except KeyboardInterrupt:
          service.shutdown()
          exit(0)

@wedaly
Copy link
Contributor

wedaly commented Jan 10, 2014

It looks like the LTI module is setting the hostname for the callback URL here:

https://github.com/edx/edx-platform/blob/master/common/lib/xmodule/xmodule/lti_module.py#L284-L299

It's setting it based on the XBlock's self.system.hostname property. This, in turn, looks like it's configured using Django settings:

https://github.com/edx/edx-platform/blob/master/lms/djangoapps/courseware/module_render.py#L391

We have SITE_NAME set to localhost in the sandbox, so it should be safe to change it to localhost in dev and devstack settings as well. I'd prefer to configure this in settings rather than within the stub server.

@olmar
Copy link
Contributor Author

olmar commented Feb 3, 2014

@wedaly please continue review.

Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like a private method; if so, it should have an underscore in front to denote that:

_create_content

Copy link
Contributor Author

Choose a reason for hiding this comment

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

made method to be private

@wedaly
Copy link
Contributor

wedaly commented Feb 3, 2014

I made some style comments, and I'm still unsure about explicitly setting http/https for the test environment. You'll also need to rebase and fix merge conflicts.

Please let me know when you're ready for another round of review.

@olmar
Copy link
Contributor Author

olmar commented Feb 4, 2014

@auraz this PR involves some changes to LTI Module also. Please review.

@olmar
Copy link
Contributor Author

olmar commented Feb 4, 2014

@wedaly please continue review.

@wedaly
Copy link
Contributor

wedaly commented Feb 4, 2014

👍 but please squash your commits before merging.

Copy link
Contributor

Choose a reason for hiding this comment

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

a) add comment why we do this
b) please remove changes to quoting

Copy link
Contributor

Choose a reason for hiding this comment

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

same issue with quotes

@auraz
Copy link
Contributor

auraz commented Feb 6, 2014

Please fix small comments and 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

SITE_NAME = 'localhost:{}'.format(LETTUCE_SERVER_PORT)

olmar added a commit that referenced this pull request Feb 11, 2014
Refactor stub implementation of LTI Provider. BLD-601.
@olmar olmar merged commit 1d517bd into master Feb 11, 2014
@olmar olmar deleted the oleg/lti_stub_refactor branch February 11, 2014 12:32
jenkins-ks pushed a commit to nttks/edx-platform that referenced this pull request Sep 22, 2017
* Add menu to ga_operation for ga_analyzer openedx#2039 (openedx#2088)

* add role for old course viewer openedx#2062 (openedx#2087)

* add role for old course viewer openedx#2062

* Change action for biz course by BetaTester role openedx#2062

* Construction of image server openedx#2025 (openedx#2106)

* cherry-pick 8c8953f

* Fix file upload in IE

* Construction of image server openedx#2025

* add all keywords search in Student management openedx#2029 (openedx#2034)

* Fix bug for before enrollment start in ga old course viewer openedx#2062 (openedx#2125)

* fix. Construction of image server openedx#2025 (openedx#2117)

* Modify message and css of enrollment for Course About openedx#2130

* Add a certificate list to user's profile page. openedx#2042 (openedx#2108)

* Mod UT openedx#2130

* add PDF File Construction of image server openedx#2025 (openedx#2140)

* add library option, and library links to the course. openedx#2001 (openedx#2124)

* Invalid StudioPermissionsService object in API to show/save xblock settings in CMS.
Randomized Content Block editor did not check Studio user's permissions

* add library option, and library links to the course. openedx#2001

* fix. add all keywords search in Student management openedx#2029 (openedx#2034) (openedx#2157)

* second fix. Construction of image server openedx#2025 (openedx#2158)

* add library option, and library links to the course. openedx#2001 (openedx#2160)

* third fix. Construction of image server openedx#2163 (openedx#2164)

* Add filter by category for certificates on profile page openedx#2042 (openedx#2165)

* Fix bug for  add library option, and library links to the course. openedx#2162 openedx#2133 (openedx#2167)

* Develop/dogwood/gacco201708 (openedx#2170)

* Fixed bugs openedx#2039 (openedx#2112)

* Fixed csv format openedx#2039 (openedx#2127)

* Change to split download if there are many display items openedx#916 (openedx#2121)

* Change to split download if there are many display items openedx#916

* Fix UT

* Fix Review

* Fix review2
shimulch pushed a commit to open-craft/openedx-platform that referenced this pull request Jan 26, 2021
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.

5 participants