User tests: Successful: Unsuccessful:
Pull Request for Issue #705 .
This PR based on the code here: #705 and adds some checks to the Receive Hooks that the hookData is valid.
3
administrator/components/com_admin/sql/updates/sqlazure/test.sql
The Tracker should add the category with ID 3 to your item without you doing something
@bz2 I have add some extra checks to the ReceiveIssuesHook.php
file that should avoid the errors you got at #705 (comment) I hope it helps ;)
@mbabker can you have a look here too? i hope i have not break you extra Exception
handling.
Thanks! I have send a pull request. But i cant see the pull in the tracker? But i'm on mobile now i will try it this evening or tomorrow from my PC.
I have send a pull request. But i cant see the pull in the tracker?
Because there is an error - response has 500 code. See my comments in code.
Testing server is updated.
It works
http://jtracker.j4devs.ru/tracker/jissues-test/27
@b2z please confirm that your category with ID 3 is ACL
@b2z I'm confused. ID 4 would mean we have changes to the external libraries
https://github.com/joomla/jissues/pull/770/files#diff-e6200f2e3305ca89413408a6216286efR824
Can you please double check the id of ACL
?
Here is the dump of my categories table at the moment (I made them the same as in CMS project):
INSERT INTO `jos_issues_categories` (`id`, `project_id`, `title`, `alias`, `color`) VALUES
(1, 4, 'JavaScript', 'javascript', 'e11d21'),
(2, 4, 'Postgresql', 'postgresql', 'eb6420'),
(3, 4, 'MS SQL', 'ms-sql', 'fbca04'),
(4, 4, 'External Library', 'external-library', '009800'),
(5, 4, 'RTL', 'rtl', 'e11d21'),
(6, 4, 'IIS', 'iis', 'eb6420'),
(7, 4, 'ACL', 'acl', 'fbca04'),
(8, 4, 'Multilanguage', 'multilanguage', '009800');
Your PR created category with ID 4, not 3. I see it in issue_category_map
table.
hmm but that makes no sense. :(
Can you tell me what is returning here:
// $files = $github->pulls->getFiles($project->gh_user, $project->gh_project, $hookData->pull_request->number);
$files = $github->pulls->getFiles('b2z', 'jissues-test', '27');
print_r($files);
I would expect that there is one file change for that file administrator/components/com_admin/sql/updates/sqlazure/test.sql
hmm the funny is also Posgressql changes result into ID 4 / External Library
:(
Yes again it was created with ID = 4. Somewhere is a bug :( I am going to sleep now, tomorrow will continue :)
Server updated ;)
Thank you Brian,
While the first thing is good the seccond one is not. I'm going to think about of a way to handle that. Maybe we mark the categories that are handeled by the Tracker and apply keep the others if there are set.
Thanks for checking here
I had a feeling that might be the case :(
On 7 April 2016 at 22:37, zero-24 notifications@github.com wrote:
Thank you Brian,
- The language change category gets removed
- This category gets removed too.
While the first thing is good the seccond one is not. I'm going to think
about of a way to handle that. Maybe we mark the categories that are
handeled by the Tracker and apply keep the others if there are set.Thanks for checking here [image:
]
—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#770 (comment)
Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/
I'm going to fix that if i get a bit time to think about an implementation. Thats the reason i ask for feeback. I have just forgotten that on coding :) Thanks
Testing Sserver is updated ;)
Thanks. Good thing is we don't get the worng category anymore Bad thing is we don't get the correct category :(
@mbabker can you post a dump of the categories table here for the CMS? #__issues_categories
I have finally implemented the issues discoverd by @brianteeman Now every category that is not managed by the Tracker gets ignored.
@b2z do you have any kind of logging information that can explain what the problem could be?
Can you please check wich category you have for this pull request: http://jtracker.j4devs.ru/tracker/jissues-test/32 and http://jtracker.j4devs.ru/tracker/jissues-test/33 in your database?
I have no errors :( And strange in issue_category_map I do not have categories assigned for 32 & 33.
Well making changes without prior immediate testing on local on some dev environment is not an efficient way to develop Now you are making changes in "blind" mode
I will try to help you on this week with debugging.
Ok, I found where the problem is - foreign key constraint fails because I do not have all categories in my test project.
[2016-04-17 19:27:01] JTracker.CRITICAL: Exception of type RuntimeException thrown {"exception":"[object] (RuntimeException(code: 1452): Cannot add or update a child row: a foreign key constraint fails (
j4devs_jtracker.
jos_issue_category_map, CONSTRAINT
jos_issue_category_map_ibfk_2FOREIGN KEY (
category_id) REFERENCES
jos_issues_categories(
id))\n-- SQL --\nINSERT INTO
jos_issue_category_map\n(
issue_id,
category_id) VALUES \n('384','10') at /home/j4devs/domains/jtracker.j4devs.ru/jissues/vendor/joomla/database/src/Mysqli/MysqliDriver.php:594)"}
So it tries to assign category with ID=10 because of administrator/components/com_admin/sql/updates
.
@mbabker can you plz post a dump of the categories table #__issues_categories
here for the CMS. I will import them and this should solve the issue.
INSERT INTO `#__issues_categories` (`id`, `project_id`, `title`, `alias`, `color`)
VALUES
(1, 1, 'JavaScript', 'javascript', 'ea3c0b'),
(21, 1, 'Authentication', 'authentication', '5319e7'),
(22, 1, 'Code style', 'code-style', '0052cc'),
(23, 1, 'Administration', 'administration', 'fbca04'),
(24, 1, 'Front End', 'front-end', 'eb6420'),
(25, 1, 'Installation', 'installation', '009800'),
(26, 1, 'Updating', 'updating', 'bfe5bf'),
(27, 1, 'Language & Strings', 'language-strings', '006b75'),
(28, 1, 'Plugins', 'plugins', '207de5'),
(29, 1, 'Components', 'components', 'fbca04'),
(30, 1, 'Templates (site)', 'templates-site', '5319e7'),
(31, 1, 'Templates (admin)', 'templates-admin', 'd4c5f9'),
(35, 1, 'Media Manager', 'media-manager', '006b75'),
(36, 1, 'Repository', 'repository', 'bfd4f2'),
(37, 1, 'Documentation', 'documentation', 'fbca04'),
(38, 1, 'Accessibility', 'Accessibility', '207de5'),
(39, 1, 'Feature Request', 'featurerequest', 'fef2c0'),
(20, 1, 'Search', 'search', '009800'),
(19, 1, 'Router / SEF', 'router-sef', '10b60b'),
(2, 1, 'Postgresql', 'postgresql', '0093c3'),
(3, 1, 'MS SQL', 'ms-sql', '7cbb00'),
(4, 1, 'External Library', 'external-library', '986601'),
(5, 1, 'RTL', 'rtl', 'eca5ae'),
(6, 1, 'IIS', 'iis', 'e4ec6b'),
(7, 1, 'ACL', 'acl', '870909'),
(8, 1, 'Multilanguage', 'multilanguage', '1ae132'),
(9, 1, 'UI/UX', 'ui-ux', 'e38545'),
(10, 1, 'SQL', 'sql', '2443d8'),
(18, 1, 'CLI', 'cli', '6d0e5b'),
(17, 1, 'Cache', 'cache', 'b8f067'),
(16, 1, 'Tags', 'tags', '960e67'),
(15, 1, 'Layout', 'layout', '67f0e6'),
(14, 1, 'Unit Tests', 'unit-tests', 'c7def8'),
(13, 1, 'Modules', 'modules', '5319e7'),
(12, 1, 'Libraries', 'libraries', 'fbca04'),
(40, 1, 'Fields', 'fields', '5319e7');
Thanks! Now it is working fine ;) You can test by yourself :)
Thanks @b2z can you confirm that you have the last changes in this PR applayed too?
Currently the Tracker also remove all other categories that are not handeld by the tracker. see: http://jtracker.j4devs.ru/tracker/jissues-test/32
How do I confirm? I see that yes it is removing. Well some more code should be added - possibly read the current categories then add auto-categories and filter the array with array_unique
Sorry, my fault. I did not pull the latest changes. Now it is updated.
Sorry i have broken your server with my code again :(
Please apply the last commit. That also add the array_unique
check.
:) updated
Updated
I suppose we are fine here? :)
Testing server is updated :)
Nope.
Sorry for the late reply. Maybe we have no remarks on code but sadly on functionality
see: http://jtracker.j4devs.ru/tracker/jissues-test/40 and http://jtracker.j4devs.ru/tracker/jissues-test/41 No category gets added but at least we should have the mssql category.
I am confused. I was testing it before and it was working. Can you please update it to the latest master and I will look on in it one more time. May be something we missed here ;)
Ok found the issue on line 770: $this->$trackerhandledCategories
should be $this->trackerhandledCategories
:)
Fixed it on my server and everything is working again
Can you please also update trackerhandledCategories
to trackerHandledCategories
to follow proper CameCase ;)
Thanks! I have just fixed it.
So the last issue to fix is this here: http://jtracker.j4devs.ru/tracker/jissues-test/40#event-4739
As Codestyle
is not in the trackerHandledCategories
array it should stay but it does not.
Yes the code is the same. So now the problem now in $categoriesThatShouldStay
- manually set categories are being deleted on PR update?
The idea was that $categoriesThatShouldStay
contains the IDs that got added to the item but are not handeld by the tracker. Than we get the list of categories based on the code and readd the categories from $categoriesThatShouldStay
.
Hmm, I did not have such issue here http://jtracker.j4devs.ru/tracker/jissues-test/46
Nevermind... I fails for another reason.
[2016-06-27 17:18:56] JTracker.ERROR: Error removing the Language Change label from GitHub pull request b2z/jissues-test #46 {"exception":"object"} {"url":"/hooks/pulls","ip":"192.30.252.41","http_method":"POST","server":"jtracker.j4devs.ru","referrer":null}
[2016-06-27 17:18:56] JTracker.CRITICAL: Exception of type RuntimeException thrown {"exception":"object"} {"url":"/hooks/pulls","ip":"192.30.252.41","http_method":"POST","server":"jtracker.j4devs.ru","referrer":null}
Something wrong with label remove... I will try another issue to test.
Well, something odd here :) See http://jtracker.j4devs.ru/tracker/jissues-test/44#event-4757
I've changed postgresql file. So Postgresql
was added. But, MS SQL
was not deleted and Code style
was deleted. Magic
hmm MSSQL
is correct here: https://github.com/b2z/jissues-test/pull/44/files as we change also a mssql file. But Code style
and the others should not be removed.
I'm not sure where / that you can see that messages anywhere but maybe something like this:
$message = sprintf('Error on %s/%s', $project->gh_user, $project->gh_project);
$logger->error($message);
how to debug Listeners
You can go to GitHub, the part where you set up the hooks for your project, copy the payload you are interested in, paste this to one of those programs used to craft POST request, send the stuff to your local instance (you have to whitelist the IP) and - set a breakpoint in the listener
I realized that my previous comment maybe wasn't all that clear.. here are some screens:
Scroll down to the "recent deliveries" part, look for the request you're interested in, copy the "payload" (don't forget the curlies :P), and paste it to something that can craft POST request e.g. postman:
Push that tiny "start listening for debug connections" button in your IDE (If you're using PHPStorm, try the IntelliyJ Ultimate with your J! license - it's pretty awesome...), and set a breakpoint.
Then push the "Send" button in postman...
Happy debugging
Oh, and you don't have to whitelist your local IP unless it's different from 127.0.0.1
. In this case you have to hack around those lines
Not working for me... I am using phpStorm and I am sending request in Postman, but debug opens me phpcs file, instead of file where break point was set.
debug opens me phpcs file
I'm confused... What's a phpcs file??
It's PHP_CodeSniffer entry point.
Here is what I have in phpStorm event log:
16:06:14 PHP Code Sniffer
phpcs: Can not correctly run the tool with parameters:
C:/Users/Dimus/AppData/Local/Temp/___.tmp/src/App/Tracker/Controller/AbstractHookController.php
--standard=Joomla
--encoding=utf-8
--report=xml
Possible tool process hangup after 10 sec.
Exclude AbstractHookController.php from PHP Code Sniffer analysis.16:06:24 PHP Code Sniffer
phpcs: Can not correctly run the tool with parameters:
C:/Users/Dimus/AppData/Local/Temp/___.tmp/phpcs
--standard=Joomla
--encoding=utf-8
--report=xml
Possible tool process hangup after 10 sec.
Exclude phpcs from PHP Code Sniffer analysis.
Seems that something is wrong with PHPCS. BTW in Postman I have 200 OK
response.
I'm not sure why the C:/Users/Dimus/AppData/Local/Temp/___.tmp/phpcs
receives the debug thing. It should be index.php
...
Have you tried to debug the sniffs?
Can you debug "nomal" web pages?
Debug was working when it was PHP 5.4, but yesterday I have updated local Vagrant env to 5.6.23 and now debug is not working at all. Hate it, I did not change any configuration for debug and it is displayed in phpinfo
. I do not know why it is not working :(
BTW we need to update our Vagrant box, because currently it has 5.4.4 on board. I suggest something like https://vagrantcloud.com/debian/boxes/jessie64/
Try upgrading to 7 :)
Am 29.06.2016 01:22 schrieb "Dmitry Rekun" notifications@github.com:
Debug was working when it was PHP 5.4, but yesterday I have updated local
env to 5.6.23 and now debug is not working at all. Hate it, I did not
change any configuration for debug and it is displayed in phpinfo. I do
not know why it is not working :(—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#770 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AACEusTZKFRUzE6GfDa1Pk-s2RXCcjkzks5qQg89gaJpZM4H9LuV
.
Ok, I've updated my vagrant box (PHP 5.6.22 with working XDebug 2.2.5) then fully installed from scratch /vendor
and now I am hitting a strange bug on page load:
Uninitialized string offset: 0
exception: exception 'Whoops\Exception\ErrorException' with message 'Uninitialized string offset: 0' in ROOT/vendor/joomla/application/src/AbstractWebApplication.php:309
Stack trace:
#0 ROOT/vendor/joomla/application/src/AbstractWebApplication.php(309): Whoops\Run->handleError(8, 'Uninitialized s...', 'ROOT/vendor...', 309, Array)
#1 ROOT/src/JTracker/Application.php(660): Joomla\Application\AbstractWebApplication->redirect('')
#2 ROOT/src/JTracker/Application.php(180): JTracker\Application->checkRememberMe()
#3 ROOT/vendor/joomla/application/src/AbstractWebApplication.php(134): JTracker\Application->doExecute()
#4 ROOT/www/index.php(97): Joomla\Application\AbstractWebApplication->execute()
#5 {main}
Tried to reinstall vendor
several times, but nothing :(
Moreover when I enable the database debug, then I hit another bug:
JTracker.CRITICAL: Exception of type RuntimeException thrown while executing the application {"exception":"object"}
In logs:
[02-Jul-2016 08:56:36 Europe/Riga] PHP Warning: constant(): Couldn't find constant \Monolog\Logger::debug in /vagrant/src/JTracker/Service/MonologProvider.php on line 81
[02-Jul-2016 08:56:36 Europe/Riga] PHP Stack trace:
[02-Jul-2016 08:56:36 Europe/Riga] PHP 1. {main}() /vagrant/www/index.php:0
[02-Jul-2016 08:56:36 Europe/Riga] PHP 2. JTracker\Application->mark() /vagrant/www/index.php:96
[02-Jul-2016 08:56:36 Europe/Riga] PHP 3. JTracker\Application->getDebugger() /vagrant/src/JTracker/Application.php:251
[02-Jul-2016 08:56:36 Europe/Riga] PHP 4. Joomla\DI\Container->get() /vagrant/src/JTracker/Application.php:132
[02-Jul-2016 08:56:36 Europe/Riga] PHP 5. JTracker\Service\DebuggerProvider->JTracker\Service{closure}() /vagrant/vendor/joomla/di/src/Container.php:357
[02-Jul-2016 08:56:36 Europe/Riga] PHP 6. App\Debug\TrackerDebugger->__construct() /vagrant/src/JTracker/Service/DebuggerProvider.php:38
[02-Jul-2016 08:56:36 Europe/Riga] PHP 7. App\Debug\TrackerDebugger->setupLogging() /vagrant/src/App/Debug/TrackerDebugger.php:94
[02-Jul-2016 08:56:36 Europe/Riga] PHP 8. Joomla\DI\Container->get() /vagrant/src/App/Debug/TrackerDebugger.php:124
[02-Jul-2016 08:56:36 Europe/Riga] PHP 9. JTracker\Service\DatabaseProvider->JTracker\Service{closure}() /vagrant/vendor/joomla/di/src/Container.php:357
[02-Jul-2016 08:56:36 Europe/Riga] PHP 10. Joomla\DI\Container->get() /vagrant/src/JTracker/Service/DatabaseProvider.php:62
[02-Jul-2016 08:56:36 Europe/Riga] PHP 11. JTracker\Service\MonologProvider->JTracker\Service{closure}() /vagrant/vendor/joomla/di/src/Container.php:357
[02-Jul-2016 08:56:36 Europe/Riga] PHP 12. Joomla\DI\Container->get() /vagrant/src/JTracker/Service/MonologProvider.php:109
[02-Jul-2016 08:56:36 Europe/Riga] PHP 13. JTracker\Service\MonologProvider->JTracker\Service{closure}() /vagrant/vendor/joomla/di/src/Container.php:357
[02-Jul-2016 08:56:36 Europe/Riga] PHP 14. constant() /vagrant/src/JTracker/Service/MonologProvider.php:81
So currently I am hitting the wall trying to run my local environment :(
OK, I have decided to reinstall my local dev environment from scratch
Hope to hear from me soon
Finally I've managed to setup everything and found the problem in code
Test server is updated. Seems like everything is fine now. Finally I hope :)
you rock
Thank you all
Status | New | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-07-20 18:22:01 |
Closed_By | ⇒ | b2z |
Awesome! I am glad we made it
Deployed. Try not to break too much now
Thanks
My test server is now switched to your branch. We can test live ;)