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
12 changes: 10 additions & 2 deletions scripts/check-family-nav.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ const PAGES = [

const TOOLS = [`${BASE}/playground/`, `${BASE}/docs/`];

/* Our own origin, with the trailing slash, for the "is this one of ours?"
* filter below. The slash is not cosmetic: a host name may continue where a
* prefix stops, so `startsWith(BASE)` also accepts
* `https://abap2ui5.github.io.example.com/samples/` - a link to somebody
* else entirely, counted as one of the three and compared against the wanted
* list as if it were. With the slash the host is closed. */
const OURS = `${BASE}/`;

/* The catalogue moved to the root of its Pages site when the in-browser demo
* was dropped, so this address is a 404 and stayed in one footer for a while.
* Nothing may link to it again. */
Expand Down Expand Up @@ -101,7 +109,7 @@ if (!three) fail(`${PAGE_HTML}: no three-pages:start / three-pages:end block`);

if (nav) {
const want = [...PAGES.map((p) => p.url), ...TOOLS];
const got = hrefs(nav).filter((h) => h.startsWith(BASE));
const got = hrefs(nav).filter((h) => h.startsWith(OURS));
if (got.join(' ') !== want.join(' ')) {
fail(`the bar links to\n ${got.join('\n ')}\n but must link, in this order, to\n ${want.join('\n ')}`);
}
Expand All @@ -122,7 +130,7 @@ if (nav) {

if (three) {
const want = PAGES.map((p) => p.url);
const got = hrefs(three).filter((h) => h.startsWith(BASE));
const got = hrefs(three).filter((h) => h.startsWith(OURS));
if (got.join(' ') !== want.join(' ')) {
fail(`the three-pages strip links to\n ${got.join('\n ')}\n but must link, in this order, to\n ${want.join('\n ')}`);
}
Expand Down
11 changes: 10 additions & 1 deletion scripts/check-framework-pin.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,16 @@ const ALLOWED_BRANCHES = new Map([
['.github/abaplint/abap_702.jsonc', '702'],
]);

const A2UI5_URL_RE = /github\.com\/abap2UI5\/abap2UI5/i;
/* The framework dependency, identified by its url VALUE rather than by a
* substring of the entry.
*
* `/github\.com\/abap2UI5\/abap2UI5/` matched anywhere in the object slice and
* stopped at the repository name without closing it, so
* `https://github.com/abap2UI5/abap2UI5-local` - a different repository in
* the same organisation, and a plausible thing for a config to depend on -
* was read as the framework and had its "branch" key checked as if it were.
* Anchoring at the key and closing at the quote leaves only the framework. */
const A2UI5_URL_RE = /"url"\s*:\s*"https:\/\/github\.com\/abap2UI5\/abap2UI5(?:\.git)?\/?"/i;
const RELEASE_RE = /^\d+\.\d+\.\d+$/;

let errors = 0;
Expand Down