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

Set edx.org theme as default for edx-platform and MFEs #67

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mfarhan943
Copy link

Description:
Automate setting the edx.org theme as the default for both the edx-platform and MFEs during devstack provisioning.

Related Ticket:
edx/edx-arch-experiments#824

@mfarhan943 mfarhan943 self-assigned this Nov 6, 2024
options.mk Outdated Show resolved Hide resolved
options.mk Outdated Show resolved Hide resolved
@mfarhan943 mfarhan943 force-pushed the farhan/default-edx-theme branch from 361136b to b2d1484 Compare November 14, 2024 15:54
@dianakhuang
Copy link
Member

@mfarhan943 are we waiting for a rereview from @adamstankiewicz or something else on this PR?

@mfarhan943
Copy link
Author

@dianakhuang Yes, we are waiting for @adamstankiewicz review.

@@ -873,6 +895,8 @@ services:
service: microfrontend
working_dir: '/edx/app/frontend-app-program-console'
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.frontend-app-program-console"
environment:
PARAGON_BRAND_PACKAGE: '@edx/brand-edx.org'
Copy link
Member

Choose a reason for hiding this comment

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

nit: @edx/brand-edx.org@2

Copy link
Author

Choose a reason for hiding this comment

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

The update file contains the value @edx/brand-edx.org@1.x, which I updated from this source.

@@ -707,6 +707,8 @@ services:
service: microfrontend
working_dir: '/edx/app/frontend-app-account'
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.frontend-app-account"
environment:
PARAGON_BRAND_PACKAGE: '@edx/brand-edx.org@@1.x'
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
PARAGON_BRAND_PACKAGE: '@edx/brand-edx.org@@1.x'
PARAGON_BRAND_PACKAGE: '@edx/brand-edx.org@1.x'

@@ -722,6 +724,8 @@ services:
service: microfrontend
working_dir: '/edx/app/frontend-app-profile'
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.frontend-app-profile"
environment:
PARAGON_BRAND_PACKAGE: '@edx/brand-edx.org'
Copy link
Member

Choose a reason for hiding this comment

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

As is, this will pull from latest, which could introducing breaking changes unintentionally if a new major version is released.

Suggested change
PARAGON_BRAND_PACKAGE: '@edx/brand-edx.org'
PARAGON_BRAND_PACKAGE: '@edx/brand-edx.org@~2.0.0'

https://github.com/edx/edx-internal/blob/b3bd6adf8407b986349272f33b37922c620d8857/frontends/frontend-app-profile/prod_config.yml#L26

@@ -737,6 +741,8 @@ services:
service: microfrontend
working_dir: '/edx/app/frontend-app-authn'
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.frontend-app-authn"
environment:
PARAGON_BRAND_PACKAGE: '@edx/brand-edx.org@~2.0.0'
Copy link
Member

Choose a reason for hiding this comment

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

edx-internal shows this version as 2.x currently.

Suggested change
PARAGON_BRAND_PACKAGE: '@edx/brand-edx.org@~2.0.0'
PARAGON_BRAND_PACKAGE: '@edx/brand-edx.org@2.x'

https://github.com/edx/edx-internal/blob/b3bd6adf8407b986349272f33b37922c620d8857/frontends/frontend-app-authn/prod_config.yml#L58

@@ -752,6 +758,8 @@ services:
service: microfrontend
working_dir: '/edx/app/frontend-app-course-authoring'
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.frontend-app-course-authoring"
environment:
PARAGON_BRAND_PACKAGE: '@edx/brand-edx.org'
Copy link
Member

Choose a reason for hiding this comment

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

It appears this MFE does not install @edx/brand-edx.org in the standard way, instead manually installing it in the gocd pipeline itself (source).

That said, it currently installs 2.x, not latest.

@@ -767,6 +775,8 @@ services:
service: microfrontend
working_dir: '/edx/app/frontend-app-gradebook'
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.frontend-app-gradebook"
environment:
PARAGON_BRAND_PACKAGE: '@edx/brand-edx.org'
Copy link
Member

Choose a reason for hiding this comment

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

Note: it doesn't appear frontend-app-gradebook uses @edx/brand-edx.org today. See production app in screenshot below; the button styles are from the default Paragon styles, not @edx/brand-edx.org.

Would we want to update the devstack MFE to use @edx/brand-edx.org when stage/prod does not? For this PR, I might recommend not adding @edx/brand-edx.org for MFEs that seemingly don't use it. You might consider coordinating with the owning teams to start using the @edx/brand-edx.org theme in stage/prod/devstack.

image

Comment on lines 793 to 796
working_dir: '/edx/app/frontend-app-ora-grading@2.x'
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.frontend-app-ora-grading"
environment:
PARAGON_BRAND_PACKAGE: '@edx/brand-edx.org'
Copy link
Member

Choose a reason for hiding this comment

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

The version 2.x was incorrectly added to the working_dir; it should be on the PARAGON_BRAND_PACKAGE.

Related, edx-internal doesn't define an NPM_ALIAS for this MFE (source). However, it is running the @edx/brand-edx.org theme, as it's installed by default in the upstream MFE package.json (source), which is incorrect as @edx/brand-edx.org is 2U/edX.org specific and should not be in openedx repo.

Might be worth coordinating with the owning team to get @edx/brand-edx.org used within NPM_ALIAS in edx-internal instead, and keeping @edx/brand-openedx installed by default in the MFE, which is convention.

@@ -842,6 +860,8 @@ services:
service: microfrontend
working_dir: '/edx/app/frontend-app-library-authoring'
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.frontend-app-library-authoring"
environment:
PARAGON_BRAND_PACKAGE: '@edx/brand-edx.org'
Copy link
Member

Choose a reason for hiding this comment

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

Here's another instance where @edx/brand-edx.org is actually installed via the GoCD pipeline file vs. the typical NPM_ALIASES config (source). That said, the version appears to be 2.x.

Comment on lines +24 to +25
if [ -n "$(printenv PARAGON_BRAND_PACKAGE)" ]; then
npx paragon install-theme "$(printenv PARAGON_BRAND_PACKAGE)" || exit 1
Copy link
Member

Choose a reason for hiding this comment

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

Looks great; seems to work well locally.

@mfarhan943
Copy link
Author

mfarhan943 commented Dec 19, 2024

@adamstankiewicz I have updated the PR with your suggested changes. Regarding frontend-app-gradebook and frontend-app-ora-grading, I have informed arbi-bom.
CC: @iamsobanjaved

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.

3 participants