Re: [PATCH v3 0/3] Add a JSON Schema for trace2 events
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 25, 2019, 16:14 UTC
- Message-ID
- <xmqqd0hyqegh.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20190725111803.GL20404@szeder.dev>
SZEDER Gábor <szeder.dev@gmail.com> writes:
Show 6 quoted lines
>> I would appreciate any feedback on better ways to integrate the >> validator into the CI suite. > > How about adding a test script dedicated to JSON schema validation, > which runs only as many git commands as needed to cover all trace2 > events.
Sensible, but might be hard to arrange, as the trace2 annotations on codepaths are not frozen.
I wonder if these schema definitions can somehow be read in reverse by machine to automatically generate helper functions that would by definition produce schema-valid json objects, and the current callers of trace2_*() that logs stuff can be updated to call them? That way, we'll automatically and always be producing valid output, or am I dreaming?