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

Update build to use stages (adding PHPCS to check for CS violations) #2849

Merged
merged 5 commits into from
Sep 10, 2017

Conversation

lcobucci
Copy link
Member

@lcobucci lcobucci commented Sep 9, 2017

Since travis is now using Ubuntu Trusty as default (as explained in #2837) we need to create the schema manually in order to execute the tests. I've fixed it (applying basically the same solution that was done on #2835, #2838 and #2825), however I've also changed things to use the build stages (and added PHPCS to ensure that we follow our standards).

It's important to say that I've simplified the build jobs since MySQL 5.6 is the default version on Trusty.

.travis.yml Outdated
- if [[ "$MYSQL_VERSION" == "5.6" || "$MYSQL_VERSION" == "5.7" ]]; then mysql -e "CREATE SCHEMA doctrine_tests; GRANT ALL PRIVILEGES ON doctrine_tests.* to travis@'%'"; fi;
- if [[ "$MYSQL_VERSION" == "5.6" || "$MYSQL_VERSION" == "5.7" ]]; then mysql -e "CREATE SCHEMA test_create_database; GRANT ALL PRIVILEGES ON test_create_database.* to travis@'%'"; fi;
- if [[ "$MYSQL_VERSION" == "5.6" || "$MYSQL_VERSION" == "5.7" ]]; then mysql -e "CREATE SCHEMA test_drop_database; GRANT ALL PRIVILEGES ON test_drop_database.* to travis@'%'"; fi;
- if [[ "$MYSQL_VERSION" == "5.6" || "$MYSQL_VERSION" == "5.7" || "$MARIADB_VERSION" == "10.2" || "$MARIADB_VERSION" == "10.1" || "$MARIADB_VERSION" == "10.0" || "$DB" == "mysql" || "$DB" == "mysqli" ]]; then bash ./tests/travis/create-mysql-schema.sh; fi;
Copy link
Member

Choose a reason for hiding this comment

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

Consider using a multiline syntax here


mysql -e "CREATE SCHEMA doctrine_tests; GRANT ALL PRIVILEGES ON doctrine_tests.* to travis@'%'"
mysql -e "CREATE SCHEMA test_create_database; GRANT ALL PRIVILEGES ON test_create_database.* to travis@'%'";
mysql -e "CREATE SCHEMA test_drop_database; GRANT ALL PRIVILEGES ON test_drop_database.* to travis@'%'";
Copy link
Member

Choose a reason for hiding this comment

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

This is mostly sql. How about creating an sql file containing these 3 queries and executing in just one mysql call?

"symfony/console": "2.*||^3.0"
"symfony/console": "2.*||^3.0",
"doctrine/coding-standard": "^1.0",
"squizlabs/php_codesniffer": "^3.0"
Copy link
Member

@greg0ire greg0ire Sep 9, 2017

Choose a reason for hiding this comment

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

consider adding sort-packages: true to the config section, it would make diffs like this one less confusing.

@Ocramius
Copy link
Member

Ocramius commented Sep 9, 2017

Sorry, this is a no-go. We have 109 open PRs that would require rework if this goes through, therefore a CS change PR cannot happen.

@Ocramius Ocramius closed this Sep 9, 2017
@Ocramius Ocramius self-assigned this Sep 9, 2017
@Ocramius Ocramius removed this from the 2.7 milestone Sep 9, 2017
@Majkl578
Copy link
Contributor

Majkl578 commented Sep 9, 2017

I don't really understand why this PR was closed. Build stages still should happen and migration to Trusty is a must. While argument with open PRs is relevant, CS changes are only part of this PR and imho could be split to separate PR targetting develop. Also CS could go to allowed failures.

@greg0ire
Copy link
Member

greg0ire commented Sep 9, 2017

Also, there are tools can could help the 109 PRs rework, like StyleCI. But this PR should probably be split into several easier-to-review, easier-to-merge PRs

@Ocramius
Copy link
Member

Ocramius commented Sep 9, 2017

The issue is with rebasing existing PRs: don't drop this burden on contributors

@Majkl578
Copy link
Contributor

Majkl578 commented Sep 9, 2017

They still have to rebase to make their builds pass on Travis. And with CS changes targeting develop, it should be fine, there are only few PRs (if any) targeting develop.

@Ocramius
Copy link
Member

Ocramius commented Sep 9, 2017

@Majkl578 this patch was about master

@greg0ire
Copy link
Member

greg0ire commented Sep 9, 2017

@Majkl578 no we don't closing and reopening is enough in this case. I think travis tests a merge, not the last commit itself

@Majkl578
Copy link
Contributor

Majkl578 commented Sep 9, 2017

@Ocramius I know, that's why I proposed to move CS changes to separate PR targeting develop and keep just Travis changes, with PHPCS in allowed_failures.

@greg0ire It's not enough unfortunately. Each build is based on .travis.yml in current revision, not in master.

@lcobucci
Copy link
Member Author

lcobucci commented Sep 9, 2017

@Ocramius I'll remove the commits regarding the fixes, allow PHPCS to fail, and reopen this PR.

@lcobucci lcobucci reopened this Sep 9, 2017
@lcobucci lcobucci force-pushed the update-build branch 4 times, most recently from d9301ca to 21831c9 Compare September 9, 2017 17:51
@lcobucci lcobucci removed the Won't Fix label Sep 9, 2017
@lcobucci lcobucci added this to the 2.7 milestone Sep 9, 2017
This is now mandatory on the new Travis-CI containers.
Modifying Travis-CI configuration to use  build stages and removing
explicit MySQL 5.6 execution (it's default now).

PHPCS is running with PHP nightly version so we can have it failing
for now.
@lcobucci
Copy link
Member Author

lcobucci commented Sep 9, 2017

@Ocramius you can review this again now 😉

Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

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

LGTM 🚢

@Ocramius Ocramius merged commit 24b4ebf into doctrine:master Sep 10, 2017
@lcobucci lcobucci deleted the update-build branch September 11, 2017 08:58
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants