Publisher + tutor

Hi,
got tutor openedx in non-production mode, tutor-discovery and tutor-mfe.
Need to get frontend-app-publisher.
pip install git+https://github.com/edx/frontend-app-publisher.git don’t work - there is no setup.py.
So, tried to fix it manually (make from frontend-app-publisher/ or step-by-step from Makefile):

# The assumption behind running any of these make commands is that the user is
# already shelled into the container using the `make frontend-app-publisher-shell`
# command in devstack

npm-install-%: ## install specified % npm package on the cookie-cutter container
	npm install $* --save-dev
	git add package.json

validate-no-uncommitted-package-lock-changes:
	git diff --exit-code package-lock.json

test:
	npm test

snapshot:
	npm run snapshot

lint:
	bash -c 'npm run lint && npm run stylelint'

eslint-fix:
	bash -c 'npm run lint-fix'

but i cant find any of frontend-app-publisher-shell entry(
Then, according to this conversation try to add plugin as yml:

name: publisher
version: 12.0.0
config:
  defaults:
    MFE_APP:
      name: publisher
      repository: "https://github.com/edx/frontend-app-publisher"
      port: 18400
patches:
  discovery-development-settings: |
    CORS_ORIGIN_WHITELIST = list(CORS_ORIGIN_WHITELIST) + ["{{ MFE_HOST }}:{{ PUBLISHER_MFE_APP['port'] }}"]

but still no progress - plugin publisher enabled but tutor local quickstart dont do anything (maybe because its not python package?)
Any suggestions?

Hi @eazaika,

When you say it doesn’t work, what do you mean? Can you see the MFE when you navigate to apps.local.overhang.io/publisher?

I’ve attempted to configure the publisher mfe with a tutor plugin before.

Unfortunately, it’s not going to work straight out of the box, it requires some changes to the way routing is done in the MFE. (see changes in my fork)

That’s how far as I’ve got before I run out of time to dedicate to it. If I remember correctly, with the changes I was able to get the basic functionality working (i.e. create a new course run). I expect there are more challenges ahead because some of the logic seems very edX specific.

Happy to answer any questions if you’re interested in making it work! I might pick this back up in the near future but no guarantees.

1 Like

Thank’s for quick reply!
Oh, it’s on /publisher link, i see) I just route my ports to find 18400’s listener aka netstat -anp | grep 18400. So, it’s empty page with the footer

Is that using my fork of the publisher app?

No, from edx. Your fork faults because it hasn’t maple branch, i suppose:

Step 99/127 : RUN git clone https://github.com/Dicey-Tech/frontend-app-publisher --branch open-release/maple.1 --depth 1 .
 ---> Running in d8134fbabbbe
Cloning into '.'...
warning: Could not find remote branch open-release/maple.1 to clone.
fatal: Remote branch open-release/maple.1 not found in upstream origin
The command '/bin/sh -c git clone https://github.com/Dicey-Tech/frontend-app-publisher --branch open-release/maple.1 --depth 1 .' returned a non-zero code: 128
ERROR: Service 'mfe' failed to build : Build failed
Error: Command failed with status 1: docker-compose -f ***/.local/share/tutor/env/local/docker-compose.yml -f ***/.local/share/tutor/env/local/docker-compose.prod.yml --project-name tutor_local up --remove-orphans --build -d

I found two rejected requests (404 and 403) for github.com/edx/frontend-app-publisher :

“/publisher” is not recognised as a valid route by the edX MFE so you won’t be seeing anything.

You can configure the branch to pull from in tutor by setting the version parameter. The build might still fail, I haven’t tried it in Maple.

MFE_APP:
      name: publisher
      repository: "https://github.com/edx/frontend-app-publisher"
      version: "master
      port: 18400

Got it! Just add version: master to yml and build with github.com/Dicey-Tech/frontend-app-publisher complete successfull
But then got some problem with access to discovery.local.overhang.io/api/v1/courses
1
When i touch this url directly - responce Unauthorized


If log in by button Log in then responce change to normal

but page /publisher still calls same error( Looks like something wrong with authorize method

Oh, there is CORS error
1

That’s strange. I change patches to:

patches:
  discovery-development-settings: |
    CORS_ORIGIN_WHITELIST = list(CORS_ORIGIN_WHITELIST) + ["{{ MFE_HOST }}:{{ PUBLISHER_MFE_APP['port'] }}"]
  discovery-common-settings: |
    CORS_ORIGIN_WHITELIST = list(CORS_ORIGIN_WHITELIST) + ["http://{{ MFE_HOST }}:{{ PUBLISHER_MFE_APP['port'] }}"]

(http:// for avoid error on build ?: (corsheaders.E013) Origin 'apps.local.overhang.io:18400' in CORS_ORIGIN_WHITELIST is missing scheme or netloc HINT: Add a scheme (e.g. https://) or netloc (e.g. example.com).)

and re-built by tutor local quickstart but still gets this error (request bloked by CORS)

You didn’t put http in the development settings (see django-cors-headers version upgraded)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.