Found a problem after release version 1.11.0 of propel-orm
Hi Guys
I found today a problem after release version 1.11.0 of propel-orm https://github.com/spryker/propel-orm/releases
The version tag 1.11.0 required the propel version alpha10. This version has a bug in propel migrate console command https://github.com/propelorm/Propel2/compare/2.0.0-alpha8...2.0.0-alpha10#diff-1ccdce29404b8984d1b2101f0069a564
In MigrationMigrateCommand they return now CODE_ERROR
instead false
at line 84 but for symfony command vendor/symfony/console/Command/Command.php:262
false was a success and now the command is aborted.
@valerii.trots can u please check internal how we can fix this? Normally propel have to be fixed. But Spryker has offical release propel-orm version 1.11 that required propel alpha 10 version
The problem now is that our install and deployment scripts just fail due the exit code of migration command console even if no migrations were executed.
Has anyone from today the same problem? One possible solution is of course to constraint the spryker/propel-orm
version to 1.10 in composer.json.
Comments
-
According to our development, you need to adjust the code on your side:
The proper error code here is returned (as per Symfony specs), as such their code should be adjusted rather. Symfony public function run(InputInterface $input, OutputInterface $output) @return int The command exit code is the contract. And will in the future be enforced, as such the change is needed. <https://github.com/spryker/propel-orm/releases/tag/1.11.0> will clarify this?
0 -
Yes of course.. but the return code is wrong...
In the case there were not migration to be executed then propel alpha8 just return
false
Now alpha10 has to be compatible with symfony 5 that enforce to return int. OK. Clear..
But the return of symfony command is the follwowing:
return is_numeric($statusCode) ? (int) $statusCode : 0;
and as u see
false
means (for backward compatibility)SUCCESS
Now Migration Command Console in case no migration needed return
1
insteadfalse
and this for symfony command isERROR
and not moreSUCCESS
Propel alpha10 has a bug. They just replace the
return false
withreturn CODE_ERROR
but this is not correct in every case, aboveall in the migraiton command console in the case no migration needed.. Especially here:if (!$manager->getFirstUpMigrationTimestamp()) { $output->writeln('All migrations were already executed - nothing to migrate.'); return static::CODE_ERROR; }
before here was return false!
@valerii.trots if u want i can discuss about it with the developer that said that i need to adjust the code on my side
0 -
No worries, let's play ping pong with them. 🙂
0 -
🙂 ok.. just investigate in details the changes
alpha8...alpha10 and together with \Symfony\Component\Console\Command\Command::run return statement0 -
some news?
0 -
<https://github.com/propelorm/Propel2/pull/1595/files#diff-1ccdce29404b8984d1b2101f0069a564R84> is the change, and return false was supposed to make a 1 exit code, so changing to 1 directly is actually the correct change. The fact that this actually should have returned true (and thus now 0) is a different topic. He might be right, and this should be fixed. But how than this be a regression if it was always wrong so far? I opened a PR for our AA to discuss: <https://github.com/propelorm/Propel2/pull/1617>
0 -
You can forward this to the project, they can +1 it if thats correct and hopefully we can include this in the next alpha release.
0 -
ok, danke!
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 69 Spryker News
- 894 Developer Corner
- 757 Spryker Development
- 83 Spryker Dev Environment
- 361 Spryker Releases
- 3 Oryx frontend framework
- 34 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 22 Job Opportunities
- 3.2K 📜 Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 68 Spryker Safari Questions
- 50 Random