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

[Play Framework] Regenerate the samples. It was very outdated #3760

Merged
merged 4 commits into from
Aug 27, 2019

Conversation

JFCote
Copy link
Member

@JFCote JFCote commented Aug 26, 2019

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\. If contributing template-only or documentation-only changes which will change sample output, be sure to build the project first.
  • Filed the PR against the correct branch: master, 4.1.x, 5.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

@bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04)

Description of the PR

No changes to the code. Only regenerated the samples for play framework.
It seems nobody had run the update of the samples for play framework for a while... Here they are. @wing328 we should have some test that validate the the samples are update to date from time to time.

@wing328
Copy link
Member

wing328 commented Aug 26, 2019

Please add the script(s) to ./bin/util/ensure-up-to-date so that the samples for play frameworks are always up-to-date.

@JFCote
Copy link
Member Author

JFCote commented Aug 26, 2019

@wing328 Just add it!

@jmini
Copy link
Member

jmini commented Aug 26, 2019

Please add the script(s) to ./bin/util/ensure-up-to-date so that the samples for play frameworks are always up-to-date.

This approach is tracked as #80 (we decided to have it "opt-in", not forcing all the samples/ to participate. From a QA point of view it is better to be on this list, but it is also more maintenance work).

@jmini
Copy link
Member

jmini commented Aug 26, 2019

@JFCote the CI server already reports that some samples are outdated:

	modified:   samples/server/petstore/java-play-framework-api-package-override/public/openapi.json
	modified:   samples/server/petstore/java-play-framework-async/public/openapi.json
	modified:   samples/server/petstore/java-play-framework-controller-only/public/openapi.json
	modified:   samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json
	modified:   samples/server/petstore/java-play-framework-no-bean-validation/public/openapi.json
	modified:   samples/server/petstore/java-play-framework-no-exception-handling/public/openapi.json
	modified:   samples/server/petstore/java-play-framework-no-interface/public/openapi.json
	modified:   samples/server/petstore/java-play-framework-no-wrap-calls/public/openapi.json
	modified:   samples/server/petstore/java-play-framework/public/openapi.json

Merge master into your PR branch and execute the ensure-up-to-date script again.

@JFCote
Copy link
Member Author

JFCote commented Aug 26, 2019

@jmini I'm not sure but I think it is a problem with windows / linux.
When I run ensure-up-to-date, I have tons of changes in the other generators that are unrelated. It's all related to file separator / vs \. There are some line endings too. I have no difference or uncommited files related to java-play-framework samples.

I guess the differences that CircleCI is seing are samples that were generated on my Windows computer, which are different from samples generated on the linux CircleCI machine.

I'm not sure what to do... Is this a bug in the ensure-up-to-date script? Should we hardcode the line ending and file separator char to use to prevent this issue?

Waiting for your advice on how to procede.

@wing328
Copy link
Member

wing328 commented Aug 27, 2019

Ran the script locally and here is the result:

Executed ./bin/dart-petstore.sh successfully!
Executed ./bin/dart2-petstore.sh successfully!
Executed ./bin/java-play-framework-petstore-server-all.sh successfully!
Executed ./bin/meta-codegen.sh successfully!
Executed ./bin/utils/export_docs_generators.sh successfully!
Executed ./bin/utils/copy-to-website.sh successfully!
Executed ./bin/utils/export_generators_readme.sh successfully!
Git working tree is clean
➜  openapi-generator git:(generated-samples-with-new-swagger-parser) 

No clue at the moment why the samples (play framework) are still outdated.

@jmini
Copy link
Member

jmini commented Aug 27, 2019

I think the serialization to json is not stable/deterministic see my issue: swagger-api/swagger-core#2828

We have fixed it for Yaml, but we need to do the same for Json.

@jmini
Copy link
Member

jmini commented Aug 27, 2019

I think I have improved the JSON serialization with #3763. Please do a review. Once merged I am happy to rebase this PR and generate the samples again.

Copy link
Member

@jmini jmini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JFCote JFCote merged commit f94ff32 into master Aug 27, 2019
@JFCote JFCote deleted the generated-samples-with-new-swagger-parser branch August 27, 2019 15:13
@wing328
Copy link
Member

wing328 commented Sep 12, 2019

@JFCote thanks for the PR, which has been included in the v4.1.2 release: https://twitter.com/oas_generator/status/1172068944355528705

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.

3 participants