varasto icon indicating copy to clipboard operation
varasto copied to clipboard

Store generated Go code in version control

Open joonas-fi opened this issue 4 years ago • 0 comments

This is against many good practices, but we simply can't ask people importing our code to run the code generators, and people using tools like Go dep, Go modules etc. necesssarily don't even have the code generating bits imported (at least dep only imports the packages explicitly imported by user).

Even the example code doesn't work due to this, when imported from outside of Varasto project: https://function61.com/varasto/docs/developers/api-overview/#example-code

Another example will be all-the-bits importing our invididual-file metadata spec (#178)

More thoughts: https://stackoverflow.com/a/56417892 (i.e. library vs. app - Varasto is both).

Generated TypeScript code doesn't have to be committed (as that is not used as a library).

Need to add assertion to the build causing build to fail if output from code generation is different than what is committed. TODO: are all our code generation deterministic? Map iteration order is random..

joonas-fi avatar Jun 25 '20 10:06 joonas-fi