Skip to content

Conversation

@mfarhan943
Copy link
Contributor

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
@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
Contributor Author

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

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
Contributor

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
Contributor 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.

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
Contributor

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'

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
Contributor

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

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
Contributor

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

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
Contributor

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.

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
Contributor

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
Contributor

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.

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
Contributor

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
Contributor

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
Contributor 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

@huniafatima-99 huniafatima-99 merged commit cdfa616 into master Jan 29, 2025
11 checks passed
@huniafatima-99 huniafatima-99 deleted the farhan/default-edx-theme branch January 29, 2025 09:55
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.

6 participants