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

fix: prevent live-sample render errors killing the whole build #9155

Merged
merged 1 commit into from
Jun 24, 2023

Conversation

LeoMcA
Copy link
Member

@LeoMcA LeoMcA commented Jun 24, 2023

See: #9154

Not entirely sure what the underlying issue is here: with playground, our routing logic for localised cross document live samples must have changed, and now we can't find some. Rather than debugging and fixing that, I'm letting them remain broken, but preventing them from killing the entire build.

An example of a file which fails is yarn build files/fr/learn/forms/how_to_structure_a_web_form/index.md like so:

Error: From URL /fr/docs/Web/Guide/HTML/Formulaires/Comment_structurer_un_formulaire_HTML/Exemple no folder on disk could be found. Tried to find a folder called fr/web/guide/html/formulaires/comment_structurer_un_formulaire_html/exemple
    at render (file:///workspace/yari/kumascript/index.ts:65:11)
    at Element.<anonymous> (file:///workspace/yari/kumascript/src/live-sample.ts:104:29)
    at LoadedCheerio.map (file:///workspace/yari/node_modules/cheerio/lib/esm/api/api/traversing.ts:618:20)
    at Module.buildLiveSamplePages (file:///workspace/yari/kumascript/src/live-sample.ts:93:8)
    at buildDocument (file:///workspace/yari/build/index.ts:241:44)
    at async buildDocumentInteractive (file:///workspace/yari/build/cli.ts:76:29)
    at async buildDocuments (file:///workspace/yari/build/cli.ts:169:20)
    at async Se._action (file:///workspace/yari/build/cli.ts:465:60)
    at async Se.run (/workspace/yari/node_modules/@caporal/core/dist/index.js:1:27579)
    at async Te._run (/workspace/yari/node_modules/@caporal/core/dist/index.js:1:32257)

When building all documents, this would error out the entire build for that locale. For some reason we don't catch this in our action and error out the entire action - instead we seem to plod on, only uploading the documents which managed to be built prior to that error.

In summary, this:

  • catches the errors, lets the build proceed

On monday we should debug and fix:

  • what's changed with the routing of embedlivesample
  • why our action didn't fail

@github-actions github-actions bot added the macros tracking issues related to kumascript macros label Jun 24, 2023
@LeoMcA LeoMcA temporarily deployed to stage June 24, 2023 11:39 — with GitHub Actions Inactive
Copy link
Member Author

@LeoMcA LeoMcA left a comment

Choose a reason for hiding this comment

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

@LeoMcA LeoMcA merged commit c99d7fe into main Jun 24, 2023
@LeoMcA LeoMcA deleted the locale-livesample-hotfix branch June 24, 2023 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
macros tracking issues related to kumascript macros
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant