Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .deploy/mta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ modules:
# Wipe each static dir BEFORE cp'ing fresh content. Hugo public, qa, admin-ui,
# analytics-ui, scanner-ui all need this; everything not under static/ here
# (e.g. node_modules, package.json) is preserved.
- rm -rf static/admin-ui static/analytics-ui static/scanner-ui static/explore-ui static/channel-atlas-ui static/data-inspector-ui static/qa
- rm -rf static/admin-ui static/analytics-ui static/scanner-ui static/explore-ui static/channel-atlas-ui static/data-inspector-ui static/qa static/prerelease
# CAP-sourced Hugo sections (concepts, developer-advocates, browse) are
# generated at build time from /build/* endpoints. Because `cp -r` is
# union (see comment above), a build against a backend with FEWER rows
Expand All @@ -274,6 +274,9 @@ modules:
- mkdir -p static/qa
- cp -r ../hugo/public-qa/. static/qa/
- rm -rf static/qa/tutorials
- mkdir -p static/prerelease
- cp -r ../hugo/public-prerelease/. static/prerelease/
- rm -rf static/prerelease/tutorials
- npm --prefix ../app/admin-shell install
- npm --prefix ../app/admin-shell run build
- mkdir -p static/admin-ui
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:
# Cache .tutorial-cache/ across runs so fetch-tutorials does not re-pull
# ~1400 tutorials from GitHub on every CI run. Without this, mbt's 10-min
# per-command timeout fires during the QA-channel fetch (the second of
# two fetches in the build sequence). Mirrors rebuild-content.yml's
# three fetches in the build sequence). Mirrors rebuild-content.yml's
# caching pattern.
# Cache key is keyed to the fetcher implementation (scripts/fetch-tutorials.ts
# + scripts/parsers/), NOT to deploy.yml. Workflow file edits don't change
Expand Down Expand Up @@ -180,13 +180,13 @@ jobs:

# Prefetch tutorials OUTSIDE the mbt before-all phase. mbt enforces a
# 10-minute timeout for the entire before-all sequence; cold-cache CI
# runs do TWO ~6-min full fetches (prod + QA) which blow past 10 min.
# runs do THREE ~6-min full fetches (prod + QA + prerelease) which blow past 10 min.
# Doing the fetches as separate workflow steps removes them from mbt's
# cap, AND populates the actions/cache@v4 directories for any future
# mbt invocation in the same job (mbt's own fetch step then hits a
# warm cache and finishes in seconds).
#
# Both fetches run sequentially since they share the GitHub API rate
# All fetches run sequentially since they share the GitHub API rate
# limit budget; in parallel they'd compete for tokens. Each is gated
# by `if: failure()` is NOT used — we WANT a hard failure if discovery
# breaks (otherwise mbt would re-fetch anyway and surface the same
Expand All @@ -209,6 +209,13 @@ jobs:
CAP_BASE_URL: ${{ steps.cap-url.outputs.url }}
SNIPPETS_ENABLED_REPOS: meta-tutorials

- name: Prefetch prerelease tutorials (warms .tutorial-cache-prerelease)
run: npm run fetch-tutorials -- --target hugo --channel prerelease
env:
GITHUB_TOKEN: ${{ secrets.TUTORIALS_GITHUB_TOKEN || github.token }}
CAP_BASE_URL: ${{ steps.cap-url.outputs.url }}
SNIPPETS_ENABLED_REPOS: meta-tutorials

# [#797] Hugo safeHTML XSS-guard. Sweeps hugo/layouts/**/*.{html,xml,xsl}
# for unmarked `| safeHTML` / `| safeHTMLAttr` / `printf "<...%s"` usages
# and fails CI if any occurrence lacks a `<!-- security-reviewed: <reason> -->`
Expand Down
28 changes: 28 additions & 0 deletions approuter/xs-app.json
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,13 @@
"destination": "srv-api",
"authenticationType": "xsuaa"
},
{
"source": "^/content/tutorials-prerelease/(.*)$",
"target": "/content/tutorials-prerelease/$1",
"destination": "srv-api",
"authenticationType": "xsuaa",
"scope": "$XSAPPNAME.Tutorial.PreRelease"
},
{
"source": "^/content/(.*)$",
"target": "/content/$1",
Expand Down Expand Up @@ -672,6 +679,27 @@
"authenticationType": "xsuaa",
"scope": "$XSAPPNAME.Tutorial.Author"
},
{
"source": "^/tutorials-prerelease/_nav\\.json$",
"target": "/content/tutorials-prerelease/_nav",
"destination": "srv-api",
"authenticationType": "xsuaa",
"scope": "$XSAPPNAME.Tutorial.PreRelease"
},
{
"source": "^/tutorials-prerelease/?$",
"target": "/prerelease/index.html",
"localDir": "static",
"authenticationType": "xsuaa",
"scope": "$XSAPPNAME.Tutorial.PreRelease"
},
{
"source": "^/tutorials-prerelease/((?:css|js|img|fonts|vendor)/.*)$",
"target": "/$1",
"localDir": "static",
"authenticationType": "xsuaa",
"scope": "$XSAPPNAME.Tutorial.PreRelease"
},
{
"source": "^/tutorials-prerelease/(.*)$",
"target": "/content/tutorials-prerelease/$1",
Expand Down
Loading
Loading