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

[Python] Fix delimiter collision issue #5981 #5982

Closed
wants to merge 3 commits into from
Closed

[Python] Fix delimiter collision issue #5981 #5982

wants to merge 3 commits into from

Conversation

fullcircle23
Copy link
Contributor

@fullcircle23 fullcircle23 commented Apr 20, 2020

Wrap the default and example value string literals using double quotes (instead of single quote) to avoid the need to escape any embedded single quotes and also to avoid any invalid syntax errors due to delimiter collision in the generated test code.

Also:

  • Modified 1 test.
  • Added 1 test.

Open Issues

If merged, this will resolve #5981

PR checklist

  • Read the contribution guidelines.
  • Ran 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).
  • Filed the PR against the correct branch: master, 4.3.x, 5.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.
    @taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11) @tomplus (2018/10) @Jyhess (2019/01) @slash-arun (2019/11) @spacether (2019/11)

@fullcircle23
Copy link
Contributor Author

fullcircle23 commented Apr 21, 2020

aargh.. I missed the step to commit the Petstore samples related to my fix. Doing it now..

@fullcircle23
Copy link
Contributor Author

fullcircle23 commented Apr 21, 2020

To update the Petstore samples, I ran ./bin/python-petstore.sh and ./bin/openapi3/python-petstore.sh and got the following list of samples to be updated:

    modified:   samples/client/petstore/python/docs/Animal.md
    modified:   samples/client/petstore/python/docs/Category.md
    modified:   samples/client/petstore/python/docs/FakeApi.md
    modified:   samples/client/petstore/python/docs/TypeHolderDefault.md
    modified:   samples/client/petstore/python/petstore_api/models/animal.py
    modified:   samples/client/petstore/python/petstore_api/models/category.py
    modified:   samples/client/petstore/python/petstore_api/models/type_holder_default.py
    modified:   samples/openapi3/client/petstore/python/docs/Animal.md
    modified:   samples/openapi3/client/petstore/python/docs/Category.md
    modified:   samples/openapi3/client/petstore/python/docs/FakeApi.md
    modified:   samples/openapi3/client/petstore/python/docs/Foo.md
    modified:   samples/openapi3/client/petstore/python/docs/InlineObject2.md
    modified:   samples/openapi3/client/petstore/python/petstore_api/models/animal.py
    modified:   samples/openapi3/client/petstore/python/petstore_api/models/category.py
    modified:   samples/openapi3/client/petstore/python/petstore_api/models/foo.py
    modified:   samples/openapi3/client/petstore/python/petstore_api/models/inline_object2.py

Question: Do I need to run ./bin/utils/ensure-up-to-date? After running ensure-up-to-date, I got the below list of changes. Do these need to be committed as well?

    modified:   samples/client/petstore/python-asyncio/docs/Animal.md
    modified:   samples/client/petstore/python-asyncio/docs/Category.md
    modified:   samples/client/petstore/python-asyncio/docs/FakeApi.md
    modified:   samples/client/petstore/python-asyncio/docs/TypeHolderDefault.md
    modified:   samples/client/petstore/python-asyncio/petstore_api/models/animal.py
    modified:   samples/client/petstore/python-asyncio/petstore_api/models/category.py
    modified:   samples/client/petstore/python-asyncio/petstore_api/models/type_holder_default.py
    modified:   samples/client/petstore/python-tornado/docs/Animal.md
    modified:   samples/client/petstore/python-tornado/docs/Category.md
    modified:   samples/client/petstore/python-tornado/docs/FakeApi.md
    modified:   samples/client/petstore/python-tornado/docs/TypeHolderDefault.md
    modified:   samples/client/petstore/python-tornado/petstore_api/models/animal.py
    modified:   samples/client/petstore/python-tornado/petstore_api/models/category.py
    modified:   samples/client/petstore/python-tornado/petstore_api/models/type_holder_default.py
    deleted:    samples/server/petstore/python-blueplanet/.openapi-generator-ignore
    deleted:    samples/server/petstore/python-blueplanet/.openapi-generator/VERSION
    deleted:    samples/server/petstore/python-blueplanet/README.md
    deleted:    samples/server/petstore/python-blueplanet/requirements.txt

@taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11) @tomplus (2018/10) @Jyhess (2019/01) @slash-arun (2019/11) @spacether (2019/11)
I'm planning to redo my changes on a new branch to have a clean commit. Appreciate if someone could answer my question above. Thanks in advance.

@fullcircle23
Copy link
Contributor Author

fullcircle23 commented Apr 23, 2020

To update the Petstore samples, I ran ./bin/python-petstore.sh and ./bin/openapi3/python-petstore.sh and got the following list of samples to be updated:
. . .
. . .
@taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11) @tomplus (2018/10) @Jyhess (2019/01) @slash-arun (2019/11) @spacether (2019/11)
I'm planning to redo my changes on a new branch to have a clean commit. Appreciate if someone could answer my question above. Thanks in advance.

Getting a bit more familiar with CircleCI now.. found my answer in the logs. I need to commit all the "uncommitted changes in working tree after execution of 'bin/ensure-up-to-date'".

@spacether
Copy link
Contributor

Why did you close this?

@fullcircle23
Copy link
Contributor Author

Why did you close this?

Hi @spacether, I actually did git reset --hard HEAD@{1} on my branch to fix an incorrect merge push and that caused the PR to close. I'm going to be redoing the changes and reopening this PR.

@fullcircle23 fullcircle23 reopened this Apr 26, 2020
@spacether
Copy link
Contributor

Why are there java and dart changes in this PR? Should python only be in here?

@fullcircle23
Copy link
Contributor Author

fullcircle23 commented Apr 28, 2020

Why are there java and dart changes in this PR? Should python only be in here?

I committed all files that were modified after running ensure-up-to-date and that included some dart and java changes. So I should commit only the python files after ensure-up-to-date even if there are non-python files?

Also, do I commit only the python client files or all python files including the server files?

I also can't get circle-ci to build my forked repo. My last 2 attempts after syncing with upstream:
https://circleci.com/gh/fullcircle23/openapi-generator/12#tests/containers/2
https://circleci.com/gh/fullcircle23/openapi-generator/15?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

Hope you can provide clear steps/example that I can follow to complete this PR.

Thanks..

@spacether
Copy link
Contributor

spacether commented Apr 30, 2020

Why are there java and dart changes in this PR? Should python only be in here?

I committed all files that were modified after running ensure-up-to-date and that included some dart and java changes. So I should commit only the python files after ensure-up-to-date even if there are non-python files?

Also, do I commit only the python client files or all python files including the server files?

I also can't get circle-ci to build my forked repo. My last 2 attempts after syncing with upstream:
https://circleci.com/gh/fullcircle23/openapi-generator/12#tests/containers/2
https://circleci.com/gh/fullcircle23/openapi-generator/15?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

Hope you can provide clear steps/example that I can follow to complete this PR.

Thanks..

If there are non-python files that ensure up to date swept up then something is wrong.
One thing that you can test is switch to master + run ensure up to date. If there are no changes, then all of these changes were generated by your branch only, in which case python changes should not impact dart and java samples.
Some suggestions that I have are:

  • ensure master does not generate ensure up to date changes
  • rebase your branch on upstream master
  • re-run ensure-up-to-date after rebasing

@fullcircle23
Copy link
Contributor Author

@spacether Thanks! I'll try your suggestions and get back here.

@fullcircle23
Copy link
Contributor Author

@spacether Whatever I do it seems (rebasing or hard reset to upstream/master), I could not get my master branch to not generate ensure up to date changes.
My master branch on GitHub is even with OpenAPITools:master
My local master branch is up to date with 'origin/master' - nothing to commit, working tree clean.
I ran mvn verify and it finished in about 2 minutes with BUILD SUCCESS.
I then ran ./bin/utils/ensure-up-to-date --batch and got UNCOMMITTED CHANGES ERROR for dart, java, and 1 php-slim4 as copied below.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   samples/client/petstore/dart2/openapi/lib/api/pet_api.dart
        modified:   samples/client/petstore/dart2/openapi/lib/api/store_api.dart
        modified:   samples/client/petstore/dart2/openapi/lib/api/user_api.dart
        modified:   samples/client/petstore/dart2/openapi/lib/api_client.dart
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/CatAllOf.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/DogAllOf.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumClass.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterEnum.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java
        modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java
        modified:   samples/server/petstore/php-slim4/lib/Model/EnumClass.php

no changes added to commit (use "git add" and/or "git commit -a")
Please run 'bin/utils/ensure-up-to-date' locally and commit changes (UNCOMMITTED CHANGES ERROR)

I could delete my fork, recreate it and try ensure-up-to-date again. Deleting my fork will probably close this PR. In any case, I'll have to resolve this in my branch first.

@spacether
Copy link
Contributor

spacether commented May 3, 2020

@spacether Whatever I do it seems (rebasing or hard reset to upstream/master), I could not get my master branch to not generate ensure up to date changes.

I could delete my fork, recreate it and try ensure-up-to-date again. Deleting my fork will probably close this PR. In any case, I'll have to resolve this in my branch first.

Yup, it sounds like something is not working with your branch/fork.
ensure-up-to-date is run in CI so master branch should not have any uncommitted changes after we run ensure-up-to-date on it.

Have you tried rebasing your forked master on upstream/master? I do:

git checkout master
git fetch upstream master
git rebase upstream/master
git push -f

And you could also do that on this PR branch to base it on the latest upstream master commit.

@fullcircle23
Copy link
Contributor Author

fullcircle23 commented May 4, 2020

@spacether Whatever I do it seems (rebasing or hard reset to upstream/master), I could not get my master branch to not generate ensure up to date changes.
I could delete my fork, recreate it and try ensure-up-to-date again. Deleting my fork will probably close this PR. In any case, I'll have to resolve this in my branch first.

Yup, it sounds like something is not working with your branch/fork.
ensure-up-to-date is run in CI so master branch should not have any uncommitted changes after we run ensure-up-to-date on it.

Have you tried rebasing your forked master on upstream/master? I do:

git checkout master
git fetch upstream master
git rebase upstream/master
git push -f

And you could also do that on this PR branch to base it on the latest upstream master commit.

@spacether Thanks.. I've tried rebasing my forked master on upstream/master but to be sure I'm trying it again with your steps exactly on this PR branch.

Circleci build still failed on my forked master. Will delete and re-fork.

@fullcircle23
Copy link
Contributor Author

@spacether still no luck with a new fork. Here is my exact steps. Am I missing something?

  1. Deleted my fork fullcircle23/openapi-generator
  2. Forked from OpenAPITools/openapi-generator
  3. git clone https://github.com/fullcircle23/openapi-generator.git
  4. cd openapi-generator
  5. mvn verify # BUILD SUCCESS
  6. ./bin/utils/ensure-up-to-date --batch

Got exactly the same UNCOMMITTED CHANGES ERROR:

Perform git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   samples/client/petstore/dart2/openapi/lib/api/pet_api.dart
	modified:   samples/client/petstore/dart2/openapi/lib/api/store_api.dart
	modified:   samples/client/petstore/dart2/openapi/lib/api/user_api.dart
	modified:   samples/client/petstore/dart2/openapi/lib/api_client.dart
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/CatAllOf.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/DogAllOf.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumClass.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterEnum.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java
	modified:   samples/server/petstore/php-slim4/lib/Model/EnumClass.php

no changes added to commit (use "git add" and/or "git commit -a")
Please run 'bin/utils/ensure-up-to-date' locally and commit changes (UNCOMMITTED CHANGES ERROR)

@spacether
Copy link
Contributor

spacether commented May 9, 2020

Can you ask your question in the openapi generator #general slack channel? I do not know what would cause that error but someone there should know what is causing it and how to fix it. The slack link is in the Readme file.

@spacether
Copy link
Contributor

spacether commented May 19, 2020

Sorry for the delay here. So I talked to a core team member and figured this our.
We never pass --batch when we are ensuring that samples are up to date.
Also I never use mvn verify but I think that that should work.
Can you try these updated steps for 5 + 6?

1. Deleted my fork fullcircle23/openapi-generator
2. Forked from OpenAPITools/openapi-generator
3. git clone https://github.com/fullcircle23/openapi-generator.git
4. cd openapi-generator
5. mvn clean install
6. ./bin/utils/ensure-up-to-date

@fullcircle23
Copy link
Contributor Author

@spacether Thank you so much for figuring this out. I'll try out your suggestions when I get the chance this week.

@fullcircle23
Copy link
Contributor Author

@spacether I tried the updated steps on a fresh fork, ensure-up-to-date ended with ERROR: Failed to run /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/python-server-all.sh

$ ./bin/utils/ensure-up-to-date
# START SCRIPT: ./bin/utils/ensure-up-to-date
IMPORTANT: this script should be run by the CI (e.g. Shippable) to ensure that the 'samples/' folder is up to date.
When running locally execute with argument --batch.
Please press CTRL+C to stop or the script will continue in 5 seconds.
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/ruby-client-petstore.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/ruby-client-petstore-faraday.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/openapi3/ruby-client-petstore.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/openapi3/ruby-client-faraday-petstore.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/java-petstore-all.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/java-jaxrs-petstore-server-all.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/java-msf4j-petstore-server.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/openapi3/jaxrs-jersey-petstore.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/spring-all-petstore.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/javascript-petstore-all.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/kotlin-client-all.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/kotlin-server-petstore.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/kotlin-springboot-petstore-server.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/kotlin-springboot-petstore-server-reactive.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/mysql-schema-petstore.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/nim-client-petstore.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/python-petstore-all.sh successfully!
ERROR: Failed to run /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/python-server-all.sh

And git status output listed these deleted python-blueplanet files:

$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	deleted:    samples/server/petstore/python-blueplanet/.openapi-generator-ignore
	deleted:    samples/server/petstore/python-blueplanet/.openapi-generator/FILES
	deleted:    samples/server/petstore/python-blueplanet/.openapi-generator/VERSION
	deleted:    samples/server/petstore/python-blueplanet/README.md
	deleted:    samples/server/petstore/python-blueplanet/requirements.txt

no changes added to commit (use "git add" and/or "git commit -a")

@spacether
Copy link
Contributor

spacether commented May 25, 2020

@spacether I tried the updated steps on a fresh fork, ensure-up-to-date ended with ERROR: Failed to run /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/python-server-all.sh

$ ./bin/utils/ensure-up-to-date
# START SCRIPT: ./bin/utils/ensure-up-to-date
IMPORTANT: this script should be run by the CI (e.g. Shippable) to ensure that the 'samples/' folder is up to date.
When running locally execute with argument --batch.
Please press CTRL+C to stop or the script will continue in 5 seconds.
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/ruby-client-petstore.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/ruby-client-petstore-faraday.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/openapi3/ruby-client-petstore.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/openapi3/ruby-client-faraday-petstore.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/java-petstore-all.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/java-jaxrs-petstore-server-all.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/java-msf4j-petstore-server.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/openapi3/jaxrs-jersey-petstore.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/spring-all-petstore.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/javascript-petstore-all.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/kotlin-client-all.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/kotlin-server-petstore.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/kotlin-springboot-petstore-server.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/kotlin-springboot-petstore-server-reactive.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/mysql-schema-petstore.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/nim-client-petstore.sh successfully!
Executed /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/python-petstore-all.sh successfully!
ERROR: Failed to run /Users/ravi/code/src/github.com/fullcircle23/openapi-generator/bin/python-server-all.sh

Hmm did you rebase on master and then rebuild with mvn clean install?
When did you run it?
I just ran ensure up to date on latest master and had no git diff differences

@spacether
Copy link
Contributor

spacether commented May 25, 2020

@fullcircle23 another solution here is to remove or revert your samples update commits and only run:

bin/python-petstore-all.sh
bin/openapi3/python-petstore.sh
bin/openapi3/python-experimental-petstore.sh

Usually we depend upon CI to run ensure-up-to-date and you don't need to run it locally because you are only changing one or two samples folders.

@fullcircle23
Copy link
Contributor Author

Hmm did you rebase on master and then rebuild with mvn clean install?

It was from a clone of a new fork so I didn't need to rebase it. So basically I did steps 1 to 6 exactly:

1. Deleted my fork fullcircle23/openapi-generator
2. Forked from OpenAPITools/openapi-generator
3. git clone https://github.com/fullcircle23/openapi-generator.git
4. cd openapi-generator
5. mvn clean install
6. ./bin/utils/ensure-up-to-date

When did you run it?

About 5 hours ago.

@wing328
Copy link
Member

wing328 commented May 25, 2020

@fullcircle23 if you need help on this, please PM me via Slack (https://join.slack.com/t/openapi-generator/shared_invite/enQtNzAyNDMyOTU0OTE1LTY5ZDBiNDI5NzI5ZjQ1Y2E5OWVjMjZkYzY1ZGM2MWQ4YWFjMzcyNDY5MGI4NjQxNDBiMTlmZTc5NjY2ZTQ5MGM)

@wing328
Copy link
Member

wing328 commented May 25, 2020

Please file a new PR instead as this PR shows "unknown repository"

@fullcircle23
Copy link
Contributor Author

Closing this PR, replaced by #6451

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG][Python] Single quotes in default/example string cause invalid syntax error in generated test code
3 participants