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

PR companion is not deploying images used in live samples #9579

Open
3 tasks done
OnkarRuikar opened this issue Aug 29, 2023 · 4 comments
Open
3 tasks done

PR companion is not deploying images used in live samples #9579

OnkarRuikar opened this issue Aug 29, 2023 · 4 comments
Labels
🐛 bug Something isn't working, or isn't working as expected effort: medium This task is a medium effort. idle p2 We want to address this but may have other higher priority items. plus:playground pr-companion PR review companion for content PRs regression wx writer experience

Comments

@OnkarRuikar
Copy link
Contributor

Summary

Related to mdn/content PR mdn/content#28805

PR companion for mdn/content doesn't deploy images to the BUILD_LIVE_SAMPLES_BASE_URL server.

URL

mdn/content#28805 (comment)

Reproduction steps

  1. Commit an image (say demo.jpg) in a local branch and use it in a live sample for the page using HTML <img src=demo.jpg>
  2. Submit a PR in mdn/content repo.
  3. Open the preview link for the page generated by the PR companion.
  4. In the live sample the image is not rendered.

In this case the image was not deployed to https://live.mdnyalp.dev/en-US/docs/Web/CSS/aspect-ratio/plumeria.jpg. Once the changes go live it will be deployed to https://live.mdnyalp.dev so this won't be reproducible using the PR.

Expected behavior

On PR preview pages live samples with images should render the images using relative paths demo.jpg or ./demo.jpg.

Actual behavior

Images committed along with markdown pages aren't rendering in live sample outputs.

Device

Desktop

Browser

Firefox

Browser version

Stable

Operating system

Linux

Screenshot

_1

Anything else?

No response

Validations

@github-actions github-actions bot added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Aug 29, 2023
@OnkarRuikar
Copy link
Contributor Author

Note, the preview links in the content PR will work for a limited time. So plan the investigation accordingly.

@yin1999
Copy link
Member

yin1999 commented Sep 2, 2023

The assets (only on main branch) would only be deployed when a stage build is completed. So this would prevents us from fetching the images. Actually, the image does deployed with the main page's domain: https://pr28805.content.dev.mdn.mozit.cloud/en-US/docs/Web/CSS/aspect-ratio/plumeria.jpg.

The current live sample uses Message event handler to pass the code of the main page to the live sample iframe instead of directly generating a static page with related assets. I don’t know if this is the reason why the developers only use the single domain to deploy the live samples for PR previews.

@OnkarRuikar
Copy link
Contributor Author

Actually, the image does deployed with the main page's domain: https://pr28805.content.dev.mdn.mozit.cloud/en-US/docs/Web/CSS/aspect-ratio/plumeria.jpg.

I think changing the environment variable from

BUILD_LIVE_SAMPLES_BASE_URL: https://live.mdnyalp.dev

to

BUILD_LIVE_SAMPLES_BASE_URL: https://pr<prNo>.content.dev.mdn.mozit.cloud

and changing the macro like following:

-- let samplePath = `${pagePath}/runner.html`.replace(/\/\/+/g, "/");
++ let samplePath = `${baseUrl}/runner.html`.replace(/\/\/+/g, "/");

may work.

@caugner caugner added 🐛 bug Something isn't working, or isn't working as expected p2 We want to address this but may have other higher priority items. wx writer experience pr-companion PR review companion for content PRs regression plus:playground and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Oct 2, 2023
@caugner caugner added the effort: medium This task is a medium effort. label Oct 12, 2023
@github-actions github-actions bot added the idle label Jan 24, 2024
@estelle
Copy link
Member

estelle commented May 8, 2024

This is currently (May 8, 2024) an issue in the following PRs:

@github-actions github-actions bot removed the idle label May 8, 2024
@github-actions github-actions bot added the idle label Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working, or isn't working as expected effort: medium This task is a medium effort. idle p2 We want to address this but may have other higher priority items. plus:playground pr-companion PR review companion for content PRs regression wx writer experience
Projects
None yet
Development

No branches or pull requests

4 participants