Repository navigation
basou: Move boards and records to shape version 3 (http, github_check, file_name, file_paths, total, repo base and ahead, component markers) - #368
Merged
Conversation
…s and records to version 3 (#361) * basou: Observe the response to an HTTP GET on a board, and move boards and records to version 3 - board.yaml: board_version 3 adds the observation kind http: an https:// URL (held to the shape of a page_version's), and optionally words, a count_pattern (flags gu, matched against the whole body; one that matches the empty string is refused) and a capture_pattern (flag u, with at least one capturing group). GET only. A word or a pattern that is empty, holds a control character or a quote, or starts with '-' is refused, as is a word given twice. - A board of version 1 or 2 that uses what a later version reads is told so on a line of its own for a kind or a value as for a key: each problem is put down to the first version that reads that part as written, and a key, when none does, to the first version that takes it. - board guide: a curl without -f that prints the status, the redirects and the URL it ended at, and a node line that reads the body whole as UTF-8 (without a leading BOM), is given the patterns and words after --, and stops at an empty match. The value is { status, redirects, final_url } with words, count and capture as declared, null when the status is not 2xx. - board init prints board_version 3, and its comment names http. - Records are written as record_version 3, whatever the version of the board; versions 1 and 2 are still read and drawn. * basou: Apply the review of the http observation: the value's keys, nulls off 2xx, a kind under an older key, and the guide's code spans - board record: the keys of an http observation's value (status, redirects, final_url, words, count, capture) are words of the input's shape, so the check for other workspaces' names no longer refuses a value written as the guide says when a registered workspace is named like one of them. What they hold is still looked at. - board guide: off 2xx, say "words": null and not a list of nulls, naming only what the board declares; capture is null also when its first group takes no part in the match; words and patterns are written as Markdown code that shows backquotes and spaces as they are. - A board of version 1 whose observe holds an http observation with a problem inside it is told version 3, not 2: a key is put down to a later version when what is wrong inside it is what that version reads. - Only an empty word or pattern is empty: one of spaces is taken. - The record version's comment says a record of version 3 may hold a declaration of version 3. - Tests for the u flag in the guide's line, case, a word at the body's start, a BOM inside the body, an http key that is not an id, a word given twice outside http, a file with no version, empty matches only under u or only in the empty text, and the guide's text with nothing observed.
…rvation carry notes (#362) * basou: Observe a check run by its name on a board, and let every observation carry notes - board.yaml: board_version 3 adds the observation kind github_check: a GitHub repository, the name of a check run (check) and a branch (main when it names none). Its value is the conclusion of the newest check run of that name on the head commit of the branch, or its status while it has not finished. A check name that is empty, longer than 255 characters, holds a control character or a quote, or starts with '-' is refused. - board.yaml: from board_version 3, every observation may have notes, in the shape of a stage's or a lane's. A board of version 1 or 2 that has them, or a github_check, is told that version 3 reads them. - board guide: a gh api command that asks for the check runs of heads/<branch> by check_name, 100 to a page, and takes the one with the highest id: the API lists one for each check suite that ran the check, in an order it does not document, and heads/ keeps a branch named like a commit from being read as one. An empty line is no run of that name on the head commit. Each observation's notes are printed under its commands as "mind:". - board init's comment on observe names github_check and notes. * basou: Refuse a branch part that starts with '.', and say more of a github_check in the guide - board.yaml: a branch a github_ci or github_check observation names may not have a part that starts with '.', in a board of any version. git takes no such branch, and GitHub reads a/./b in the path of a request as a/b, another branch. - board guide: the source of a github_check is written as the GET it is (gh api -X GET ...); with -f fields and no -X GET, gh sends a POST. - board guide: when a check has more runs than the 100 a page holds, the command prints a second line saying so, and the guide says to keep the first line as the value and say in a footnote that it may not be the newest. The page and the line share one constant. - board guide: an empty line is a head commit that never started the check (a path filter, a skip marker in its commit message, or the app's own rules); a job a workflow skipped with if: is a check run concluded skipped. - board guide: the branch and the repository of a github_check are Markdown code in its prose, as the check name is, so '_' is not read as emphasis. Tests hold the check name's code spans there.
…363) * basou: Measure the name of a file and the paths of files on a board - board.yaml: board_version 3 adds two kinds of measure over a repo's files, with include, exclude and at as a file_count has them, and not measured where a file_count is not. file_name picks the first or the last of the files matched (pick), in the byte order of their paths, and its value is that file's name; with a pattern it picks only among the files whose name the pattern matches, and the value is what the pattern's group holds (1 when it names none, and a group without a pattern is refused). file_paths gives the paths matched, in byte order, up to 1000; more is not measured. No file to pick is not measured: a string has no zero. A ratio takes neither, and a board of version 1 or 2 is told that version 3 reads them. - The value of a measure may be a list of strings. The difference from the previous record lists each path that came in or went out when both hold a list, and the value whole otherwise. - board measure prints a list as a count, and --json gives the paths; the board page draws it in its lane as a count, with the paths folded under it, and reads a record whose measure holds one. - board guide says where to read the paths and how the difference gives them; board init's comment on measures names the two kinds. * basou: Hold a file_name's byte order apart from UTF-16 order in a test A name of four bytes from 0xf0 (U+1F600) is after one from 0xef (U+FF5E) in byte order, though its first UTF-16 unit is before. The test now tells the two orders apart, so sorting by the decoded text fails it. * basou: Say which part of measure.txt gives a file_paths list as a count - board guide and CHANGELOG: it is the Measures section of board measure that gives a list as a count. The difference from the previous record gives each path that came in or went out when both records hold a list, and the list whole when only one does. - The comment of BOARD_DEFAULT_CAPTURE_GROUP names a file_name measure with a pattern, which takes it too.
…ne, and let ids and keys hold '.' (#364) * basou: Add up measures on a board, draw a measure in more than one lane, and let ids and keys hold '.' From board_version 3: - A `total` measure adds up `plus` (at least one) and takes away `minus` (optional), each an integer or the id of a measure whose value is one. It is computed exactly, may be below 0, and is null, naming each measure it takes that was not measured, when any was; one out of the range a number holds exactly is null too. A total takes no total, itself included, and no regex_capture, file_name or file_paths; a ratio may take a total. Totals are measured after every other measure, and the measurement keeps the order declared. - A measure's `lane` is one lane id or a non-empty list of them, each a lane of the board and none twice. The board page draws the measure in each of its lanes' sections, and `board measure` lists them. - A measure's id and an observation's key may be words joined by '.' (not ':' or '/'), and a ratio's and a total's references take the same form. Lane and ratio ids are as before. `not_found` names a measure by formatPath, so `measures["site.pages"]` is not read as a path. A measure's lane is read as a list whatever the board's version, so a record of version 3 holds it as a list in its measurement and in its declaration. The board page and the difference from the previous record read the one lane id of a record of version 1 or 2 as a list of that one. A board of version 1 or 2 that uses any of these is told that version 3 reads it. The guide says what a total's value is, the no-board guide and init's comment say a measure may be drawn in a list of lanes, and the CHANGELOG says all of it under Unreleased. * basou: Name the range of a total's integers, and pin a total's checks, older lanes and '.' in tests - A total's term that is an integer a number does not hold exactly is told the range it must be in (-9007199254740991 to 9007199254740991), and the CHANGELOG says so. - crossCheck's comment says that what a later version reads (a list of lanes, a total's terms, an id with '.') is still held against the rest of a board of version 1 or 2. Tests pin it, and that a lane not on the board, listed twice, is said to be listed twice. - BoardDiff's doc says that a lane held as one id is the list of that one. - Tests pin that a total says what it lacks before its range, that an older record's lane id is the lane of that id only (not of every id it holds), and a '.' broken after the second word of an id.
… ahead of it, and say when it was last fetched (#365) * basou: Name the base a board's repos are compared with, count what is ahead of it, and say when it was last fetched In a version 3 record, each repo's behind_main is now behind, counted as before, next to base (origin/<branch>: the branch origin/HEAD names, or origin/main when it names none; null when there is neither), ahead (the commits HEAD has that the base does not) and fetched_at (when FETCH_HEAD was last written, only when it holds the line of the base's branch of origin's URL, as git writes it there, at the commit the base is at now). fetched_at is left out of the digest and of the difference from the previous record. The repos method stays 2. basou board measure prints the four on each repo's line, the board page measured on the spot draws them as columns, and the guide says how to read them when judging 04. * basou: Pin down how a board's repos match FETCH_HEAD, and say when fetched_at moves without a fetch of origin Review follow-ups. A git remote get-url that ends with no exit code (it could not be started, or a signal stopped it) is now a gap, not a null that says origin has no URL. The docs, the guide and the changelog say that a later fetch with --append moves fetched_at and leaves origin's line, that a remote at origin's URL writes the same line, and that what is told apart is another URL rather than another remote; the guide no longer calls fetched_at the time of the last fetch outright. New tests pin a branch and a URL that are not ASCII, removing only one .git, the not_found entries of fetched_at staying in the digest, the remote get-url gap, and the two cases above. The changelog entry is rewrapped.
… it (#366) * basou: Let a registered component on a board name the files that mark it A directory no built-in marker finds, such as one of content or of scripts, was gone at every measure and fired the axis review's (a) each time. From board_version 3, components.<key>.marker is a glob from the component's directory, written and checked as an include is. When a file the working tree lists under that directory matches it, the component is found with the kind marker; when none does, it is gone, as before. A key that is a repo itself takes no marker. A board of version 1 or 2 with a marker is told that version 3 reads it. The components method stays 2: a registry without a marker measures as before. The guide and the comment board init writes say when to give a component a marker. * basou: Find nothing for a marker key that is not well-formed text, and pin how a marker key is read A registered key whose path holds a lone surrogate named no directory, yet its bytes read as U+FFFD, so a marker found it under a directory of that name: it is now gone. An empty key with a marker is told only that it is empty, not also that it is a repo itself. Tests now pin that a key's path is read as written (not as a glob, not normalized, so 'app//x' and a trailing '/' find nothing and are not refused), that a name that is not valid UTF-8 is matched as its bytes are, that a repo itself takes no marker whatever the marker is, and the order of the problems with one component.
…red names as code in the guide, http words on the board page) (#367) * basou: Finish a board's version 3: say what is wrong with a branch, write declared names as code, and pair an http observation's words on the board page A branch a github_ci or github_check observation names, when refused, now says what is wrong with it: a character it may not use, a start with '-', '.' or '/', a '..', a '//', a part that starts with '.', or an end with '.' or '/'. basou board guide writes each observation's package, repo, workflow, branch, URL and source as code, as it already did for a github_check, and escapes in its prose and sources what its template of the record escapes (the Arabic letter mark, the zero-width and direction marks, the word joiner and the invisible operators, the byte order mark), so a value reads alike in both. It says that a key with '.' is read from board_version 3, and that a total out of the range a number holds exactly is null. The board page draws an http observation's words with each word its record's declaration lists beside its answer; the record keeps the list. * basou: Escape a lone surrogate in the board guide's prose, pair each well-formed declared observation's words, and pin both The guide's prose and sources now escape a surrogate not in a pair, as its template of the record does through JSON. On the board page, each observation a record's declaration lists is checked on its own, so one not in its shape no longer keeps the others' words from being paired. The CHANGELOG no longer lists an observation's source among what the guide now writes as code: it was in backquotes already, and reads the same for every value a board takes. Tests now give every field of the guide what only the template used to escape, and the characters next to that range, and check that only the commands take them as they are. They pin that the board page does not pair the previous record's value, a value with more answers than words, or an observation of another kind, and draws a record whose declared observations are not a list; that it pairs a single word; that the page's script writes a word with '"' and a backslash as JSON; and which of '//' and a part starting with '.' a branch is told of first.
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
This brings version 3 of the board shape from the integration branch
board/shape-v3intomainin one step, so that the shape of a board's declaration (board_version) and of its record (record_version) changes once, in one release. Each change below was reviewed and merged intoboard/shape-v3as its own pull request.board/shape-v3is 7 commits ahead ofmainand 0 behind (merge base 5fbd37a, v0.70.1). Nothing of version 3 has been released yet.http), and move boards and records to version 3github_check), and let every observation carrynotesfile_name) and the paths of files (file_paths)total), draw a measure in more than one lane (laneas a list), and let ids and keys hold.base), count what is ahead of it (ahead), and say when it was last fetched (fetched_at)marker)httpwords on the board pageWhat changes (from the
Unreleasedsection of CHANGELOG.md)Added, all from
board_version: 3and experimental:httpobservation: anhttps://GET whose value is{ status, redirects, final_url }, withwords,countandcaptureas declared. basou makes no request;basou board guidegives thecurlandnodecommands.github_checkobservation: the conclusion (or the status, while it runs) of the newest check run of a name on the head commit of a branch.noteson every observation, printed by the guide under its commands.file_nameandfile_pathsmeasures.totalmeasure that adds integers and integer measures and takes some away.laneas a list of lanes, and measure ids and observation keys joined by..components.<key>.marker, a glob that marks a registered component no built-in marker finds.Changed:
basou board initprints version 3. Boards of version 1 and 2 are read as before, and every new record is written as version 3. A board of version 1 or 2 that uses a later kind or value is told so on its own line, as a key already was.laneas a list. A record of version 1 or 2 is read as a list of its one lane.behind_mainis nowbehind, withbase,aheadandfetched_at(fetched_atis outside the digest). Thereposandcomponentsmethods stay 2.github_ciorgithub_checkobservation names may not have a part that starts with., and a refused branch says what is wrong with it.basou board guidewrites declared names as code in its prose, and escapes the invisible characters its record template already escapes.basou boardstays experimental; this does not promote it.Verification
board/shape-v3, with the head commit pinned at merge.pnpm install --frozen-lockfile,pnpm -r build,pnpm typecheck,pnpm lint,pnpm lint:lang,pnpm lint:paths,pnpm testandpnpm test:scriptsall exit 0 (core 2916 passed and 1 skipped, sdk 67 passed, cli 1565 passed, scripts 21 passed), leaving the working tree clean.