dancryer / phpci Goto Github PK
View Code? Open in Web Editor NEWPHPCI is a free and open source continuous integration tool specifically designed for PHP.
License: BSD 2-Clause "Simplified" License
PHPCI is a free and open source continuous integration tool specifically designed for PHP.
License: BSD 2-Clause "Simplified" License
In b8\Application::initController()
(line 84):
$this->config->get('b8.app.namespace')
This call is returning NULL, and therefore the IndexController file is being searched for at \\Controller\IndexController
instead of PHPCI\Controller\IndexController
therefore resulting in the exception:
Fatal error: Uncaught exception 'b8\Exception\HttpException\BadRequestException' with message 'Invalid controller: Index does not exist.'
We'd like to extend the interface where we add links which are populated after a build is done. So for example, if I wanted to generate apidocs, code coverage, etc. then I add those plugins to my build definition (yaml).
The question is how I get to these reports from the interface. I could have them "external" — I'd rather iframe them in, or something.
Anyone have any thoughts on this?
New plugin that, when executed, either zip or tar.gz the build (setting for that) and copies it to a specified directory (setting for that.)
Backstory: #49
Let's discuss implementation of a per-plugin custom tool directory. Here's my need that spawned this request:
The reason I implemented this in the first place was to allow me, on a per-project basis, to use a version of phpunit from within my project's build dir. The project that I am using this on needs a very specific version of the PHPUnit Selenium extension, so I use composer to install that extension, along with PHPUnit itself, then I use this feature to tell PHPCI that my build should use this specific version of PHPUnit. The whole point is that I don't want to install it globally, but rather, this project has unique requirements. With my implementation you cannot specify a path outside of your build path (unless you get all hacky with ../../../), so it is necessarily per project.
Suggestion from @MarkMaldaba:
- Does project define a local path for the tool (must be relative to the project root, and may not go above the project root, so can't use e.g. ../foo)? If so use that path.
- If not, has the user added a config setting to PHPCI, pointing to the location of the tool (absolute, or relative to PHPCI install directory)? If so, use that.
- Otherwise, use the built-in tool path.
I don't actually understand what the top panel(project overview) is showing me, no matter how many successful further builds it always sows me the first build?
Each of those builds ran 2 phpunits as well as php-cs-fixer, I would love quick display breakdown since there's plenty of space in those boxes. Possibly including a plugin customisable output?
Something like this: (sorry for the terrible editing)
with a +more if there are more than 3 results, which opens up the build page
What do people think?
If a build path contains a space, there are many failures because it breaks the path argument into two strings.
This can be fixed by ensuring that in all situations where a path is output to be executed, it is enclosed in quotes.
For example:
Before: sprintf("cp -Rf %s %s/", $reference, $this->buildPath)
After: sprintf('cp -Rf "%s" "%s/"', $reference, $this->buildPath)
Hello!
It's an interesting project, but using MySQL is not the favorite way for some of web developers as you probably know ;)
I guess it's just need a plugin and use a variable for the classname used. No ?
Thanks !
In newer versions of the b8framework, the Registry::getInstance()
function returns a null value unless the constructor has been called (this is some kind of static/non-static singleton/non-singleron monster I guess :P ). This causes the config.php
file to fail when it is processed, since it tries to set the install path like this:
$registry = b8\Registry::getInstance();
$registry->set('install_url', 'http://phpci.mydomain.local');
With the current b8framework, you need to hack around this problem. I've added the following to my config.php, right above the $registry call to work around it for now:
// Start Hack
$hack_request = new b8\Http\Request();
$hack_registry = new b8\Registry($config, $hack_request);
// End Hack
Due to those Base files being auto-generated and not using type checking you get PDOExceptions in certain cases.
Here for example
https://github.com/Block8/PHPCI/blob/master/PHPCI/Model/Base/BuildBase.php#L299
when in
https://github.com/Block8/PHPCI/blob/master/PHPCI/Controller/BuildController.php#L53
we set the status as 0 but becuase we don't check types and by default the status is null it doesn't update the status to 0 and instead tries to insert null, causing a
General error: 1364 Field 'status' doesn't have a default value' in /code/icheev-2/PHPCI/vendor/block8/b8framework/b8/Store.php
The same happens when trying to register a project but trying to input an empty string for the RSA key.
We either need to remove the check entirely and avoid the early return OR change it to ===
to check type OR add defaults on the tables.
Currently the regex for validating paths when entering a new project doesn't work for local paths (I'm not wholly convinced it's correct for remote repositories, either, but I haven't given that a proper look so I might be wrong).
Here is the path to my repository (Windows machine): D:\Git Repos\PHPCI
However, this is not allowed to be entered due to the validation pattern set for the input box.
To be honest, it might be best to just remove the validation on this field, but if not then it needs to be made a lot more forgiving, as I am currently unable to create a new project due to it incorrectly blocking valid local paths.
I nearly got it working eventually but this depends on the YAML extension which then depends on libyaml which both need installing. Would it not be easier just to use the Symfony Yaml component?
Then you can just add it to the composer.json and change parts of the code that reference the YAML extension.
I've just been using Ubuntu so it was just a case of:
sudo apt-get install libyaml-dev
sudo pecl install yaml
It'd be nicer if this wasn't needed.
I think we should start moving some of the code to use sprintf and possibly escapeshellcmd too.
http://php.net/manual/en/function.sprintf.php
http://www.php.net/manual/en/function.escapeshellcmd.php
When try to reload last five builds in the dashboard we've got:
Fatal error: Uncaught exception 'b8\Exception\HttpException\BadRequestException' with message 'Invalid controller [\PHPCI\Controller\LatestController]: Latest does not exist.' in /var/www/vendor/block8/b8framework/b8/Application.php:87 Stack trace: #0 /var/www/vendor/block8/b8framework/b8/Application.php(66): b8\Application->initController() #1 /var/www/PHPCI/Application.php(30): b8\Application->initRequest() #2 /var/www/index.php(18): PHPCI\Application->handleRequest() #3 {main} thrown in /var/www/vendor/block8/b8framework/b8/Application.php on line 87
This error is returned by: http://HOSTNAME/index/latest request.
I did not found the repository of http://www.phptesting.org/ so I post it here:
Backstory: #49
Let's discuss how the PHPCI BIN directory can be specified in a global config file.
Currently, all tools are executed from PHPCI_BIN_DIR
, which is defined in console
. It is defined before config.php
is loaded, so there will need to be some reworking. Personally, I'm not a fan of define()
, since there is no redefine()
:)
I suppose it makes more sense to store this in the Registry
like install_url
. Maybe tool_path
or bin_dir
? We should decide sooner than later whether we like the term dir
or path
and be consistent going forward.
diff --git a/PHPCI/View/Project/view.phtml b/PHPCI/View/Project/view.phtml
index 59d07ce..17b0a1a 100644
--- a/PHPCI/View/Project/view.phtml
+++ b/PHPCI/View/Project/view.phtml
@@ -61,14 +61,14 @@
$pages = ceil($total / 10);
$pages = $pages == 0 ? 1 : $pages;
- print '<li class="'.($page == 1 ? 'disabled' : '').'"><a href="<?= PHPCI_URL ?>project/view/'.$project->getId().'?p='.($page == 1 ? '1' : $page - 1).'">«</a></li>';
+ print '<li class="'.($page == 1 ? 'disabled' : '').'"><a href="' . PHPCI_URL . 'project/view/'.$project->getId().'?p='.($page == 1 ? '1' : $page - 1).'">«</a></li>';
for($i = 1; $i <= $pages; $i++)
{
- print '<li><a href="<?= PHPCI_URL ?>project/view/' . $project->getId() . '?p=' . $i . '">' . $i . '</a></li>';
+ print '<li><a href="' . PHPCI_URL . 'project/view/' . $project->getId() . '?p=' . $i . '">' . $i . '</a></li>';
}
- print '<li class="'.($page == $pages ? 'disabled' : '').'"><a href="<?= PHPCI_URL ?>project/view/'.$project->getId().'?p='.($page == $pages ? $pages : $page + 1).'">»</a></li>';
+ print '<li class="'.($page == $pages ? 'disabled' : '').'"><a href="' . PHPCI_URL . 'project/view/'.$project->getId().'?p='.($page == $pages ? $pages : $page + 1).'">»</a></li>';
print '</ul></div>';
At the moment there are a number of places where git is assumed, For example the PHPCI\Model\Project class has a method getGitUrl().
If we refactor this away then it should make it easier to implement svn, mecurial etc.
For example: Builder.php switches on project::getType() and runs some different code. If the project classes instead had a method like getSourceCodeFiles() then we could use polymorphism and have each type of class get it's own files in the appropriate way.
I created a project, and clicked the 'build' button.
This resulted in the following slew of code:
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() [datetime.--construct]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/London' for '1.0/DST' instead' in ~\PHPCI\Controller\ProjectController.php:40
Stack trace:
#0 ~\PHPCI\Controller\ProjectController.php(40): DateTime->__construct()
#1 [internal function]: PHPCI\Controller\ProjectController->build('2')
#2 ~\vendor\block8\b8framework\b8\Application.php(83): call_user_func_array(Array, Array)
#3 ~\PHPCI\Application.php(19): b8\Application->handleRequest()
#4 (truncated)
in ~\PHPCI\Controller\ProjectController.php on line 40
I'm using PHP 5.3.8. It is a common issue for the timezone to not be initialised properly, and it is easily fixed, but a colleague didn't have this problem when testing (he was probably on a different PHP version, but it was still 5.3) so I'm not sure why other people aren't experiencing this.
Low priority issue, but bothersome all the same - couldn't determine what the correct format was.
Trying to add a new project to PHPCI from bitbucket, kept getting error message to match the requested format when the format wasn't specified.
Was able to work around this by guessing that it wanted only part of the URL, yet bitbucket is different from github, most devs on bitbucket are used to capturing the path from the clone button which is different from the URL bar. This should be specified somewhere.
ex. path from clone bar
[email protected]:j88per/codereview.git
actual path that worked - this is unusual for me.
j88per/codereview
Can not delete builds:
When try to delete it we've got:
Fatal error: Call to a member function getIsAdmin() on a non-object in /var/www/PHPCI/Controller/BuildController.php on line 89
Installation is failing due to some b8 issues, I presume:
kamermans@steve-playground:/opt/PHPCI$ ./console phpci:install
PHP Notice: Undefined index: REQUEST_URI in /opt/PHPCI/vendor/block8/b8framework/b8/Http/Request.php on line 30
Notice: Undefined index: REQUEST_URI in /opt/PHPCI/vendor/block8/b8framework/b8/Http/Request.php on line 30
Enter your MySQL host: localhost
Enter the database name PHPCI should use: phpci
Enter your MySQL username: phpci
Enter your MySQL password: phpci
Your PHPCI URL (without trailing slash): http://phpci.mydomain.com
(Optional) Github Application ID:
(Optional) Github Application Secret:
PHP Notice: Undefined index: REQUEST_URI in /opt/PHPCI/vendor/block8/b8framework/b8/Http/Request.php on line 30
Notice: Undefined index: REQUEST_URI in /opt/PHPCI/vendor/block8/b8framework/b8/Http/Request.php on line 30
PHP Notice: Undefined index: servers in /opt/PHPCI/vendor/block8/b8framework/b8/Database.php on line 56
Notice: Undefined index: servers in /opt/PHPCI/vendor/block8/b8framework/b8/Database.php on line 56
PHP Notice: Undefined index: servers in /opt/PHPCI/vendor/block8/b8framework/b8/Database.php on line 57
Notice: Undefined index: servers in /opt/PHPCI/vendor/block8/b8framework/b8/Database.php on line 57
PHP Notice: Undefined index: name in /opt/PHPCI/vendor/block8/b8framework/b8/Database.php on line 58
Notice: Undefined index: name in /opt/PHPCI/vendor/block8/b8framework/b8/Database.php on line 58
PHP Notice: Undefined index: username in /opt/PHPCI/vendor/block8/b8framework/b8/Database.php on line 59
Notice: Undefined index: username in /opt/PHPCI/vendor/block8/b8framework/b8/Database.php on line 59
PHP Notice: Undefined index: password in /opt/PHPCI/vendor/block8/b8framework/b8/Database.php on line 60
Notice: Undefined index: password in /opt/PHPCI/vendor/block8/b8framework/b8/Database.php on line 60
PHP Warning: shuffle() expects parameter 1 to be array, null given in /opt/PHPCI/vendor/block8/b8framework/b8/Database.php on line 79
Warning: shuffle() expects parameter 1 to be array, null given in /opt/PHPCI/vendor/block8/b8framework/b8/Database.php on line 79
[Exception]
Could not connect to any read servers.
phpci:install
Build counter:
When build is failed and click rebuild: you should not create new build, just should recheck the existing build.
And if you have project one. delete it and create new project, it should start from build one, but now it continues the last project build counter.
Plugin that removes composer.lock and vendor/ directory from the working directory.
Rather than showing all the builds on the dashboard I think it would be more beneficial to show the last build per project.
Ideally, when looking at the dashboard I want a snapshot of the current state rather than historical information. I can then drill-down in to a project to get historical information on the project.
Hi guys,
do you plan to create plugins for codeception?
I think line 133 should be: call_user_func($cb, $message);
rather than: $cb($message)
When filling out the information for creating the admin user during the install, the console application exits with the following error.
PHP Fatal error: Class '\Store\UserStore' not found in /home/PHPCI/vendor/block8/b8framework/b8/Store/Factory.php on line 57
When I attempt to view the session/login page, I get the following error.
Warning: Creating default object from empty value in /home/PHPCI/PHPCI/Controller/SessionController.php on line 64 Fatal error: Call to undefined method stdClass::render() in /home/PHPCI/PHPCI/Controller/SessionController.php on line 66
It appears that the view.path configuration item is not being set correctly, and the view class does not create the view object when it can not find the file. Once a path is correctly defined, it appears that the view object is looking for View/Session.phtml and not View/Session/login.phtml
I ran build from local path.
Executing: cp -Rf "/data/lingualeo/infrastructure/deploy/data/base_repo" "/data/www/phpci/web/build/project2-build11/"
�Working copy created: /data/www/phpci/web/build/project2-build11/�
PHPCI said that working copy was successfully created, but really "Permission denied" occurred and no working dir was created. All plugins fails after this.
No chance to understand this from console output.
Is it possible to support phpspec as a plugin too? http://www.phpspec.net/
Fatal error: Uncaught exception
'b8\Exception\HttpException\BadRequestException' with message 'Invalid
controller: \PHPCI\Controller\PhpciController does not exist.' in
/public/phpci/vendor/block8/b8framework/b8/Application.php:58
Stack
trace:
#0 /public/phpci/index.php(10):
b8\Application->__construct()
#1 {main}
thrown in /public/phpci/vendor/block8/b8framework/b8/Application.php on line 58
Files starting with a .
in the root of the project are not copied (.htaccess
in my case, but also .git/
, etc..). If have 4 feature branches open already, so maybe someone else could fix this one :). Also, the code comments are copied from the Composer plugin in the plugins CopyBuild
, PackageBuild
and CleanBuild
.
Attempting to get things set up and I am getting this error
Fatal error: Uncaught exception 'b8\Exception\HttpException\BadRequestException' with >message 'Invalid controller: Index.php does not exist.' in >/home/PHPCI/vendor/block8/b8framework/b8/Application.php:87 Stack trace: #0 >/home/PHPCI/vendor/block8/b8framework/b8/Application.php(66): b8\Application->>initController() #1 /home/PHPCI/PHPCI/Application.php(30): b8\Application->initRequest() >#2 /home/PHPCI/index.php(18): PHPCI\Application->handleRequest() #3 {main} thrown in >/home/PHPCI/vendor/block8/b8framework/b8/Application.php on line 87
My .htaccess is
RewriteEngine On
RewriteBase /home/PHPCI
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*)? index.php [L,E=PATH_INFO:/$1]
and my httpd conf is
Listen 8180
<VirtualHost *>
ServerName ci.mydomain.com
DocumentRoot /home/PHPCI
ErrorLog "/etc/httpd/logs/phpci-error_log"
CustomLog "/etc/httpd/logs/phpci-access_log" combined
DirectoryIndex index.php
<Directory /home/PHPCI/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Any Ideas?
I set it up and ran the console installer, and visited the page in the browser, and got a 500 error, and this in the error log file:
[Thu May 16 17:27:00 2013] [error] [client 88.211.49.134] PHP Fatal error: Uncaught exception 'b8\\Exception\\HttpException\\BadRequestException' with message 'Invalid controller: \\PHPCI\\Controller\\PHPCIController does not exist.' in /var/www/PHPCI/vendor/block8/b8framework/b8/Application.php:58\nStack trace:\n#0 /var/www/PHPCI/index.php(14): b8\\Application->__construct()\n#1 {main}\n thrown in /var/www/PHPCI/vendor/block8/b8framework/b8/Application.php on line 58
[Thu May 16 17:27:57 2013] [error] [client 88.211.49.134] PHP Fatal error: Uncaught exception 'b8\\Exception\\HttpException\\BadRequestException' with message 'Invalid controller: \\PHPCI\\Controller\\PHPCIController does not exist.' in /var/www/PHPCI/vendor/block8/b8framework/b8/Application.php:58\nStack trace:\n#0 /var/www/PHPCI/index.php(14): b8\\Application->__construct()\n#1 {main}\n thrown in /var/www/PHPCI/vendor/block8/b8framework/b8/Application.php on line 58
[Thu May 16 17:27:59 2013] [error] [client 88.211.49.134] PHP Fatal error: Uncaught exception 'b8\\Exception\\HttpException\\BadRequestException' with message 'Invalid controller: \\PHPCI\\Controller\\PHPCIController does not exist.' in /var/www/PHPCI/vendor/block8/b8framework/b8/Application.php:58\nStack trace:\n#0 /var/www/PHPCI/index.php(14): b8\\Application->__construct()\n#1 {main}\n thrown in /var/www/PHPCI/vendor/block8/b8framework/b8/Application.php on line 58
It seems some builds are running in parallel which is causing problems for me, particularly in that the mysql database name is the same for both builds, and the running tests are tainting each other:
Is this intended, and if so, how should I handle this database problem? If variable interpolation was supported, I guess I could dynamically generate the database name like this:
mysql:
- "CREATE DATABASE phpci_project%PHPCI_PROJECT%-build%PHPCI_BUILD%"
Thoughts?
Add a new plugin that, when executed, copies the entire working directory to a specified directory.
PHPCI indicates a minimum requirement of PHP 5.3, and on PHP < 5.4 short tags of the form used in the .phtml files (i.e. ) are only available if short_open_tag is enabled in php.ini.
Whilst it is probably more often enabled than not, it is also frequently disabled for various reasons, primarily (but not necessarily exclusively) regarding XML compatibility.
In order to support PHP 5.3 properly, the code should not require this setting to be enabled. For example, I have just spent 30 minutes trying to figure out why I was getting a blank login screen, only to eventually trace it to this issue.
I attempted to resolve this issue in PHPCI, and committed an initial pull request that did the necessary replacement of "<?=" with "<?php echo" across the code-base (see #10). However, I realised that this would also need fixing for the .phtml files in the b8framework's Form module in order to remove the dependency completely.
I agree that it makes the code less neat, but I think that is the lesser of two evils if this is going to be a serious contender in the CI arena.
Is there a reason why the .htaccess file is not part of the repository, and needs to be created by hand?
If not then it should be added to the repo, to remove an installation step.
When running PHP with all errors on, the lack of a favicon keeps causing error messages, it also seems to stop the redirect when doing a build, I have to manually go to the build rather than being redirected.
When a session times out / expires, the ajax call that automatically refreshes the page shows the login screen, but it's awkwardly placed inside the main panel of whatever page you are on. We should probably redirect the user to the login page. Here's a screenshot:
Note that the purple line is there to cover up some secret stuff :P
As with committer notifications in issue #34, add global notification email address option to phpci.yml.
The installer on windows fails with the following error:
'.' is not recognized as an internal or external command, operable program or batch file.
This is linked to the composer installation and causes the rest of the installation to fail.
When running a command it would be ideal if it redirected output to another file, then ajax requests could pick up the output from the file.
Such a case where this would be useful would be when the unit tests take a reasonable amount of time (big apps, db tests etc), currently you'd see no output till the tests have finished.
Or instead of an xhr fetching them you could use something like socket.io to stream from the server to the client.
This would be an enhancement for the future (just wanted to get it noted down)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.