Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Support externally hosted comprehensive themes #2676

Merged
merged 2 commits into from
Feb 12, 2016

Conversation

fghaas
Copy link
Contributor

@fghaas fghaas commented Jan 6, 2016

The old Stanford-style themes can be pulled in from an external Git repo; no such provision was previously available for comprehensive themes.

  • Introduce two new configuration variables:
    • EDXAPP_COMPREHENSIVE_THEME_SOURCE_REPO: Git repo for the comprehensive theme
    • EDXAPP_COMPREHENSIVE_THEME_VERSION: Git branch, tag, or revision to check out from the repo
  • Introduce a new task, "checkout comprehensive theme", doing the equivalent of the previously existing "checkout theme" task. Check out the theme repo to EDXAPP_COMPREHENSIVE_THEME_DIR. If
    EDXAPP_COMPREHENSIVE_THEME_SOURCE_REPO is unset, continue to assume that EDXAPP_COMPREHENSIVE_THEME_DIR already exists and is populated with a comprehensive theme.
  • Rename the "checkout theme" task to "checkout Stanford-style theme".

@openedx-webhooks
Copy link

Thanks for the pull request, @fghaas! I've created OSPR-1063 to keep track of it in JIRA. JIRA is a place for product owners to prioritize feature reviews by the engineering development teams.

Feel free to add as much of the following information to the ticket:

  • supporting documentation
  • edx-code email 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 still be done via the GitHub pull request interface. As a reminder, our process documentation is here.

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U needs triage labels Jan 6, 2016
@nedbat
Copy link
Contributor

nedbat commented Jan 6, 2016

@singingwolfboy will have opinions on this.

@singingwolfboy
Copy link
Contributor

I am way, way in favor of the idea behind this change. We would love to move the edx.org and edge.edx.org themes out of the edx-platform repository, and into their own repositories. Similarly, others should be able to have themes that are separate repositories, particularly because a theme will have lots of trademarked content like logos, and the website operator will probably want to keep that content private.

I can't provide a thumbs-up or thumbs-down on this pull request, since I'm not familiar with the configuration repo, and I don't understand how this code works. But conceptually, this is a very, very good idea.

@mattdrayer
Copy link
Contributor

@ziafazal, FYI

@@ -83,7 +83,7 @@
- install
- install:code

- name: checkout theme
- name: checkout Stanford-style theme
Copy link
Contributor

Choose a reason for hiding this comment

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

@fghaas I'm with @singingwolfboy in that I don't have a solid understanding of the configuration aspect of the platform works. That said, I'm wondering if it's possible to change the name here to something more generic, versus "Stanford-style"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mattdrayer The only authoritative resource on comprehensive theming that I've been able to find is https://github.com/edx/edx-platform/blob/master/themes/README.rst, and it refers to the opposite of comprehensive themes as "Stanford" theming (https://github.com/edx/edx-platform/blob/master/themes/README.rst#stanford-theming). Confusing as theming already is, I'd prefer not to invent a new term for the sole purpose of being more generic.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@singingwolfboy Good to know, thanks.

Copy link
Contributor

Choose a reason for hiding this comment

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

@fghaas -- Okay, I've read thru all of the docs and I now agree that sticking with "Stanford-style" makes sense here. Can you please include a comment with the URL pointing to the related section of the README.rst and then this changeset should be good to go.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mattdrayer You mean a comment right there in the playbook YAML? Or somewhere else?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, I'd put it right there in the YAML file, just so people know where to look for more info when they come across that section.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mattdrayer Done.

@mattdrayer
Copy link
Contributor

Nice, this looks great to me now -- thanks very much @fghaas! 👍

@fghaas
Copy link
Contributor Author

fghaas commented Jan 12, 2016

Thanks @mattdrayer, do you still need to remove or add some tags so this gets merged?

@mattdrayer
Copy link
Contributor

@fghaas I'm not sure who is responsible for merging changes to edx/configuration (maybe it's me!) -- @feanil or @fredsmith do you have any advice to lend?

@fredsmith
Copy link
Contributor

@fghaas - the fact that you're re-using edxapp_git_ssh means that you'll be reusing the credentials that you use for checking out edxapp. eg. if you have a private theme and a public edxapp, this won't work. You should set this as a separate variable that defaults to edxapp_git_ssh.

Also, I think the EDXAPP_COMPREHENSIVE_THEME_DIR should have a more useful default, probably based on {{ edxapp_app_dir }} @edx/devops any other comments?

@fghaas
Copy link
Contributor Author

fghaas commented Jan 13, 2016

@fredsmith, re edxapp_git_ssh you'll notice that the pre-existing task for checking out a Stanford theme does exactly the same thing. Are you saying that's broken too?

fghaas referenced this pull request in open-craft/edx-platform Jan 14, 2016
Collectstatic failed in production when comprehensive theme contained custom css files.
This change fixes that problem.

Comprehensive theme static dirs are added to the top of the STATICFILES_DIRS entry,
which means that the default django FilesystemFinder will find theme static files,
and since the theme folder is at the top of STATICFILES_DIRS, theme files will take
precedence over default LMS/CMS static files.

This change means that theme static file URLs are no longer prefixed with themes/<theme-name>/,
but since we currently only support one comprehensive theme at a time, that shouldn't be a problem.
If/when we want to make the choice of a theme dynamic per-request (microsites?), we will have to
bring custom theme finders and storage mixins back, but for now, we don't need them.
@openedx-webhooks openedx-webhooks added waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. awaiting prioritization and removed waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. labels Jan 15, 2016
@fghaas
Copy link
Contributor Author

fghaas commented Jan 25, 2016

@fredsmith Just letting you know that I'm still waiting for an answer here.

@fredsmith
Copy link
Contributor

@fghaas yes, the existing play is also broken in this way. I suppose if it's not an issue for you, and it's not an issue for us, we can wait until it's an issue for someone before we implement the additional complexity of more data structures. @feanil thoughts?

@stvstnfrd
Copy link
Contributor

@fghaas @fredsmith Re: The playbook for Stanford Theme

FWIW: We use this play successfully with a public platform and private theme, setting values:

EDXAPP_USE_GIT_IDENTITY: true
EDXAPP_GIT_IDENTITY: WOULDNT_YOU_LIKE_TO_KNOW

@jbarciauskas
Copy link
Contributor

@fredsmith @feanil what's the next step here?

@feanil
Copy link
Contributor

feanil commented Feb 2, 2016

@jbarciauskas I'm hoping to do a review of this today or tomorrow but I'm on call this week so my schedule is a bit unpredictable.

@jbarciauskas
Copy link
Contributor

Understood, thanks!

The old Stanford-style themes can be pulled in from an external Git
repo; no such provision was previously available for comprehensive
themes.

* Introduce two new configuration variables:
- EDXAPP_COMPREHENSIVE_THEME_SOURCE_REPO: Git repo for the
  comprehensive theme
- EDXAPP_COMPREHENSIVE_THEME_VERSION: Git branch, tag, or revision to
  check out from the repo

* Introduce a new task, "checkout comprehensive theme", doing the
equivalent of the previously existing "checkout theme" task. Check out
the theme repo to EDXAPP_COMPREHENSIVE_THEME_DIR. If
EDXAPP_COMPREHENSIVE_THEME_SOURCE_REPO is unset, continue to assume
that EDXAPP_COMPREHENSIVE_THEME_DIR already exists and is populated
with a comprehensive theme.

* Rename the "checkout theme" task to "checkout Stanford-style theme".
@fghaas fghaas force-pushed the comprehensive-theme branch from b4bc637 to 48fd551 Compare February 12, 2016 12:21
@fghaas
Copy link
Contributor Author

fghaas commented Feb 12, 2016

Now that Dogwood is out and comprehensive theming is touted as a key feature, could this perhaps be reviewed? It's only been sitting here for a month and a half.

@feanil
Copy link
Contributor

feanil commented Feb 12, 2016

👍 @fghaas sorry about that, I dropped the ball on this. It got buried in my inbox.

@fghaas
Copy link
Contributor Author

fghaas commented Feb 12, 2016

Thanks @feanil, would be great to see this merged.

@feanil
Copy link
Contributor

feanil commented Feb 12, 2016

I'll be merging it once the tests have finished running.

feanil added a commit that referenced this pull request Feb 12, 2016
Support externally hosted comprehensive themes
@feanil feanil merged commit 43e2f6f into openedx-unsupported:master Feb 12, 2016
@fghaas fghaas deleted the comprehensive-theme branch February 12, 2016 19:16
@fghaas
Copy link
Contributor Author

fghaas commented Feb 12, 2016

@feanil Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
engineering review open-source-contribution PR author is not from Axim or 2U
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants