Address the registry reviewer: per-package READMEs, tests, coverage, … - #19
Merged
Merged
Conversation
…docs A General registry reviewer asked for three things before the later waves are registered, and all three applied to every one of the seven packages. A README in each subdirectory. Each states the package's purpose and where it sits in the layer chain, links back to the monorepo and to SiennaSchemas, and shows a usage example that encodes a type to JSON and decodes it back. Every example is the same code that package's suite asserts, so it cannot rot silently. A working `Pkg.test` for each. The six generated packages had no [extras]/[targets] block at all, so `Pkg.test` errored on a missing `Test`, and all seven runtests.jl were placeholders. test/validate.jl is split by ownership: per-type serde, required-field enforcement, enum and oneOf behavior, unit annotations, and registry entries move to the package that owns those types; the cross-package invariants, the two hand-written document containers, and the serde fixtures stay in the umbrella, the only package that sees all seven. validate.jl is now the repository-level driver -- it devs the seven and runs `Pkg.test` on each in dependency order, which is what `make test` and `make validate` run. Coverage in CI. The test workflow runs the driver with COVERAGE=1 on the leg that uploads, then processcoverage over the seven src trees and Codecov. Also adds the documentation site the reviewer's "link to any relevant documentation" needs: docs/src/api.md describes the whole surface -- the generated type shape, ABSENT vs null, encode/decode and validation, enums, discriminated unions, the model-type registry, the three unit-annotation cases, and the document containers -- with examples that execute at build time, and seven pages carry the full type reference. Deployed to GitHub Pages by a new workflow, versioned off the umbrella's subdir tags. test/test_units.jl is deleted: nothing referenced it, and it assigned to a field of an immutable struct, so it could not have run. Its content is now live in the PowerCore and PowerOperations suites. get_ext gained a docstring and one @ref in system_document.jl was qualified, both needed for the docs to build. Suites: 74, 28, 37, 31, 17, 17, and 452 passing; all seven precompile.
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
These packages are consumed by ten repositories, PowerSystems first among them, and nothing in this repository's CI notices when a change to a generated type's shape breaks one of them. The job checks out PowerSystems (psy6 by default, overridable) alongside InfrastructureSystems at IS4, rewrites PowerSystems' [sources] entries for the seven packages to point at this checkout, instantiates, and runs its suite. It repins rather than relying on a sibling directory layout because the two PowerSystems branches pin differently: psy6 uses relative paths, which a sibling checkout would satisfy, while jd/openapi-1x pins the seven to git rev = "main". Against a git pin a layout-only job resolves main and passes while testing nothing, so a step after instantiate reads the resolved manifest and fails unless all seven came from this checkout. Advisory (continue-on-error), matching PowerSystems' own CrossPackageTest: the psy6 line pins PowerFlowFileParser, PowerSystemCaseBuilder, and PowerTableDataParser to branches of their own, so red here does not by itself mean this repository broke something. Today the psy6 default cannot resolve at all -- its PowerTableDataParser pin still requires OpenAPI 0.2 against these packages' 1.1 -- which is why the ref is an input, and why jd/openapi-1x is noted as the ref that currently resolves. Verified in a simulated CI layout with the workflow's own scripts: repin rewrote all seven in both project files, instantiate succeeded on jd/openapi-1x, the manifest check reported seven packages resolved to the checkout, and PowerSystems loaded against this branch.
… documents with a newline
`document_tree(::PortfolioDocument)` handed its four association and supplemental-attribute
arrays to JSON as raw structs, where the SystemDocument tree routes every array through
`_bucket` (that is, `_encode`). Serializing a generated struct field by field also writes its
`additional_properties` passthrough -- the very field `_encode` exists to splat -- so a
read/write round trip grew an empty `"additional_properties": {}` on every association row.
Only `components` was encoded correctly.
Both writers also omitted the trailing newline the Python and TypeScript writers emit, so a
document written here differed from the same document written there by one byte. Python's
`write_document` documents that newline as what makes output byte-identical "against documents
produced by other tools in this ecosystem, which all emit one"; this makes that true.
Together these close the last two byte-level differences between the three languages for
PortfolioDocument: a portfolio written by TypeScript now round-trips through Julia byte for
byte. For SystemDocument the only remaining difference is how the generated DateTime encoder
renders a whole-second instant (`...T00:00:00.000Z` here, `...T00:00:00Z` there), which lives
in codegen rather than these containers.
Each fix gets a regression test; the leak test fails without the `_bucket` change.
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.
This is to address the comments here to register JuliaRegistries/General#168068
Needs a review of the content with detail