-
Notifications
You must be signed in to change notification settings - Fork 897
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
Framework to support W3C test-driven specification #2003
Conversation
ece225a
to
f87311f
Compare
It would be useful to to start with the motivation for the change, what are the cons and pros and why we should adopt it. This appears related to https://github.com/open-telemetry/opentelemetry-specification/pull/1211/files which did not gain traction. What has changed that we should consider this now? |
3d61a40
to
62db85c
Compare
Yes, good point: Motivation for this changeThe spec is hard to understand because it is written in an inconsistently-applied formal language. Here are some examples:
When implementing OpenTelemetry it is very hard to know what has to be implemented because there is no clear listing of all requirements. If the specifcation is written in the way intended in this PR it will be possible to generate automatically a list of every requirement and condition that the specification states. It is also much easier to check that the specification is correct if we only need to check a list of well defined sections. Some checks (like having a RFC 2119 keyword, for example) can even be automated.
Specification-wise, nothing. The specification continues to have the same problems it had when #1211 was opened. This PR now introduces support to parse conditions and conditional requirements. To illustrate better what this PR attempts to achieve, here is the generated JSON file for the
|
I am a really big fan of this work, @ocelotl! The OpenTelemetry specification is expansive and written by many authors. As we see from your work on #1956, it is difficult if not impossible to construct a compliance matrix from the text of the specification without having the authors and the community members there to help with interpretation. It looks like this can be done iteratively: one step at a time, a part of the specification will be rewritten to match the style given here, at which point the compliance matrix row headings can be automatically checked or generated. Because this is a large PR, I want to encourage you to first (sorry, procedural nits!) file an issue describing the problem "Make the OpenTelemetry specification automatically testable" or something similar. You've already written the motivation above, but we use issues to prioritize discussions about large changes ahead of actual pull requests, usually. Please file an issue that repeats the motivation and also gives a brief explanation of the steps, e.g., (1) merge the spec-writing guidelines, (2) update document status states to manage the transition, (3) merge the tools for generating x/y/z (4) finally for each component of the specification, (a) refactor, (b) regenerate compliance matrix, (c) ... |
62db85c
to
b503896
Compare
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
Is this something that's still being worked on, but maybe elsewhere? |
Not that I am aware of, curious why you ask 😅 |
Fixes #1210
There is a framework for specifications from the W3C, the W3C QA Framework, this is its abstract:
What does this PR do?
specification/baggage/api.md
) to make it follow the W3C QA framework. This change is intended to show how a document would look after being changed to follow the W3C QA Framework.Why did I create this PR?
While I was working on implementing Metrics, I found myself first having to read all the related documents to find the requirements so that I could know what to implement. This is something that should be as easy as looking for all instances of
MUST
,SHOULD
,MAY
, etc but it is not so because there is no guarantee that as the specification is written today every requirement is written in this way (please see this comment for examples). I found it necessary then to make this PR more strict in the way it is being written so that its requirements could be extracted from it.What is the general strategy here?
With the approach suggested here we should be able to generate JSON files that contain all requirements so that they can be then transformed into test cases in each implementation. Once an implementation implements and passes all of the mandatory test cases (the ones whose corresponding RFC 2119 keyword is
MUST [NOT]
or equivalent) and it can consider itself compliant.This idea will require of course rewriting all the documents, but this can be done little by little with one PR per document until we can have all the specification in this format. It is not necessary for this project to stop being developed to format all documents, it continue with some documents in this format and some not.
What about the compliance matrix?
The compliance matrix gathers all the features that each SIG has implemented and marks them as optional or not. I find it convenient but I don't think it is something that gives the level of detail that this approach gives. The compliance matrix is feature-oriented, this approach is requirement-oriented. I think both serve their specific purpose and can continue to exist together.