-
-
Notifications
You must be signed in to change notification settings - Fork 207
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
Break optional/ into more granular directories. #590
base: main
Are you sure you want to change the base?
Conversation
`may` and `should` now represent explicitly recommended or allowed behavior. `additional` contains other files whose applicability isn't made explicitly clear, or which requires support for additional vocabularies. `alternatives` contains "mutually contradicting" tests depending on which choice was made by an implementation amongst a number of possible options. Each test in our previous optional/ directory is then sorted into one of these directories.
Obviously given this PR essentially shuttles files around, and generally does the same shuffling for all drafts, I'd recommend focusing more on where files land in a local checkout, as well as providing any feedback about the directory layout itself, more so than staring at the GitHub UI. |
It's a shame files can't be treated as object references that you can prevent breaking everyone by just linking to... oh wait... (Yeah, that wouldn't work.) I like this change. I'll look at it in the morning. |
I considered symlinking everything back to where it was for a bit, but honestly our backwards compatibility policy is so poorly defined it's just not worth bothering :), even though I know you were being facetious anyhow. I wanted to get to #223 sometime before doing things like this but I haven't had the head for writing up longer docs recently, and folks have begun to get in the way of changes to |
I'd like to propose |
I specifically want something "uninformative", and disagree that what's there is simply "allowable". In say, a file like For things the spec wants to make recommendations on, we should make them part of the spec, otherwise I indeed don't want us making prescriptive choices here on things where the spec doesn't, it's just easy not to pick a side. |
OK, I see your point about bignum. Digging a bit deeper here, it looks like
And then under MAY you have Of these, it's only As for the tests currently assigned to additional... environmentalThe environmental tests would be better off in an implementation-specific (non-configurable)The implementation-specific choices are what I would expect to see in an I do not think that implementation-specific (configurable)For For
So it's acceptable to implement a configuration option that turns on assertion behavior and then ignore it. We could leave them and assume people will run only the tests for formats that they validate, I guess, in which case they are in the same
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks fine to me. Just the one comment, and I'll let you and @handrews work out the folder structure.
I wonder if there's a way we can notify the implementation community that all of their builds are about to break. I'll post a comment in Slack, but I'm not sure what else there is to do.
"schema": { | ||
"$id": "https://schema/using/format-assertion/false", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is removing the $id
going to break things? (cc: @karenetheridge) (seen in several places)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am pretty sure no, it's just an extra unneeded validator that was in these schemas.
Probably I simply confused it with
It's not clear yet to me that the extra complexity (of extra folders) is worthwhile; I'm open to the idea in theory if it turns out to be after hashing out the rest of the comments, but otherwise just because the reason for each file is different doesn't mean it needs to be in a different place. The interpretation of the folder to implementors should be "you need to look at each of these files and decide whether to run each one for your implementation" -- whether the reason is because of your programming language or additional functionality you added beyond the spec is a semantic difference but not a hugely material practical one for that decision.
"Additional" means "additional tests beyond those in the top folder which everyone should run". Not additional to the spec and implying the spec doesn't mention anything about them.
They're not specified to be on by default, the specs say, e.g. in 7:
The language you quoted afterwards (about
The reason to put them in different locations is that content is boolean on-or-off, and if it's on, you run all the tests. Format is not, as you pointed out yourself, where an author who supports some formats still gets to identify which subset to run. We aren't going to test something like that in
I considered this, and am potentially open to it in the future for additional vocabularies we may have or test, but again As for some other specifics:
The spec doesn't today say or encourage implementations to support multiple drafts in the first place, so while the ref behavior is well defined whether an implementation supports the second draft or not is purely for the implementer to know.
You're referring I assume to some not-yet-here file about schemas without |
Oh, whoops, that was a local file, sorry about that, please ignore.
Since the whole point of this is to have directory names that are more meaningful and consistently understood, I think it's relevant that the word you have chosen isn't intuitive enough in its meaning to be clear. This meaning of "additional" is just a renamed "optional" and in my opinion not an improvement.
The full quote (unchanged from draft-04 to draft-07) is:
You don't add an option to disable something unless it's on by default. We specifically inverted that between draft-07 and 2019-09:
(the default meta-schema for 2019-09 declares the vocabulary with
I don't see that sort of language pre-2019-09 at all. The only similar language is I added that language specifically to align the specification with the reality of implementations such as your oft-stated bit about only validating
That's not what I was suggesting, I'm well aware of the combinatorics involved. Either way ( Configuration options are something we have moved away from - the only remaining one mentioned by the spec AFAIK is for
This would only be for the format-assertion vocabulary in 2020-12, which is the only time we have a non-mandatory vocabulary anywhere. In 2019-09 it works differently - I might see that as a vocabulary directory but it's too late in the evening for me to try to unravel 2019-09's But this is definitely the least important concern.
I don't understand what this is responding to. The spec in 2019-09 and later doesn't specifically encourage it, but also doesn't disallow it, and talks specifically about controlling implementation behavior by recognizing |
It's definitions where there's language in the spec, dependencies just appears in the metaschemas still.
…ADME doc language.
I disagree with a number of things you said, but I honestly am finding it hard to tell which are relevant to this PR and therefore what changes you're suggesting at this point and which you've come around on. Let's try perhaps focusing on one at a time. Can you share a concrete change you're suggesting is incorrect in the current layout (a file which is in a place different than you think it should be)? The |
I believe it is all relevant to this PR, but yes, one at a time sounds good. Let's start with You stated that
with part of the reasoning being because unlike
You mentioned how
So it seems to me that the decision process for |
Yep, sounds good.
Yes. What you're quoting is if an implementation has it on by default, then it should offer an option to turn that off. But there's no need to deduce anything from that line, the spec explicitly says beforehand in the line I quoted that an implementation MAY turn format on as an assertion. Not SHOULD or MUST. If I had to explain that to someone, I'd say that means it's off by default with some implementations deciding to turn it on. But this is one of the things I was referring to as not being sure if it's relevant to this PR, as I'm not sure either way it has any bearing it's just semantics, as yes indeed the point of those tests is for an implementation which is deciding now to configure itself for format assertion behavior and run some subset of them.
The only way
Just to be sure -- in this repo for whatever reason (mostly because we were inconsistent on terminology previously, and Shawn wrote a README with these definitions which were as good as any others) we settled on "test" meaning something specific, and it's not the whole file. The definitions are here. So test files have test cases which have tests. So someone can choose to run the On the other hand, as you say:
I agree! So it seems we may indeed agree in practice -- but I just think this is quite unlikely, and a lot smaller cardinality (I don't expect any implementation which implements content actually doesn't support both JSON and base64 which is what we have there), so the extra benefit of having a full alternatives file seemed more useful. In other words yes if an implementation supported only a subset of what's in that file they'd be in the same situation as format, but we only have JSON and base64 in that file and it seems very unlikely that someone supports content as an assertion and not those, therefore I put it there. Purely based on the spec though I agree, and content could go in |
Thanks for the detailed reply, @Julian. Regarding Regarding what I classified as environment-specific tests, you have explained your position and indicated a possible openness to future change, so we're good on that point. Regarding everything else about |
@jdesrosiers (who I think is OOO) / @karenetheridge / @santhosh-tekuri / any other implementers/watchers, do you follow the new directories and/or have feedback about where files belong based on your readings of the spec? |
I don't run the optional tests, so I don't have any opinions rooted in experience. Honestly, I haven't been following the conversation closely enough, so the following might be irrelevant. IMO, |
The test suite is really about reducing test burden for downstream implementations as well, or at least that was the original vision. The spec says implementations should use ecma regexes, it seems hard to justify not having tests for implementations that use them and don't want to replicate their own tests for them rather than sharing with all other implementations which do. But if you have no opinion will perhaps leave that "discussion" for elsewhere. Any other feedback from others? |
This PR breaks our existing
optional/
directory into 4 new directories, and sorts existing tests into the 4 new directories:may/
andshould/
now represent explicitly recommended or allowedbehavior.
additional/
contains other files whose applicability isn't madeexplicitly clear, or which requires support for additional vocabularies.
alternatives/
contains "mutually contradicting" tests depending onwhich choice was made by an implementation amongst a number of possible
options. In theory one could have
should
andmay
directories here, but things start to seem unnecessarily complex, so I've left this flat for now.Each test in our previous
optional/
directory is then sorted into one ofthese directories.
The goal for the above is to be as objective as possible. The suite is, as I always say, not the spec, and not here to pepper over things, so which directory a particular file belongs in should be clear-as-day or else belongs in the
additional
bucket until/unless the spec makes a proposed recommendation about it.In general this PR doesn't add any tests, except in the case of the
alternatives
directory where for 2 cases (content
in draft 7 andformat-assertion: false
in 2020/19) we already had tests for one alternative and not the other.Additional documentation for each file which links the file to the corresponding section of the spec (which hopefully outlines why or when it is optional) is left for a follow-up PR.
Clearly this is backwards incompatible for users of the suite unfortunately, but I've tried to keep the new layout as similar as possible while resolving some of the complaints about the word "optional" being unclear.
Refs: #495 #25