When a label is added, the issue and pull request webhooks receive an event with the action as "labeled". The hook should be using whatever is already assigned to the table if the updateData()
method is getting triggered. If the insertData()
method gets triggered, the build gets set to the default branch; this event reset the build to the default branch so I get a funny feeling the webhook hit that insert method instead of update. The question would be why though.
webhooks receive an event with the action as "labeled".
So the hooks are this: https://github.com/joomla/jissues/tree/master/src/App/Tracker/Controller/Hooks
Can we try some debugging here: https://github.com/joomla/jissues/blob/master/src/App/Tracker/Controller/Hooks/ReceiveIssuesHook.php#L41
if ($this->hookData->action == 'labeled')
{
$check = $this->checkIssueExists((int) $this->hookData->issue->number);
$this->logger->info(
sprintf(
'Label on Issue: %s/%s #%d Database entry exists: %s',
$this->project->gh_user,
$this->project->gh_project,
$this->hookData->issue->number,
$check
)
);
}
The expected result would always
Label on Issue: joomla/joomla-cms #12345 Database entry exists: true
but if we get false we have the error. If we get the expected we need to search elsewhere.
and it is not limited to labels we have the same for assiging.
http://issues.joomla.org/tracker/joomla-cms/6872#write
joomla/joomla-cms#6872
maybe we can change the code so we always run the updateData()
and only run the insertData()
if we have the action open
?
maybe we can change the code so we always run the updateData() and only run the insertData() if we have the action open?
I wouldn't suggest it. The hook controllers are designed so that the insert and update routes can handle some logic differences between whether we already have an issue in our database versus updating an existing record. If something is hitting the insert route and a record is already in the database, we have a logic fail in our check.
For now I've got checkIssueExists
logging each time it executes so we'll see what happens.
ok. Can you check ID 5678: joomla/joomla-cms#5678 (comment)
lol 5678 it is realy the correct ID
[2015-06-29 10:03:24] JTracker.INFO: Checking for item joomla/joomla-cms #5678 presence from hook action "labeled" with result: 6398 [] []
[2015-06-29 10:03:25] JTracker.INFO: Updated GitHub issue joomla/joomla-cms #5678 (Database ID #6398) to the tracker. [] []
[2015-06-29 10:03:35] JTracker.INFO: Checking for item joomla/joomla-cms #5678 presence from hook action "assigned" with result: 6398 [] []
[2015-06-29 10:03:35] JTracker.INFO: Updated GitHub issue joomla/joomla-cms #5678 (Database ID #6398) to the tracker. [] []
[2015-06-29 10:03:40] JTracker.INFO: Checking for item joomla/joomla-cms #5678 presence from hook action "unassigned" with result: 6398 [] []
[2015-06-29 10:03:40] JTracker.INFO: Updated GitHub issue joomla/joomla-cms #5678 (Database ID #6398) to the tracker. [] []
[2015-06-29 10:03:45] JTracker.INFO: Checking for item joomla/joomla-cms #5678 presence from hook action "unlabeled" with result: 6398 [] []
[2015-06-29 10:03:46] JTracker.INFO: Updated GitHub issue joomla/joomla-cms #5678 (Database ID #6398) to the tracker. [] []
Try that again please. It had a build of staging
in the tracker, I just changed it to master
.
HA! Got it, the check if build is empty is bad.
[2015-06-29 10:16:36] JTracker.INFO: Checking for item joomla/joomla-cms #5678 presence from hook action "labeled" with result: 6398 [] []
[2015-06-29 10:16:36] JTracker.INFO: Data for item joomla/joomla-cms #5678 before checking if build is empty: {"id":"6398","title":"False link generation on the Frontend `List Contacts in a Category` view","description":"<h4>Steps to reproduce the issue<\/h4>\n\n<ul>\n<li>install staging or 3.3.6 with testing samepledata<\/li>\n<li>create 2 menu entrys that use the view <code>List Contacts in a Category<\/code> with the category <code>Sample Data-Contact<\/code> (e.g. at the <code>top<\/code> navigation)<\/li>\n<li>name the first <code>public<\/code> and the other <code>registerd<\/code> (only for better understanding <img class=\"emoji\" title=\":smile:\" alt=\":smile:\" src=\"https:\/\/assets-cdn.github.com\/images\/icons\/emoji\/unicode\/1f604.png\" height=\"20\" width=\"20\" align=\"absmiddle\">)<\/li>\n<li>hide some information for the <code>public<\/code> menu entry (e.g. <code>Contact's Position<\/code> <code>Email<\/code> <code>Street Address<\/code> or others)<\/li>\n<li>access the <code>public<\/code> view.<\/li>\n<li>all works ok the information are hidden<\/li>\n<li>access the <code>registerd<\/code> menu link<\/li>\n<li>nothing works as it is the same link as for the <code>public<\/code> menu entry.<\/li>\n<\/ul>\n\n<p>Example links (public; works ok)<br>\n<a href=\"http:\/\/www.example.com\/index.php\/orchester\/mitwirkende\">http:\/\/www.example.com\/index.php\/orchester\/mitwirkende<\/a> (public view with hidden information)<br>\nClick on one list entry:<br>\n<a href=\"http:\/\/www.example.com\/index.php\/orchester\/mitwirkende\/2-name-vorname\">http:\/\/www.example.com\/index.php\/orchester\/mitwirkende\/2-name-vorname<\/a> (public view with hidden information)<\/p>\n\n<p>(registerd; dont work)<br>\n<a href=\"http:\/\/www.example.com\/index.php\/intern\/mitgliederverzeichnis\/\">http:\/\/www.example.com\/index.php\/intern\/mitgliederverzeichnis\/<\/a> (same category but without hidden information)<br>\nClick on one list entry:<br>\n<a href=\"http:\/\/www.example.com\/index.php\/orchester\/mitwirkende\/12-name-vorname\">http:\/\/www.example.com\/index.php\/orchester\/mitwirkende\/12-name-vorname<\/a> (false link as this is with hidden infos)<br>\ncorrect link (that works ok)<br>\n<a href=\"http:\/\/www.example.com\/index.php\/intern\/mitgliederverzeichnis\/12-name-vorname\">http:\/\/www.example.com\/index.php\/intern\/mitgliederverzeichnis\/12-name-vorname<\/a><\/p>\n\n<h4>Expected result<\/h4>\n\n<p>Links like <code>http:\/\/www.example.com\/index.php\/intern\/mitgliederverzeichnis\/12-name-vorname<\/code> for the internal <code>registerd<\/code> menu entry instead of <code>http:\/\/www.example.com\/index.php\/orchester\/mitwirkende\/12-name-vorname<\/code><\/p>\n\n<h4>Actual result<\/h4>\n\n<p>False link that move to the <code>public<\/code> information (some are hidden e.g.)<\/p>\n\n<p>current \/ false link (on the registed view): <code>http:\/\/www.example.com\/index.php\/orchester\/mitwirkende\/12-name-vorname<\/code><br>\nexpected link: <code>http:\/\/www.example.com\/index.php\/intern\/mitgliederverzeichnis\/12-name-vorname<\/code><\/p>\n\n<h4>Additional comments<\/h4>\n\n<p>works ok on 2.5.x<\/p>\n\n<h4>Joomla Bugs Reference<\/h4>\n\n<p><a href=\"http:\/\/www.joomla-bugs.de\/forum\/index.php?topic=639.msg3018#msg3018\">http:\/\/www.joomla-bugs.de\/forum\/index.php?topic=639.msg3018#msg3018<\/a><\/p>","description_raw":"#### Steps to reproduce the issue\r\n\r\n- install staging or 3.3.6 with testing samepledata\r\n- create 2 menu entrys that use the view `List Contacts in a Category` with the category `Sample Data-Contact` (e.g. at the `top` navigation)\r\n- name the first `public` and the other `registerd` (only for better understanding :smile:)\r\n- hide some information for the `public` menu entry (e.g. `Contact's Position` `Email` `Street Address` or others)\r\n- access the `public` view.\r\n- all works ok the information are hidden\r\n- access the `registerd` menu link\r\n- nothing works as it is the same link as for the `public` menu entry.\r\n\r\nExample links (public; works ok)\r\nhttp:\/\/www.example.com\/index.php\/orchester\/mitwirkende (public view with hidden information)\r\nClick on one list entry:\r\nhttp:\/\/www.example.com\/index.php\/orchester\/mitwirkende\/2-name-vorname (public view with hidden information)\r\n\r\n(registerd; dont work)\r\nhttp:\/\/www.example.com\/index.php\/intern\/mitgliederverzeichnis\/ (same category but without hidden information)\r\nClick on one list entry:\r\nhttp:\/\/www.example.com\/index.php\/orchester\/mitwirkende\/12-name-vorname (false link as this is with hidden infos)\r\ncorrect link (that works ok)\r\nhttp:\/\/www.example.com\/index.php\/intern\/mitgliederverzeichnis\/12-name-vorname\r\n\r\n#### Expected result\r\n\r\nLinks like `http:\/\/www.example.com\/index.php\/intern\/mitgliederverzeichnis\/12-name-vorname` for the internal `registerd` menu entry instead of `http:\/\/www.example.com\/index.php\/orchester\/mitwirkende\/12-name-vorname`\r\n\r\n\r\n#### Actual result\r\n\r\nFalse link that move to the `public` information (some are hidden e.g.)\r\n\r\ncurrent \/ false link (on the registed view): `http:\/\/www.example.com\/index.php\/orchester\/mitwirkende\/12-name-vorname`\r\nexpected link: `http:\/\/www.example.com\/index.php\/intern\/mitgliederverzeichnis\/12-name-vorname`\r\n\r\n#### Additional comments\r\n\r\nworks ok on 2.5.x\r\n\r\n#### Joomla Bugs Reference\r\n\r\nhttp:\/\/www.joomla-bugs.de\/forum\/index.php?topic=639.msg3018#msg3018","status":"1","modified_date":"2015-06-29 15:16:35","modified_by":"mbabker","labels":["39","54"],"priority":"3","build":"master","rel_number":"0","rel_type":null,"milestone_id":null} [] []
[2015-06-29 10:16:36] JTracker.INFO: Data for item joomla/joomla-cms #5678 after checking if build is empty: {"id":"6398","title":"False link generation on the Frontend `List Contacts in a Category` view","description":"<h4>Steps to reproduce the issue<\/h4>\n\n<ul>\n<li>install staging or 3.3.6 with testing samepledata<\/li>\n<li>create 2 menu entrys that use the view <code>List Contacts in a Category<\/code> with the category <code>Sample Data-Contact<\/code> (e.g. at the <code>top<\/code> navigation)<\/li>\n<li>name the first <code>public<\/code> and the other <code>registerd<\/code> (only for better understanding <img class=\"emoji\" title=\":smile:\" alt=\":smile:\" src=\"https:\/\/assets-cdn.github.com\/images\/icons\/emoji\/unicode\/1f604.png\" height=\"20\" width=\"20\" align=\"absmiddle\">)<\/li>\n<li>hide some information for the <code>public<\/code> menu entry (e.g. <code>Contact's Position<\/code> <code>Email<\/code> <code>Street Address<\/code> or others)<\/li>\n<li>access the <code>public<\/code> view.<\/li>\n<li>all works ok the information are hidden<\/li>\n<li>access the <code>registerd<\/code> menu link<\/li>\n<li>nothing works as it is the same link as for the <code>public<\/code> menu entry.<\/li>\n<\/ul>\n\n<p>Example links (public; works ok)<br>\n<a href=\"http:\/\/www.example.com\/index.php\/orchester\/mitwirkende\">http:\/\/www.example.com\/index.php\/orchester\/mitwirkende<\/a> (public view with hidden information)<br>\nClick on one list entry:<br>\n<a href=\"http:\/\/www.example.com\/index.php\/orchester\/mitwirkende\/2-name-vorname\">http:\/\/www.example.com\/index.php\/orchester\/mitwirkende\/2-name-vorname<\/a> (public view with hidden information)<\/p>\n\n<p>(registerd; dont work)<br>\n<a href=\"http:\/\/www.example.com\/index.php\/intern\/mitgliederverzeichnis\/\">http:\/\/www.example.com\/index.php\/intern\/mitgliederverzeichnis\/<\/a> (same category but without hidden information)<br>\nClick on one list entry:<br>\n<a href=\"http:\/\/www.example.com\/index.php\/orchester\/mitwirkende\/12-name-vorname\">http:\/\/www.example.com\/index.php\/orchester\/mitwirkende\/12-name-vorname<\/a> (false link as this is with hidden infos)<br>\ncorrect link (that works ok)<br>\n<a href=\"http:\/\/www.example.com\/index.php\/intern\/mitgliederverzeichnis\/12-name-vorname\">http:\/\/www.example.com\/index.php\/intern\/mitgliederverzeichnis\/12-name-vorname<\/a><\/p>\n\n<h4>Expected result<\/h4>\n\n<p>Links like <code>http:\/\/www.example.com\/index.php\/intern\/mitgliederverzeichnis\/12-name-vorname<\/code> for the internal <code>registerd<\/code> menu entry instead of <code>http:\/\/www.example.com\/index.php\/orchester\/mitwirkende\/12-name-vorname<\/code><\/p>\n\n<h4>Actual result<\/h4>\n\n<p>False link that move to the <code>public<\/code> information (some are hidden e.g.)<\/p>\n\n<p>current \/ false link (on the registed view): <code>http:\/\/www.example.com\/index.php\/orchester\/mitwirkende\/12-name-vorname<\/code><br>\nexpected link: <code>http:\/\/www.example.com\/index.php\/intern\/mitgliederverzeichnis\/12-name-vorname<\/code><\/p>\n\n<h4>Additional comments<\/h4>\n\n<p>works ok on 2.5.x<\/p>\n\n<h4>Joomla Bugs Reference<\/h4>\n\n<p><a href=\"http:\/\/www.joomla-bugs.de\/forum\/index.php?topic=639.msg3018#msg3018\">http:\/\/www.joomla-bugs.de\/forum\/index.php?topic=639.msg3018#msg3018<\/a><\/p>","description_raw":"#### Steps to reproduce the issue\r\n\r\n- install staging or 3.3.6 with testing samepledata\r\n- create 2 menu entrys that use the view `List Contacts in a Category` with the category `Sample Data-Contact` (e.g. at the `top` navigation)\r\n- name the first `public` and the other `registerd` (only for better understanding :smile:)\r\n- hide some information for the `public` menu entry (e.g. `Contact's Position` `Email` `Street Address` or others)\r\n- access the `public` view.\r\n- all works ok the information are hidden\r\n- access the `registerd` menu link\r\n- nothing works as it is the same link as for the `public` menu entry.\r\n\r\nExample links (public; works ok)\r\nhttp:\/\/www.example.com\/index.php\/orchester\/mitwirkende (public view with hidden information)\r\nClick on one list entry:\r\nhttp:\/\/www.example.com\/index.php\/orchester\/mitwirkende\/2-name-vorname (public view with hidden information)\r\n\r\n(registerd; dont work)\r\nhttp:\/\/www.example.com\/index.php\/intern\/mitgliederverzeichnis\/ (same category but without hidden information)\r\nClick on one list entry:\r\nhttp:\/\/www.example.com\/index.php\/orchester\/mitwirkende\/12-name-vorname (false link as this is with hidden infos)\r\ncorrect link (that works ok)\r\nhttp:\/\/www.example.com\/index.php\/intern\/mitgliederverzeichnis\/12-name-vorname\r\n\r\n#### Expected result\r\n\r\nLinks like `http:\/\/www.example.com\/index.php\/intern\/mitgliederverzeichnis\/12-name-vorname` for the internal `registerd` menu entry instead of `http:\/\/www.example.com\/index.php\/orchester\/mitwirkende\/12-name-vorname`\r\n\r\n\r\n#### Actual result\r\n\r\nFalse link that move to the `public` information (some are hidden e.g.)\r\n\r\ncurrent \/ false link (on the registed view): `http:\/\/www.example.com\/index.php\/orchester\/mitwirkende\/12-name-vorname`\r\nexpected link: `http:\/\/www.example.com\/index.php\/intern\/mitgliederverzeichnis\/12-name-vorname`\r\n\r\n#### Additional comments\r\n\r\nworks ok on 2.5.x\r\n\r\n#### Joomla Bugs Reference\r\n\r\nhttp:\/\/www.joomla-bugs.de\/forum\/index.php?topic=639.msg3018#msg3018","status":"1","modified_date":"2015-06-29 15:16:35","modified_by":"mbabker","labels":["39","54"],"priority":"3","build":"staging","rel_number":"0","rel_type":null,"milestone_id":null} [] []
[2015-06-29 10:16:36] JTracker.INFO: Updated GitHub issue joomla/joomla-cms #5678 (Database ID #6398) to the tracker. [] []
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-06-29 15:20:43 |
Closed_By | ⇒ | mbabker |
Thanks.
hmm it looks like this is on syncing the labels. Do you know where we sync it in the Code?
I only find the general label sync command (https://github.com/joomla/jissues/blob/master/cli/Application/Command/Get/Project/Labels.php) But that is not that one that run if I add a label on github?