Giter Site home page Giter Site logo

Comments (9)

jmini avatar jmini commented on May 6, 2024

This seems to be really complicated to do right now because we still have work to have all generator generated by our generator.

I instead of using bin/run-all-petstore we could have an other a sh script (bin/run-important-petstore) that calls our most important bin/*.sh scripts. The list could grow over time and at the end it could be similar to bin/run-all-petstore.

After run of bin/run-important-petstore, there should be no modification the git working tree, because all modifications should be included in the PR.

Maybe this will only run locally at the beginning (and not enforce at CI level), but this will be a good start giving more confidence when we work on stuff in DefaultCodegen.

from openapi-generator.

jonschoning avatar jonschoning commented on May 6, 2024

currently all the scripts in bin/openapi3 also target samples/client/petstore, so effectively they overwrite each other depending on which you choose.

from openapi-generator.

tomplus avatar tomplus commented on May 6, 2024

Definitely it's necessary and adding the check to CI is good enough for me.

I agree that some generators are not ready yet. We skip these in unit tests and so we can also skip it here too. I'm thinking about defining some kind of 'maturity level' for generators. If a technical committee decides that their generator is production-ready, they will add this to all tests cases.

from openapi-generator.

jmini avatar jmini commented on May 6, 2024

Ok what should be the list of mature generator that we want to use as input to force the update of samples/ folder?

from openapi-generator.

jmini avatar jmini commented on May 6, 2024

I have made great progress on a first version of a bin/ensure-up-to-date script.
"Shippable CI" now as first step ensure that samples/ is up to date for a list of generators.
The list of bin/*.sh scripts is defined in the bin/ensure-up-to-date itself.
=> See PR #136


In my opinion the list scripts executed during this check can evolve over time. For the beginning, we should select:

  • Mature generators.
  • Generator supported by people doing PR review regularly (because if something evolves in a generated sample and feedback is requested on the PR to tell if it is good or bad).

I wanted to add more items to the list:

  • generators used by a lot of users
  • programming languages that are well known

But I have the feeling that those items are not measurable and will create too much debate...


Feel free to give your opinion.

from openapi-generator.

jmini avatar jmini commented on May 6, 2024

As mentioned in #136, we can keep this issue open and propose new PRs to add other generators in the list.

from openapi-generator.

ackintosh avatar ackintosh commented on May 6, 2024

Totally agree with adding the check. I'll add generator that I'm reviewing regularly to the list.

As mentioned in #80 (comment) , the list will grow over time and the target generator could be similar to run-all-petstore .
When it comes, we need to consider running run-all-petstore instead of {LANG}-petstore.sh on the PR as only differences caused by the PR will be generated by run-all-petstore.

from openapi-generator.

jmini avatar jmini commented on May 6, 2024

@macjohnny, @TiFu: I have noticed a lot of activity/review around the typescript generator.

If you are interested by the feature described here (checking with each PR that the generator runs and that its result included in a commit as part of the same PR to make the Shippable build green), feel free to add the necessary bin/*.sh scripts in the list:

# LIST OF SCRIPTS:
./bin/ruby-petstore.sh > /dev/null 2>&1
./bin/java-petstore-all.sh > /dev/null 2>&1
./bin/java-jaxrs-petstore-server-all.sh > /dev/null 2>&1
./bin/spring-all-pestore.sh > /dev/null 2>&1
./bin/kotlin-client-petstore.sh > /dev/null 2>&1
./bin/kotlin-client-string.sh > /dev/null 2>&1
./bin/kotlin-client-threetenbp.sh > /dev/null 2>&1
./bin/kotlin-server-petstore.shl> /dev/null 2>&1
./bin/php-petstore.sh > /dev/null 2>&1
./bin/php-silex-petstore-server.shj> /dev/null 2>&1
./bin/php-symfony-petstore.sh > /dev/null 2>&1
./bin/php-lumen-petstore-server.sh > /dev/null 2>&1
./bin/php-slim-petstore-server.sh > /dev/null 2>&1
./bin/php-ze-ph-petstore-server.sh > /dev/null 2>&1
./bin/openapi3/php-petstore.sh > /dev/null 2>&1

from openapi-generator.

jimschubert avatar jimschubert commented on May 6, 2024

#4030 is an in-progress work to clean up the samples directory.
#3789 is an initial take on generating the samples in batch.

I think there are a few issues currently with generating the samples directory:

  • It take a very long time to run the ensure-up-to-date script (attempting to address this with my batch PR)
  • We only overwrite previous files, we don't clean up old files… this means that a change in how we name files (either via code manipulation, or changes to yaml spec doc) may result in compilation errors that OSS contributors may not understand or care to spend time resolving on their PRs.
  • People seem to find the output directory confusing; is it samples? is it regression tests? is it compilation tests?
  • It's not all-inclusive. How do we know when a "sample" is ready to be considered a sample for the ensure-up-to-date script?

Speaking with @Fjolnir-Dvorak on Slack, I suggested that we may want to consider outputting the list of generated files to a text file under the .openapi-generator directory (as we do currently with VERSION). We could automate recreation of samples using this output, and rather than having the samples.ci directory which caches non-generated sources, we could make use of .openapi-generator-ignore and persist these directly in the samples directory. To do this, we'd need:

We could then use Github Actions to run ensure-up-to-date (I believe).

from openapi-generator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.