Skip to content

ficus/develop update ficus/master - #172

Merged
bryanlandia merged 23 commits into
appsembler/ficus/masterfrom
appsembler/ficus/develop
Oct 20, 2017
Merged

ficus/develop update ficus/master#172
bryanlandia merged 23 commits into
appsembler/ficus/masterfrom
appsembler/ficus/develop

Conversation

@bryanlandia

Copy link
Copy Markdown

Let's see if we can get appsembler/ficus/master updated with some of the latest changes. Looks like we've got...

  • interim badges/Badgr integration fix (@bryanlandia)
  • user update API endpoint (@melvinsoft)
  • fix external courses task dotted path (@melvinsoft)
  • allow setting HTTPS to off with aws_appsembler env (@bryanlandia)
  • set MEDIA_ROOT, MEDIA_URL for CMS too (SCORM XBlock-related) (@bryanlandia)
  • update JS to support multichoice advanced settings fields (@bryanlandia)

bryanlandia and others added 13 commits August 31, 2017 13:11
when only a single course in course group
backend slugs no longer generated from component and submitted slug
because Badgr.io creates its own uuid-based slugs now
BadgeClasses unique by slug, and also by course mode w/ course id
Criteria passed to Badgr as criteria_text or criteria_url depending
look up Badge Classes by slug if passed or if not by mode + id
fix in case custom form doesn't exists

docs for the new endpoint

remove prints

check email integrity
…point-new-user-update-endpoint

new user update endpoint
…es-fix-badgr-integration

Fixes for Badgr.io badges integration
…edia-root

specify media root in CMS and allow http scheme in aws_appsembler by env token
…ultichoice-adv-settings

Update advanced settings JS to multichoice settings fields

@OmarIthawi OmarIthawi left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Not sure what to do here, since the changes have already been reviewed, no?

@bryanlandia

Copy link
Copy Markdown
Author

@OmarIthawi Yes, everything has been reviewed. I'm just requesting a review as a final sanity check, but wouldn't expect anybody to need to go over it really closely. Since there are no conflicts we are probably good to go.

@tkeemon tkeemon left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'd just like a quick clarification before I approve.

Comment thread cms/envs/aws_appsembler.py Outdated
MEDIA_ROOT = '/edx/var/edxapp/media'
MEDIA_URL = '/media/'

HTTPS = ENV_TOKENS.get('BASE_SCHEME', 'https').lower() == 'http' and 'off' or 'on'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I have a few issues with this line:

  • It took me a few tries to parse it and figure out exactly what is being assigned here. If BASE_SCHEME is http, then HTTPS = off but if it's anything else, then HTTPS = on. I know it's a bit ugly, but can it be rewritten in a more Pythonic way:
HTTPS = 'on' if ENV_TOKENS.get('BASE_SCHEME', 'https').lower() == 'https' else 'off'

I think this makes the conditional more readable and show the expected value of HTTPS = 'on'.

  • I can't find BASE_SCHEME defined anywhere. I've checked Configuration, edx-configs, and a few customer edxapp JSON files. Is this actually being used anywhere?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

On a related note, wouldn't this variable be better as a boolean instead of having a value of on/off?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks @tkeemon - I defined BASE_SCHEME here https://github.com/noderabbit-team/edx-configs/blob/tkeemon/nyif-ficus-staging/nyif-ficus/staging/files/server-vars.yml#L155

The edxapp role in configuration repo only defines EDXAPP_LMS_BASE_SCHEME for some reason—so, not defined for CMS. I added this in order to be able to specify http/https for CMS as well. Most of the time we will want https here, so I kept it as a kind of optional addition to EDXAPP_ENV_EXTRA.

Agree as far as Boolean vs string but I'm just following what's been done so far in edx-platform. As far as the syntax of that line, I guess that's how I've always done ternaries in Python. I didn't realize it was that uncommon.

If these things are important to fix they should be made with a new PR to the /develop branch. I was trying to get them into /master as they'd been approved.

@OmarIthawi OmarIthawi Oct 12, 2017

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@tkeemon: On a related note, wouldn't this variable be better as a boolean instead of having a value of on/off?

The HTTPS=on it looks like something from wsgi, so it should be fine to keep it as is! Besides it's an OS env variable (AFAIK) and there are no booleans in that land, on string citizens are allowed 😄

@bryanlandia: Agree as far as Boolean vs string but I'm just following what's been done so far in edx-platform. As far as the syntax of that line, I guess that's how I've always done ternaries in Python. I didn't realize it was that uncommon.

It's indeed not Pythonic at all. I should've noticed that. I really don't think it's a big deal. But you're welcome to PR it.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@tkeemon @OmarIthawi

I know it's a bit ugly, but can it be rewritten in a more Pythonic way

Thanks for pointing out the errors in my ways. I've done it the other way so long it's just habit now. I'd prefer to just keep it as is and not make a new PR, as we are trying to get a large batch of changes merged to /master and I don't want to further complicate this now.

@bryanlandia

Copy link
Copy Markdown
Author

@tkeemon I updated the conditionals for setting HTTPS value in */envs/. Merging.

@bryanlandia
bryanlandia merged commit ce31329 into appsembler/ficus/master Oct 20, 2017
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.

4 participants