Skip to content
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

[core][general] Add metadata file tracking to aid in "Golden Tests" regeneration #6325

Merged
merged 7 commits into from
May 22, 2020

Conversation

jimschubert
Copy link
Member

Discussed this with @Fjolnir-Dvorak as a way to simplify his #4030.

This adds a FILES file under the metadata directory in the generated directory.

The idea is that we could use this to allow for automatic "clean" of generated sources to avoid issues where file renames or stale files require manual cleanup.

cc @OpenAPITools/generator-core-team

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project before.
  • Run the shell script(s) under ./bin/ (or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).
  • File the PR against the correct branch: master, 4.3.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

@jimschubert jimschubert added this to the 5.0.0 milestone May 16, 2020
@auto-labeler
Copy link

auto-labeler bot commented May 16, 2020

👍 Thanks for opening this issue!
🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

jimschubert and others added 4 commits May 16, 2020 09:38
* master:
  Update username (arun-nalla) (#6319)
  [typescript-axios] Implement useSingleRequestParameter option (#6288)
  [typescript] Remove "v4-compat" value of enumSuffix (#6308)
  Mark swift4 generator as deprecated (#6311)
  Remove @nickmeinhold from Dart technical committee (#6309)
  Migrate Erlang samples to use OAS 3 spec (#6297)
  update dart samples
  Improve parameter documentation (#6092)
  Minor improvements to `plantuml` doc generator (#6298)
  undo changes to petstore.yaml oas3.0 (#6299)
  Allow passing progress callbacks through client methods. (#6261)
  Create method to json (#6111)
@wing328
Copy link
Member

wing328 commented May 17, 2020

Running ./bin/swift5-petstore-readOnlyProperties.sh (output to /dev/null)
--
4750 | [main] ERROR o.o.c.config.CodegenConfigurator - ./bin/swift5-petstore-readonlyProperties.json (No such file or directory)
4751 | [main] ERROR o.o.c.config.CodegenConfigurator - ./bin/swift5-petstore-readonlyProperties.json (No such file or directory)
4752 | Exception in thread "main" java.lang.RuntimeException: Unable to deserialize config file: ./bin/swift5-petstore-readonlyProperties.json
4753 | at org.openapitools.codegen.config.CodegenConfigurator.readDynamicSettings(CodegenConfigurator.java:146)
4754 | at org.openapitools.codegen.config.CodegenConfigurator.fromFile(CodegenConfigurator.java:82)
4755 | at org.openapitools.codegen.cmd.Generate.execute(Generate.java:267)
4756 | at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
4757 | at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:61)
4758 | Running ./bin/swift5-petstore-result.sh (output to /dev/null)

That's the issue reported by Drone.io CI.

I couldn't repeat the issue locally and I don't see any changes to ./bin/swift5-petstore-readonlyProperties.json in this PR ....

@jimschubert
Copy link
Member Author

@wing328 yeah I didn't touch that file or anything to do with deserialize logic. Drone sometimes gets into some state that I can't clear (probably bad cache).

@wing328
Copy link
Member

wing328 commented May 19, 2020

Minor suggestion: what about adding 1 or 2 lines (starting with # to indicate it's a comment) explaining what FILES does?

@jimschubert
Copy link
Member Author

@wing328 I don't think adding a comment is necessary here. The filename and contents are pretty self explanatory. We can document online if people require more details.

@jimschubert jimschubert merged commit 70ca935 into master May 22, 2020
@jimschubert jimschubert deleted the file-tracking branch May 22, 2020 20:48
@wing328
Copy link
Member

wing328 commented May 23, 2020

The actual error in Drone.io CI is

Running ./bin/cpp-qt5-petstore.sh (output to /dev/null)
Exception in thread "main" java.lang.IllegalArgumentException: 'other' is different type of Path
    at java.base/sun.nio.fs.UnixPath.relativize(UnixPath.java:429)
    at java.base/sun.nio.fs.UnixPath.relativize(UnixPath.java:43)
    at org.openapitools.codegen.DefaultGenerator.lambda$generate$3(DefaultGenerator.java:1074)
    at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
    at java.base/java.util.stream.SortedOps$RefSortingSink.end(SortedOps.java:395)
    at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:258)
    at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:258)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
    at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
    at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
    at org.openapitools.codegen.DefaultGenerator.generate(DefaultGenerator.java:1073)
    at org.openapitools.codegen.cmd.Generate.execute(Generate.java:431)
    at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
    at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:61)
ERROR!! FAILED TO RUN ./bin/cpp-qt5-petstore.sh

I can now repeat the issue in the master.

Does the error message give you any clue on why `./bin/cpp-qt5-petstore.sh failed to run?

jimschubert added a commit to jimschubert/openapi-generator that referenced this pull request May 23, 2020
* master:
  [samples] Regenerate python-experimental
  [core][general] Add metadata file tracking to aid in "Golden Tests" regeneration (OpenAPITools#6325)
  [python-experimental] Add support for pep 3134, attach cause of exception (OpenAPITools#6388)
  [Java-jersey2] Add new ApiClient constructor with auth objects (OpenAPITools#6393)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants