Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract specification snippets as standalone JSON files (latest) #110

Merged
merged 7 commits into from
Apr 8, 2022

Conversation

sbesson
Copy link
Member

@sbesson sbesson commented Mar 18, 2022

Follow-up of #98, this ports the additions made to the 0.4 specification i.e. the extraction of the JSON snippets and new DOcuments conventions paragraph to the latest specification.

Additionally, 0765b4d and ff936b8 proposes to add the rest of the validation infrastructure i.e. the JSON schemas and the validation tests run as part of the CI to the latest subfolder.
From my perspective, the secondary benefit of adding this infrastructure is to make the JSON examples and schemas truly first-class citizens of upcoming NGFF proposals made against latest. The primary downside is that it might introduce some friction for instance if multiple features are under development. Interesting to hear what people who proposed the next set of breaking changes of the specification feel about this approach especially @bogovicj (#94) and @joshmoore (#104).

@bogovicj
Copy link
Contributor

Nice @sbesson !

make the JSON examples and schemas truly first-class citizens of upcoming NGFF proposals

My first impression is that this is a really idea. Better to have to think about existing examples when making changes than to forget about them! I'll look more carefully next week

"$id": "https://ngff.openmicroscopy.org/0.4/schemas/strict_image.schema",
"allOf": [
{
"$ref": "https://ngff.openmicroscopy.org/0.4/schemas/image.schema"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these IDs get updated directly to /0.5/ at this point? (don't need to use /latest/, right?)
NB: I notice that https://ngff.openmicroscopy.org/0.4/schemas/image.schema is 404, so this schemas won't work without the custom resolver used in the tests.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No you are correct, I didn't do the update work as I was waiting to get a consensus about the value of adding these scneas.

A few comments:

  • definitely need to replace 0.4. I would not use 0.5 as that would communicate a released schema and that has the potential of creating confusion. latest would be an option or maybe something that explicitly says this is a development schema e.g. 0.5dev?
  • the individual version elements in the JSON snippets/examples will likely need to be updated to follow the same convention
  • the release process will need to be amended to include these steps

@sbesson
Copy link
Member Author

sbesson commented Apr 5, 2022

Pushed another commit using 0.5-dev as the version value in all the relevant snippets. Other suggestions welcome but in all cases, whatever gets used should clearly communicate this is in-progress specification and should not be used in production

@joshmoore
Copy link
Member

Pushed another commit using 0.5-dev Nice! 👍

@joshmoore
Copy link
Member

https://api.csswg.org/bikeshed/?url=https://raw.githubusercontent.com/sbesson/ngff/json_snippets_latest/latest/index.bs continues to look good. There are still a few 0.4 matches in the document. For those in the index.bs itself, adding:

Text Macro: NGFFVERSION 0.5-dev

to the header will lead to replacement. This unfortunately does not work for the <pre class=include-code> block. (Only class=include which doesn't do any formatting.)

@sbesson
Copy link
Member Author

sbesson commented Apr 7, 2022

Created a text macro to manage the replacements (all the other usages of 0.4 are legit and refer either to the stable version and/or to the version history). Also replaced the versions in the JSON snippets manually. My intent once this is merged is to extract all included code blocks into standalone JSON files so that we can validate them via JSON schemas and include them in the spec.

}
],
"coordinateTransformations": [{
// the time unit (0.1 milliseconds), which is the same for each scale level
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these comments valid JSON? Do they cause any issues? (I see they are the same as this under 0.4/)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from #98 (comment)

a new Document conventions section is added to the specification which ... clarifies the explanation scope of the comments in the JSON snippets

@joshmoore joshmoore mentioned this pull request Apr 7, 2022
@joshmoore
Copy link
Member

Any objections to moving forward with this?

@will-moore
Copy link
Member

GFI 👍

@bogovicj
Copy link
Contributor

bogovicj commented Apr 8, 2022

looks good to me

@joshmoore joshmoore merged commit caa7e8e into ome:main Apr 8, 2022
github-actions bot added a commit that referenced this pull request Apr 8, 2022
…test

 Extract specification snippets as standalone JSON files (latest)

SHA: caa7e8e
Reason: push, by @joshmoore

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@sbesson sbesson deleted the json_snippets_latest branch April 8, 2022 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants