Repository navigation
chore(tutorials): CLI-deprecation rules + promotion lint + OS-fallback doc fix + MCP slicer import fix - #3033
Merged
Merged
Conversation
…stitution placeholder (#2820) §3.5.2 previously described the pre-#2820 "closest match" fallback (show macOS when Linux is missing, with a banner saying so). Since commit e82393c (#2820) the platform performs exact-match-only rendering: if the chosen OS has no panel in a step group it shows a 'No <OS> instructions for this step.' placeholder instead of substituting another OS's content. Update the doc to reflect the current behavior.
…time (#3029 pattern) `packages/mcp/tutorial-step-slicer.js` statically imported `renderDirectivesAsText` from `../../scripts/parsers/directives.js` (a TypeScript source file). This mirrors the bug fixed in `freshness-detector.js` by #3029: `scripts/parsers/` is NOT deployed into `gen/srv` at `cds build` time, so the static import fails at CF runtime — masked today by `KG_STEP_SLICER_ENABLED` defaulting off and the `srv/lib` shim's bundle fallback. Apply the same fix: replace the static import with a memoised lazy `await import()` that tries the workspace path first, catches on failure, and falls back to the pre-built `_shared/parsers.bundle.mjs` (already created by `scripts/bundle-shared.cjs` as part of the #3029 fix). The `collectTroubleshootEntries` static import remains — it is inlined by esbuild when building `mcp.bundle.mjs` and is not affected by this path at CF runtime. Unit tests: 18/18 pass.
…pec task 4.4) Adds 5 new entries to cli-deprecations.json (all advisory 'warning', never block builds): cf map-route --hostname — CF v8 removal (parallel to existing --hostname rule) cf create-route --hostname — CF v8 removal (same migration guide) cf push --no-route — CF v8 removal (use no-route: true in manifest.yml) cds run — deprecated in favour of cds watch npm install -g @sap/cds — should be @sap/cds-dk for the cds CLI Rules marked needsOwnerReview: true in the JSON need owner confirmation against official changelogs before being treated as authoritative. They still fire at 'warning' level — advisory only. Also adds a quarterly-review reminder comment header to deprecated-cli.ts (spec task 4.4) with links to official CF, CAP, BTP, and MBT changelogs, and documents the needsOwnerReview interface field. Existing 4 rules and all tests unchanged (4/4 pass).
…cated-CLI rule) Adds a new advisory lint rule `promotion-warning-in-prod-source` to `scripts/lint-rules/authoring-aids.ts`, registered in the `RULES` array in `scripts/lint-tutorial-markdown.ts`. The rule fires at `'notice'` severity (below 'warning' — never blocks a build even with --strict) when PROD tutorial source contains a `:::promotion-warning` container directive. This is analogous to the existing `:::qa-only` rule but targets a separate authoring-time marker: an author-placed "do not promote" annotation indicating a specific concern that should be resolved before the tutorial reaches production readers. Assumption (flagged for owner confirmation): the `:::promotion-warning` directive has not yet been deployed to the platform as of this change; this rule pre-declares the lint gate for when authors begin using the pattern. The exact directive syntax may need adjusting once it ships — owners should verify and drop this note. Tests: 8/8 pass (3 new for promotionWarningRule, 5 pre-existing unchanged).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four small independent cleanups in one PR:
C1 — Expanded CLI-deprecation lint rules (spec task 4.4)
Adds 5 new advisory rules to
scripts/lint-rules/data/cli-deprecations.json(all severity'warning', never block builds):cf map-route --hostnamecf create-route --hostnamecf push --no-routecds runcds watch)npm install -g @sap/cdsAlso adds a quarterly-review reminder header comment to
scripts/lint-rules/deprecated-cli.ts(per spec task 4.4) with links to official changelogs and documents theneedsOwnerReviewinterface field.Rules needing owner review (marked
"needsOwnerReview": truein the JSON — these fire at'warning'but need confirmation against official changelogs):cf map-route --hostname— parallel to existing--hostnameremoval, high confidence but not independently verified against CF CLI v8 release notescf create-route --hostname— same reasoningcf push --no-route— same reasoningcds run— deprecated in favour ofcds watch, but exact version not confirmednpm install -g @sap/cds— @sap/cds-dk installs the cds CLI, @sap/cds is runtime-only, but exact "deprecated since" version needs owner verificationC2 — New promotion-warning lint rule (advisory
'notice'severity)Adds
promotionWarningRuletoscripts/lint-rules/authoring-aids.ts, registered in theRULESarray inscripts/lint-tutorial-markdown.ts.Assumption (flagged for confirmation): The rule detects
:::promotion-warningcontainer directive blocks in PROD tutorial source. Semantics assumed analogous to:::qa-only— an author-placed "do not promote without resolving this" marker. The:::promotion-warningdirective has not yet been deployed to the platform; this rule pre-declares the lint gate for when authors begin using the pattern. The exact directive syntax may need adjusting once it ships. Owners: confirm the pattern or adjust before promoting this rule beyond DEV.Severity is
'notice'(below'warning'), which means it is advisory only and never blocks a build even with--strict.C3 — Fix stale §3.5.2 doc (OS option-tab fallback behavior)
docs/authors/writing-tutorials.md§3.5.2 still described the pre-#2820 "closest match" fallback ("No Linux instructions for this step — showing macOS."). Since commit e82393c (#2820) the platform performs exact-match-only rendering: if the chosen OS has no panel in a step group, it shows"No <OS> instructions for this step."— no substitution. Updated to describe the current behavior.D — Fix MCP slicer latent static-import bug (#3029 pattern)
packages/mcp/tutorial-step-slicer.jshad a staticimport { renderDirectivesAsText } from '../../scripts/parsers/directives.js'. At CF runtime,scripts/parsers/is not deployed intogen/srv, so this fails. It was masked byKG_STEP_SLICER_ENABLEDdefaulting off and thesrv/libshim's bundle fallback.Applied the same fix #3029 used in
freshness-detector.js: replace the static import with a memoised lazyawait import()that tries the workspace path first and falls back to the pre-built_shared/parsers.bundle.mjs(already created byscripts/bundle-shared.cjs).How tested
npx tsx scripts/run-static-guards.ts— 17/17 checks pass (180s)npx vitest run scripts/lint-rules/__tests__/— all lint rule tests pass (8 new for C2 promotion-warning rule, all existing tests unchanged)npx vitest run test/unit/tutorial-step-slicer*.test.js— 18/18 pass after D fixDeploy scope
Backend only (srv/* changes) + docs (docs/authors/). No approuter, no Hugo changes. No schema migrations. No feature flags — all changes are defensive (lint rules advisory-only, import fix fail-open).
C1/C2 lint rules:
'warning'/'notice'severity — they MUST NOT and DO NOT fail builds.D:
KG_STEP_SLICER_ENABLEDdefaults off in all environments; fix takes effect when the flag is enabled.