dancryer / PHPCI

PHPCI is a free and open source continuous integration tool specifically designed for PHP.
BSD 2-Clause "Simplified" License
2.42k stars 441 forks source link

Setting changes after project creation not applying #902

Open iaguiar opened 9 years ago

iaguiar commented 9 years ago

Hi,

I'm not sure if I am doing something wrong: When I change the PHPCI build config input, the field appears to update correctly and will have the new configuration. This persists when I later re-load the 'Edit Project' page. However, when I go to run the build, the settings are ignored. It seems to happen whatever I change, the most recent instance being the "--prefer-dist" flag in composer. Strangely, when I make a duplicate project, but starting with the new settings it works fine. There is no phpci.yml file in the source. Is configuration cached somewhere? Is this intended behavior?

Thanks, Ian

mikebronner commented 9 years ago

Hi Ian,

Could you check the PHPCI database projects table and see if the record for your project has updated the build_config field correctly?

iaguiar commented 9 years ago

phpci.project has the projects, and testing just now it updates correctly, but still behaves in its 'original' way when I build. Come to think of it, this is the same as an issue I had the other day where changing to 'Remote URL' was updating in the database, but seemed to still pull the old setting.

mavimo commented 9 years ago

@iaguiar maybe is a stupid question.. the build are created after the project update or are in the build queue before you create changed project infos?

EDIT: the phpci.yml is not committed but stored on the DB, right?

iaguiar commented 9 years ago

@mavimo The phpci.yml is not on the repository, correct. Also, this occurs with all builds that are initiated/queued after changing the settings. I'm noticing that this seems to affect all settings, and not just the config.

Adirelle commented 9 years ago

Do you run the builds using the daemon or the cron job ?

iaguiar commented 9 years ago

They use the daemon, started with sudo, on Ubuntu. I believe the exact command is sudo ./console phpci:daemon start

Adirelle commented 9 years ago

My bet is that the Project object is cached and never gets refreshed from the database.

iaguiar commented 9 years ago

@Adirelle That would make sense. Do you know the relative path of where it might be cached? I can set up a script Monday to clear it when needed. This is a MySQL database hosted on the same machine.

mikebronner commented 9 years ago

Have you tried running manually using: sudo php ./console phpci:build Right after queuing up a build through the UI? If that works then it looks like the daemon only loads the project info when initiated, and probably not before each build.

Adirelle commented 9 years ago

It is cached in PHP memory. You'd have to restart the daemon as I don't think there is a way to clear the ORM cache now.

iaguiar commented 9 years ago

@mikebronner @Adirelle That was it. The daemon only loads settings on its start, and not before building each project. Thanks for assisting with this problem, all.

Adirelle commented 9 years ago

Even if you have a workaround, I don't think this issue should be closed.

mikebronner commented 9 years ago

Agreed, marking as bug.

felipefrancisco commented 9 years ago

Hi!

Was this issue fixed? I'm still experiencing the same problem.