Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

two webhooks cause two jira cards created #57

Closed
beliaev-maksim opened this issue Dec 11, 2024 · 5 comments · Fixed by #63
Closed

two webhooks cause two jira cards created #57

beliaev-maksim opened this issue Dec 11, 2024 · 5 comments · Fixed by #63
Labels
help wanted Extra attention is needed

Comments

@beliaev-maksim
Copy link
Member

beliaev-maksim commented Dec 11, 2024

Since our service is stateless, we lack visibility into what each unit of the app has produced and how it has acted.

When an issue is created from the template in GitHub, we receive two consecutive events: one for the issue being opened and another for the issue being labeled. (or even worse scenario when GitHub changes the order of the webhooks, first - Labeled, second - opened; In this case issue opened comes with the label in the payload)

We need to consider how to handle this situation effectively.

See canonical/bundle-kubeflow#1186

First it sent

issue labeled

{
  "action": "labeled",
  "issue": {
    "url": "https://api.github.com/repos/canonical/bundle-kubeflow/issues/1186",
    "repository_url": "https://api.github.com/repos/canonical/bundle-kubeflow",
    "labels_url": "https://api.github.com/repos/canonical/bundle-kubeflow/issues/1186/labels{/name}",
    "comments_url": "https://api.github.com/repos/canonical/bundle-kubeflow/issues/1186/comments",
    "events_url": "https://api.github.com/repos/canonical/bundle-kubeflow/issues/1186/events",
    "html_url": "https://github.com/canonical/bundle-kubeflow/issues/1186",
    "id": 2732907306,
    "node_id": "I_kwDOCbHvdc6i5Nsq",
    "number": 1186,
    "title": "github profiles IR charm: Transfer ownership to kubeflow-charmers and create needed tracks",
    "user": {
      "login": "orfeas-k",
      "id": 44405072,
      "node_id": "MDQ6VXNlcjQ0NDA1MDcy",
      "avatar_url": "https://avatars.githubusercontent.com/u/44405072?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/orfeas-k",
      "html_url": "https://github.com/orfeas-k",
      "followers_url": "https://api.github.com/users/orfeas-k/followers",
      "following_url": "https://api.github.com/users/orfeas-k/following{/other_user}",
      "gists_url": "https://api.github.com/users/orfeas-k/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/orfeas-k/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/orfeas-k/subscriptions",
      "organizations_url": "https://api.github.com/users/orfeas-k/orgs",
      "repos_url": "https://api.github.com/users/orfeas-k/repos",
      "events_url": "https://api.github.com/users/orfeas-k/events{/privacy}",
      "received_events_url": "https://api.github.com/users/orfeas-k/received_events",
      "type": "User",
      "user_view_type": "public",
      "site_admin": false
    },
    "labels": [
      {
        "id": 1168519496,
        "node_id": "MDU6TGFiZWwxMTY4NTE5NDk2",
        "url": "https://api.github.com/repos/canonical/bundle-kubeflow/labels/enhancement",
        "name": "enhancement",
        "color": "a2eeef",
        "default": true,
        "description": "New feature or request"
      }
    ],
    "state": "open",
    "locked": false,
    "assignee": null,
    "assignees": [

    ],
    "milestone": null,
    "comments": 0,
    "created_at": "2024-12-11T12:55:10Z",
    "updated_at": "2024-12-11T12:55:11Z",
    "closed_at": null,
    "author_association": "CONTRIBUTOR",
    "active_lock_reason": null,
    "body": "### Context\n\nOnce the charm is created, we need to:\r\n* Transfer ownership to [kubeflow-charmers](https://launchpad.net/~kubeflow-charmers)\r\n* Request guardrails and create tracks needed as instructed in this [discourse post](https://discourse.charmhub.io/t/self-service-creation-of-tracks-now-available-to-charm-developers/10910)\n\n### What needs to get done\n\nabove\n\n### Definition of Done\n\nabove",
    "reactions": {
      "url": "https://api.github.com/repos/canonical/bundle-kubeflow/issues/1186/reactions",
      "total_count": 0,
      "+1": 0,
      "-1": 0,
      "laugh": 0,
      "hooray": 0,
      "confused": 0,
      "heart": 0,
      "rocket": 0,
      "eyes": 0
    },
    "timeline_url": "https://api.github.com/repos/canonical/bundle-kubeflow/issues/1186/timeline",
    "performed_via_github_app": null,
    "state_reason": null
  },
  "label": {
    "id": 1168519496,
    "node_id": "MDU6TGFiZWwxMTY4NTE5NDk2",
    "url": "https://api.github.com/repos/canonical/bundle-kubeflow/labels/enhancement",
    "name": "enhancement",
    "color": "a2eeef",
    "default": true,
    "description": "New feature or request"
  },
  "repository": {
    "id": 162656117,
    "node_id": "MDEwOlJlcG9zaXRvcnkxNjI2NTYxMTc=",
    "name": "bundle-kubeflow",
    "full_name": "canonical/bundle-kubeflow",
    "private": false,
    "owner": {
      "login": "canonical",
      "id": 53057619,
      "node_id": "MDEyOk9yZ2FuaXphdGlvbjUzMDU3NjE5",
      "avatar_url": "https://avatars.githubusercontent.com/u/53057619?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/canonical",
      "html_url": "https://github.com/canonical",
      "followers_url": "https://api.github.com/users/canonical/followers",
      "following_url": "https://api.github.com/users/canonical/following{/other_user}",
      "gists_url": "https://api.github.com/users/canonical/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/canonical/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/canonical/subscriptions",
      "organizations_url": "https://api.github.com/users/canonical/orgs",
      "repos_url": "https://api.github.com/users/canonical/repos",
      "events_url": "https://api.github.com/users/canonical/events{/privacy}",
      "received_events_url": "https://api.github.com/users/canonical/received_events",
      "type": "Organization",
      "user_view_type": "public",
      "site_admin": false
    },
    "html_url": "https://github.com/canonical/bundle-kubeflow",
    "description": "Charmed Kubeflow",
    "fork": false,
    "url": "https://api.github.com/repos/canonical/bundle-kubeflow",
    "forks_url": "https://api.github.com/repos/canonical/bundle-kubeflow/forks",
    "keys_url": "https://api.github.com/repos/canonical/bundle-kubeflow/keys{/key_id}",
    "collaborators_url": "https://api.github.com/repos/canonical/bundle-kubeflow/collaborators{/collaborator}",
    "teams_url": "https://api.github.com/repos/canonical/bundle-kubeflow/teams",
    "hooks_url": "https://api.github.com/repos/canonical/bundle-kubeflow/hooks",
    "issue_events_url": "https://api.github.com/repos/canonical/bundle-kubeflow/issues/events{/number}",
    "events_url": "https://api.github.com/repos/canonical/bundle-kubeflow/events",
    "assignees_url": "https://api.github.com/repos/canonical/bundle-kubeflow/assignees{/user}",
    "branches_url": "https://api.github.com/repos/canonical/bundle-kubeflow/branches{/branch}",
    "tags_url": "https://api.github.com/repos/canonical/bundle-kubeflow/tags",
    "blobs_url": "https://api.github.com/repos/canonical/bundle-kubeflow/git/blobs{/sha}",
    "git_tags_url": "https://api.github.com/repos/canonical/bundle-kubeflow/git/tags{/sha}",
    "git_refs_url": "https://api.github.com/repos/canonical/bundle-kubeflow/git/refs{/sha}",
    "trees_url": "https://api.github.com/repos/canonical/bundle-kubeflow/git/trees{/sha}",
    "statuses_url": "https://api.github.com/repos/canonical/bundle-kubeflow/statuses/{sha}",
    "languages_url": "https://api.github.com/repos/canonical/bundle-kubeflow/languages",
    "stargazers_url": "https://api.github.com/repos/canonical/bundle-kubeflow/stargazers",
    "contributors_url": "https://api.github.com/repos/canonical/bundle-kubeflow/contributors",
    "subscribers_url": "https://api.github.com/repos/canonical/bundle-kubeflow/subscribers",
    "subscription_url": "https://api.github.com/repos/canonical/bundle-kubeflow/subscription",
    "commits_url": "https://api.github.com/repos/canonical/bundle-kubeflow/commits{/sha}",
    "git_commits_url": "https://api.github.com/repos/canonical/bundle-kubeflow/git/commits{/sha}",
    "comments_url": "https://api.github.com/repos/canonical/bundle-kubeflow/comments{/number}",
    "issue_comment_url": "https://api.github.com/repos/canonical/bundle-kubeflow/issues/comments{/number}",
    "contents_url": "https://api.github.com/repos/canonical/bundle-kubeflow/contents/{+path}",
    "compare_url": "https://api.github.com/repos/canonical/bundle-kubeflow/compare/{base}...{head}",
    "merges_url": "https://api.github.com/repos/canonical/bundle-kubeflow/merges",
    "archive_url": "https://api.github.com/repos/canonical/bundle-kubeflow/{archive_format}{/ref}",
    "downloads_url": "https://api.github.com/repos/canonical/bundle-kubeflow/downloads",
    "issues_url": "https://api.github.com/repos/canonical/bundle-kubeflow/issues{/number}",
    "pulls_url": "https://api.github.com/repos/canonical/bundle-kubeflow/pulls{/number}",
    "milestones_url": "https://api.github.com/repos/canonical/bundle-kubeflow/milestones{/number}",
    "notifications_url": "https://api.github.com/repos/canonical/bundle-kubeflow/notifications{?since,all,participating}",
    "labels_url": "https://api.github.com/repos/canonical/bundle-kubeflow/labels{/name}",
    "releases_url": "https://api.github.com/repos/canonical/bundle-kubeflow/releases{/id}",
    "deployments_url": "https://api.github.com/repos/canonical/bundle-kubeflow/deployments",
    "created_at": "2018-12-21T02:37:57Z",
    "updated_at": "2024-12-09T13:58:34Z",
    "pushed_at": "2024-12-09T13:58:32Z",
    "git_url": "git://github.com/canonical/bundle-kubeflow.git",
    "ssh_url": "[email protected]:canonical/bundle-kubeflow.git",
    "clone_url": "https://github.com/canonical/bundle-kubeflow.git",
    "svn_url": "https://github.com/canonical/bundle-kubeflow",
    "homepage": "",
    "size": 2641,
    "stargazers_count": 104,
    "watchers_count": 104,
    "language": "Python",
    "has_issues": true,
    "has_projects": true,
    "has_downloads": true,
    "has_wiki": false,
    "has_pages": false,
    "has_discussions": false,
    "forks_count": 50,
    "mirror_url": null,
    "archived": false,
    "disabled": false,
    "open_issues_count": 192,
    "license": {
      "key": "apache-2.0",
      "name": "Apache License 2.0",
      "spdx_id": "Apache-2.0",
      "url": "https://api.github.com/licenses/apache-2.0",
      "node_id": "MDc6TGljZW5zZTI="
    },
    "allow_forking": true,
    "is_template": false,
    "web_commit_signoff_required": false,
    "topics": [
      "bundle",
      "charmed-kubeflow",
      "juju",
      "kubeflow",
      "kubernetes",
      "operator",
      "operator-framework"
    ],
    "visibility": "public",
    "forks": 50,
    "open_issues": 192,
    "watchers": 104,
    "default_branch": "main",
    "custom_properties": {

    }
  },
  "organization": {
    "login": "canonical",
    "id": 53057619,
    "node_id": "MDEyOk9yZ2FuaXphdGlvbjUzMDU3NjE5",
    "url": "https://api.github.com/orgs/canonical",
    "repos_url": "https://api.github.com/orgs/canonical/repos",
    "events_url": "https://api.github.com/orgs/canonical/events",
    "hooks_url": "https://api.github.com/orgs/canonical/hooks",
    "issues_url": "https://api.github.com/orgs/canonical/issues",
    "members_url": "https://api.github.com/orgs/canonical/members{/member}",
    "public_members_url": "https://api.github.com/orgs/canonical/public_members{/member}",
    "avatar_url": "https://avatars.githubusercontent.com/u/53057619?v=4",
    "description": ""
  },
  "enterprise": {
    "id": 103375,
    "slug": "canonical",
    "name": "Canonical",
    "node_id": "E_kgDOAAGTzw",
    "avatar_url": "https://avatars.githubusercontent.com/b/103375?v=4",
    "description": null,
    "website_url": null,
    "html_url": "https://github.com/enterprises/canonical",
    "created_at": "2023-12-11T08:42:36Z",
    "updated_at": "2024-10-21T08:16:43Z"
  },
  "sender": {
    "login": "orfeas-k",
    "id": 44405072,
    "node_id": "MDQ6VXNlcjQ0NDA1MDcy",
    "avatar_url": "https://avatars.githubusercontent.com/u/44405072?v=4",
    "gravatar_id": "",
    "url": "https://api.github.com/users/orfeas-k",
    "html_url": "https://github.com/orfeas-k",
    "followers_url": "https://api.github.com/users/orfeas-k/followers",
    "following_url": "https://api.github.com/users/orfeas-k/following{/other_user}",
    "gists_url": "https://api.github.com/users/orfeas-k/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/orfeas-k/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/orfeas-k/subscriptions",
    "organizations_url": "https://api.github.com/users/orfeas-k/orgs",
    "repos_url": "https://api.github.com/users/orfeas-k/repos",
    "events_url": "https://api.github.com/users/orfeas-k/events{/privacy}",
    "received_events_url": "https://api.github.com/users/orfeas-k/received_events",
    "type": "User",
    "user_view_type": "public",
    "site_admin": false
  },
  "installation": {
    "id": 37898057,
    "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uMzc4OTgwNTc="
  }
}

And a second after:

issue opened

{
  "action": "opened",
  "issue": {
    "url": "https://api.github.com/repos/canonical/bundle-kubeflow/issues/1186",
    "repository_url": "https://api.github.com/repos/canonical/bundle-kubeflow",
    "labels_url": "https://api.github.com/repos/canonical/bundle-kubeflow/issues/1186/labels{/name}",
    "comments_url": "https://api.github.com/repos/canonical/bundle-kubeflow/issues/1186/comments",
    "events_url": "https://api.github.com/repos/canonical/bundle-kubeflow/issues/1186/events",
    "html_url": "https://github.com/canonical/bundle-kubeflow/issues/1186",
    "id": 2732907306,
    "node_id": "I_kwDOCbHvdc6i5Nsq",
    "number": 1186,
    "title": "github profiles IR charm: Transfer ownership to kubeflow-charmers and create needed tracks",
    "user": {
      "login": "orfeas-k",
      "id": 44405072,
      "node_id": "MDQ6VXNlcjQ0NDA1MDcy",
      "avatar_url": "https://avatars.githubusercontent.com/u/44405072?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/orfeas-k",
      "html_url": "https://github.com/orfeas-k",
      "followers_url": "https://api.github.com/users/orfeas-k/followers",
      "following_url": "https://api.github.com/users/orfeas-k/following{/other_user}",
      "gists_url": "https://api.github.com/users/orfeas-k/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/orfeas-k/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/orfeas-k/subscriptions",
      "organizations_url": "https://api.github.com/users/orfeas-k/orgs",
      "repos_url": "https://api.github.com/users/orfeas-k/repos",
      "events_url": "https://api.github.com/users/orfeas-k/events{/privacy}",
      "received_events_url": "https://api.github.com/users/orfeas-k/received_events",
      "type": "User",
      "user_view_type": "public",
      "site_admin": false
    },
    "labels": [
      {
        "id": 1168519496,
        "node_id": "MDU6TGFiZWwxMTY4NTE5NDk2",
        "url": "https://api.github.com/repos/canonical/bundle-kubeflow/labels/enhancement",
        "name": "enhancement",
        "color": "a2eeef",
        "default": true,
        "description": "New feature or request"
      }
    ],
    "state": "open",
    "locked": false,
    "assignee": null,
    "assignees": [

    ],
    "milestone": null,
    "comments": 0,
    "created_at": "2024-12-11T12:55:10Z",
    "updated_at": "2024-12-11T12:55:11Z",
    "closed_at": null,
    "author_association": "CONTRIBUTOR",
    "active_lock_reason": null,
    "body": "### Context\n\nOnce the charm is created, we need to:\r\n* Transfer ownership to [kubeflow-charmers](https://launchpad.net/~kubeflow-charmers)\r\n* Request guardrails and create tracks needed as instructed in this [discourse post](https://discourse.charmhub.io/t/self-service-creation-of-tracks-now-available-to-charm-developers/10910)\n\n### What needs to get done\n\nabove\n\n### Definition of Done\n\nabove",
    "reactions": {
      "url": "https://api.github.com/repos/canonical/bundle-kubeflow/issues/1186/reactions",
      "total_count": 0,
      "+1": 0,
      "-1": 0,
      "laugh": 0,
      "hooray": 0,
      "confused": 0,
      "heart": 0,
      "rocket": 0,
      "eyes": 0
    },
    "timeline_url": "https://api.github.com/repos/canonical/bundle-kubeflow/issues/1186/timeline",
    "performed_via_github_app": null,
    "state_reason": null
  },
  "repository": {
    "id": 162656117,
    "node_id": "MDEwOlJlcG9zaXRvcnkxNjI2NTYxMTc=",
    "name": "bundle-kubeflow",
    "full_name": "canonical/bundle-kubeflow",
    "private": false,
    "owner": {
      "login": "canonical",
      "id": 53057619,
      "node_id": "MDEyOk9yZ2FuaXphdGlvbjUzMDU3NjE5",
      "avatar_url": "https://avatars.githubusercontent.com/u/53057619?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/canonical",
      "html_url": "https://github.com/canonical",
      "followers_url": "https://api.github.com/users/canonical/followers",
      "following_url": "https://api.github.com/users/canonical/following{/other_user}",
      "gists_url": "https://api.github.com/users/canonical/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/canonical/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/canonical/subscriptions",
      "organizations_url": "https://api.github.com/users/canonical/orgs",
      "repos_url": "https://api.github.com/users/canonical/repos",
      "events_url": "https://api.github.com/users/canonical/events{/privacy}",
      "received_events_url": "https://api.github.com/users/canonical/received_events",
      "type": "Organization",
      "user_view_type": "public",
      "site_admin": false
    },
    "html_url": "https://github.com/canonical/bundle-kubeflow",
    "description": "Charmed Kubeflow",
    "fork": false,
    "url": "https://api.github.com/repos/canonical/bundle-kubeflow",
    "forks_url": "https://api.github.com/repos/canonical/bundle-kubeflow/forks",
    "keys_url": "https://api.github.com/repos/canonical/bundle-kubeflow/keys{/key_id}",
    "collaborators_url": "https://api.github.com/repos/canonical/bundle-kubeflow/collaborators{/collaborator}",
    "teams_url": "https://api.github.com/repos/canonical/bundle-kubeflow/teams",
    "hooks_url": "https://api.github.com/repos/canonical/bundle-kubeflow/hooks",
    "issue_events_url": "https://api.github.com/repos/canonical/bundle-kubeflow/issues/events{/number}",
    "events_url": "https://api.github.com/repos/canonical/bundle-kubeflow/events",
    "assignees_url": "https://api.github.com/repos/canonical/bundle-kubeflow/assignees{/user}",
    "branches_url": "https://api.github.com/repos/canonical/bundle-kubeflow/branches{/branch}",
    "tags_url": "https://api.github.com/repos/canonical/bundle-kubeflow/tags",
    "blobs_url": "https://api.github.com/repos/canonical/bundle-kubeflow/git/blobs{/sha}",
    "git_tags_url": "https://api.github.com/repos/canonical/bundle-kubeflow/git/tags{/sha}",
    "git_refs_url": "https://api.github.com/repos/canonical/bundle-kubeflow/git/refs{/sha}",
    "trees_url": "https://api.github.com/repos/canonical/bundle-kubeflow/git/trees{/sha}",
    "statuses_url": "https://api.github.com/repos/canonical/bundle-kubeflow/statuses/{sha}",
    "languages_url": "https://api.github.com/repos/canonical/bundle-kubeflow/languages",
    "stargazers_url": "https://api.github.com/repos/canonical/bundle-kubeflow/stargazers",
    "contributors_url": "https://api.github.com/repos/canonical/bundle-kubeflow/contributors",
    "subscribers_url": "https://api.github.com/repos/canonical/bundle-kubeflow/subscribers",
    "subscription_url": "https://api.github.com/repos/canonical/bundle-kubeflow/subscription",
    "commits_url": "https://api.github.com/repos/canonical/bundle-kubeflow/commits{/sha}",
    "git_commits_url": "https://api.github.com/repos/canonical/bundle-kubeflow/git/commits{/sha}",
    "comments_url": "https://api.github.com/repos/canonical/bundle-kubeflow/comments{/number}",
    "issue_comment_url": "https://api.github.com/repos/canonical/bundle-kubeflow/issues/comments{/number}",
    "contents_url": "https://api.github.com/repos/canonical/bundle-kubeflow/contents/{+path}",
    "compare_url": "https://api.github.com/repos/canonical/bundle-kubeflow/compare/{base}...{head}",
    "merges_url": "https://api.github.com/repos/canonical/bundle-kubeflow/merges",
    "archive_url": "https://api.github.com/repos/canonical/bundle-kubeflow/{archive_format}{/ref}",
    "downloads_url": "https://api.github.com/repos/canonical/bundle-kubeflow/downloads",
    "issues_url": "https://api.github.com/repos/canonical/bundle-kubeflow/issues{/number}",
    "pulls_url": "https://api.github.com/repos/canonical/bundle-kubeflow/pulls{/number}",
    "milestones_url": "https://api.github.com/repos/canonical/bundle-kubeflow/milestones{/number}",
    "notifications_url": "https://api.github.com/repos/canonical/bundle-kubeflow/notifications{?since,all,participating}",
    "labels_url": "https://api.github.com/repos/canonical/bundle-kubeflow/labels{/name}",
    "releases_url": "https://api.github.com/repos/canonical/bundle-kubeflow/releases{/id}",
    "deployments_url": "https://api.github.com/repos/canonical/bundle-kubeflow/deployments",
    "created_at": "2018-12-21T02:37:57Z",
    "updated_at": "2024-12-09T13:58:34Z",
    "pushed_at": "2024-12-09T13:58:32Z",
    "git_url": "git://github.com/canonical/bundle-kubeflow.git",
    "ssh_url": "[email protected]:canonical/bundle-kubeflow.git",
    "clone_url": "https://github.com/canonical/bundle-kubeflow.git",
    "svn_url": "https://github.com/canonical/bundle-kubeflow",
    "homepage": "",
    "size": 2641,
    "stargazers_count": 104,
    "watchers_count": 104,
    "language": "Python",
    "has_issues": true,
    "has_projects": true,
    "has_downloads": true,
    "has_wiki": false,
    "has_pages": false,
    "has_discussions": false,
    "forks_count": 50,
    "mirror_url": null,
    "archived": false,
    "disabled": false,
    "open_issues_count": 192,
    "license": {
      "key": "apache-2.0",
      "name": "Apache License 2.0",
      "spdx_id": "Apache-2.0",
      "url": "https://api.github.com/licenses/apache-2.0",
      "node_id": "MDc6TGljZW5zZTI="
    },
    "allow_forking": true,
    "is_template": false,
    "web_commit_signoff_required": false,
    "topics": [
      "bundle",
      "charmed-kubeflow",
      "juju",
      "kubeflow",
      "kubernetes",
      "operator",
      "operator-framework"
    ],
    "visibility": "public",
    "forks": 50,
    "open_issues": 192,
    "watchers": 104,
    "default_branch": "main",
    "custom_properties": {

    }
  },
  "organization": {
    "login": "canonical",
    "id": 53057619,
    "node_id": "MDEyOk9yZ2FuaXphdGlvbjUzMDU3NjE5",
    "url": "https://api.github.com/orgs/canonical",
    "repos_url": "https://api.github.com/orgs/canonical/repos",
    "events_url": "https://api.github.com/orgs/canonical/events",
    "hooks_url": "https://api.github.com/orgs/canonical/hooks",
    "issues_url": "https://api.github.com/orgs/canonical/issues",
    "members_url": "https://api.github.com/orgs/canonical/members{/member}",
    "public_members_url": "https://api.github.com/orgs/canonical/public_members{/member}",
    "avatar_url": "https://avatars.githubusercontent.com/u/53057619?v=4",
    "description": ""
  },
  "enterprise": {
    "id": 103375,
    "slug": "canonical",
    "name": "Canonical",
    "node_id": "E_kgDOAAGTzw",
    "avatar_url": "https://avatars.githubusercontent.com/b/103375?v=4",
    "description": null,
    "website_url": null,
    "html_url": "https://github.com/enterprises/canonical",
    "created_at": "2023-12-11T08:42:36Z",
    "updated_at": "2024-10-21T08:16:43Z"
  },
  "sender": {
    "login": "orfeas-k",
    "id": 44405072,
    "node_id": "MDQ6VXNlcjQ0NDA1MDcy",
    "avatar_url": "https://avatars.githubusercontent.com/u/44405072?v=4",
    "gravatar_id": "",
    "url": "https://api.github.com/users/orfeas-k",
    "html_url": "https://github.com/orfeas-k",
    "followers_url": "https://api.github.com/users/orfeas-k/followers",
    "following_url": "https://api.github.com/users/orfeas-k/following{/other_user}",
    "gists_url": "https://api.github.com/users/orfeas-k/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/orfeas-k/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/orfeas-k/subscriptions",
    "organizations_url": "https://api.github.com/users/orfeas-k/orgs",
    "repos_url": "https://api.github.com/users/orfeas-k/repos",
    "events_url": "https://api.github.com/users/orfeas-k/events{/privacy}",
    "received_events_url": "https://api.github.com/users/orfeas-k/received_events",
    "type": "User",
    "user_view_type": "public",
    "site_admin": false
  },
  "installation": {
    "id": 37898057,
    "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uMzc4OTgwNTc="
  }
}

@beliaev-maksim beliaev-maksim added the help wanted Extra attention is needed label Dec 12, 2024
@jmuzina
Copy link
Member

jmuzina commented Dec 13, 2024

I believe this also occurred for this issue. Glad I'm not the only one!

@ca-scribner
Copy link

What I wonder about is why this started happening recently. Seems like something that should have been broken all along

@beliaev-maksim
Copy link
Member Author

@ca-scribner I assume that github changed the order in which webhooks are sent. Since juju app is unchanged since months now

name: charmed-github-jira-bot
publisher: Maksim Beliaev
summary: Charmed https://github.com/canonical/gh-jira-sync-bot
description: Charmed https://github.com/canonical/gh-jira-sync-bot
store-url: https://charmhub.io/charmed-github-jira-bot
charm-id: oQAyEEnB7i0occzhjEMjAGaoD9hqj3s4
supports: [email protected]
subordinate: false
relations:
  provides: {}
  requires:
    nginx-route: nginx-route
channels: |
  latest/stable:     –
  latest/candidate:  –
  latest/beta:       –
  latest/edge:       12  2024-08-15  (12)  6MB  amd64  [email protected]

@ca-scribner
Copy link

yeah that's unsatisfying but I buy your argument :D

Looking through the code, I suspect this jira search is not correctly finding the existing issue. There's no existing log line to confirm this, but I think that's the only way this issue occurs.

Going into the Jira Issues page, I queried:

project = SMS
AND description ~ "This issue was created from GitHub Issue https://github.com/canonical/istio-ingress-k8s-operator/issues/30"

and got no hits even though there is an issue that should match that. Messing with the query some, I can get hits with

project = SMS
AND description ~ "This issue was created from GitHub Issue https://github.com/canonical/istio"

seems like the hyphen is breaking things. Why is it suddenly breaking things now? idk

I tried using a > in the query like mentioned here but that didn't work. Anyone know how to fix the JQL syntax here?

@beliaev-maksim
Copy link
Member Author

@ca-scribner no, the problem is that you have two hooks sent at 01:00:00, time to process jira card creation is 5s. By time the second hook lands to the server the jira search still returns None, which causes second card creation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants