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

[PHP] Add gitignore to AbstractPhpCodegen #765

Merged
merged 11 commits into from
Aug 20, 2018

Conversation

ybelenko
Copy link
Contributor

@ybelenko ybelenko commented Aug 7, 2018

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 and ./bin/security/{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\.
  • Filed the PR against the correct branch: master, 4.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

After conversation with @ackintosh we've agreed that we need to remove PHP related rules from root .gitignore. All PHP codegens should produce own .gitignore by default.

What I did:

  1. Added .gitignore to supportingFiles in AbstractPhpCodegen
  2. Grabbed minimal .gitignore for each PHP codegen from this repo
  3. Noticed broken path in Silex security script. Check 27fb8ba
  4. Added few rules from root .gitignore to local Symfony .gitignore. Check a20e201

About composer.lock. I think, it does make sense to commit composer.lock in server implementations and do opposite in client SDK.

This PR is big and serious, so I can wait while all PHP codegens will be properly checked.

cc @jebentier @dkarlovi @mandrean @jfastnacht @ackintosh

After conversation with @ackintosh we've agreed that every PHP codegen
should create it's own `.gitignore`. Client libraries(SDKs) should ignore
`composer.lock` file while server stubs better do opposite.
Seems like issue OpenAPITools#663 and pull request OpenAPITools#681 missed this security script,
I've changed output path in bin/security/silex-petstore-server.sh.
I've copied few old rules from root gitignore to local one. These rules
should be reviewed by original SymfonyCodegen authors.
@wing328
Copy link
Member

wing328 commented Aug 9, 2018

Shippable CI reports the following issue:

 ./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.
Please press CTRL+C to stop or the script will continue in 5 seconds.
UNCOMMITTED CHANGES ERROR
There are uncommitted changes in working tree after execution of 'bin/ensure-up-to-date'
Perform git diff
Perform git status
HEAD detached from FETCH_HEAD
Untracked files:
  (use "git add <file>..." to include in what will be committed)

	samples/openapi3/client/petstore/php/OpenAPIClient-php/.gitignore

nothing added to commit but untracked files present (use "git add" to track)
Please run 'bin/utils/ensure-up-to-date' locally and commit changes (UNCOMMITTED CHANGES ERROR)

Please run ./bin/utils/ensure-up-to-date and use git add samples/openapi3/client/petstore/php/OpenAPIClient-php/.gitignore to add the new files.

@ybelenko
Copy link
Contributor Author

ybelenko commented Aug 9, 2018

@wing328 Done. But I think we need to wait response from another PHP collaborators.

@wing328
Copy link
Member

wing328 commented Aug 15, 2018

As discussed, I suggested adding a "Ref" to give credit the "source", e.g. https://github.com/OpenAPITools/openapi-generator/blob/master/samples/client/petstore/R/.gitignore#L1

@ybelenko ybelenko removed their assignment Aug 16, 2018
@wing328
Copy link
Member

wing328 commented Aug 16, 2018

If no one has further feedback, I'll merge this PR into master tomorrow (Friday)

@wing328 wing328 modified the milestones: 3.3.0, 3.2.2 Aug 16, 2018
@wing328 wing328 merged commit e605882 into OpenAPITools:master Aug 20, 2018
@ybelenko ybelenko deleted the php_gitignore branch August 20, 2018 04:30
jimschubert added a commit that referenced this pull request Aug 21, 2018
* master:
  Fix problems in typescript jquery generator (#801)
  [PHP] Add gitignore to AbstractPhpCodegen (#765)
  Improve documentation for usage of a generator in an other jar (#817)
  Improve Symfony 4.1 compatibility (#830)
  📝 Updating 'help generate' switches in README
  [cli] Don't log to STDOUT if debug flags are set (#474)
  [gradle-plugin] README notes on multiple specs (#847)
  Added server variable support (#816)
  fix erlang optiona/required parameters (#829)
  [Java][Rest-assured] Fix generated javadoc and "swagger-annotations" improvement (#831)
A-Joshi pushed a commit to ihsmarkitoss/openapi-generator that referenced this pull request Feb 27, 2019
* [PHP] Remove PHP related rules from root gitignore

After conversation with @ackintosh we've agreed that every PHP codegen
should create it's own `.gitignore`. Client libraries(SDKs) should ignore
`composer.lock` file while server stubs better do opposite.

* [PHP] Set .gitignore as default supporting file

* [PHP] Add default gitignore to Client SDK

* [PHP] Add default gitignore to Laravel

* [PHP] Add default gitignore to Lumen

* [PHP] Add default gitignore to Silex

Seems like issue OpenAPITools#663 and pull request OpenAPITools#681 missed this security script,
I've changed output path in bin/security/silex-petstore-server.sh.

* [PHP] Update Slim

* [PHP] Add default gitignore to Symfony

I've copied few old rules from root gitignore to local one. These rules
should be reviewed by original SymfonyCodegen authors.

* [PHP] Add default gitignore to Zend

* [PHP] Refresh Openapi3 client samples

* [PHP] Add refs to .gitignore templates collection
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.

None yet

2 participants