Repository navigation
Harden error output, spool delivery, report files and catalogue loading - #111
Merged
Merged
Conversation
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
Six small fixes to how the CLI handles untrusted text, unexpected platform answers, report folders, spooled syncs, catalogue-supplied paths and catalogue files. Each has a test, and nothing else changes.
Changes
Text from the platform and from exceptions is shown literally
[/bold]can no longer raiseMarkupError. A platform error now ends in its mapped exit code with the reports still written, instead of exit 1 with no reports.Unexpected platform answers no longer crash
statusor--output json/meta,/whoamiand the sync answer is checked for its type, and a wrong type counts as unknown. An expiry no calendar holds shows as "unknown".--output jsonalways writes exactly one JSON object to stdout. If the summary cannot be built it carries the exit code and anerror.Runs never share a report folder
YYYYMMDDHHMMSS-xxxxxxxx, so two runs in the same second get different folders.Spooled syncs are delivered only with the key that spooled them
spool listmarks them. A spooled sync with no recorded key is treated as another key's.Report files are private, and catalogue paths stay in the assets folder
0700andsync.jsonis written0600. When a run ends, everything under the report folder loses its group and other permissions; stricter modes are kept..., backslashes, UNC, drive letters,:or NUL, and the resolved path must stay inside the assets folder. A path that fails gets the placeholder, and nothing outside the folder is looked at.Catalogue loading is stricter
--catalogue, and again on the copy made into the report folder. The stage then fails before any collected data is written.trusted_schema=OFF../datasets/data.dbis no longer installed automatically; usecloudexit catalogue import.Compatibility
docs/api-v2/: unchanged.--output jsonalways prints one object; odd platform answers give degraded output instead of tracebacks; mismatched spooled syncs are not delivered; catalogues with triggers or views are refused; report files are readable by the owner only;./datasets/data.dbis no longer picked up on its own.cloudexit.private_filesis a new module, with its layering entry added.