{"id":490,"date":"2015-10-23T11:55:26","date_gmt":"2015-10-23T03:55:26","guid":{"rendered":"http:\/\/julyclyde.org\/?p=490"},"modified":"2015-10-23T13:56:14","modified_gmt":"2015-10-23T05:56:14","slug":"sentry%e6%95%b4%e7%90%86%e6%9d%82%e8%ae%b0","status":"publish","type":"post","link":"https:\/\/julyclyde.org\/?p=490","title":{"rendered":"Sentry\u6574\u7406\u6742\u8bb0"},"content":{"rendered":"<p>\u672c\u8ba8\u8bba\u5747\u57fa\u4e8eSentry 7.7\u7248\u672c<\/p>\n<h1>\u63d2\u4ef6\u673a\u5236<\/h1>\n<h2>\u81ea\u5e26\u63d2\u4ef6<\/h2>\n<p>src\/sentry\/plugins\/ \u6bcf\u63d2\u4ef6\u4e00\u4e2a\u76ee\u5f55<br \/>\n\u81ea\u5e26\u63d2\u4ef6loader\uff1asrc\/sentry\/conf\/server.py \u91cc\u7684 INSTALLED_APPS tuple<br \/>\n\u5916\u88c5\u63d2\u4ef6loader\uff1autils\/runner.py \u91cc\u7684 install_plugins()\u51fd\u6570\uff0c\u5bf9iter_entry_points()\u904d\u5386\u5e76\u5c06\u5176\u52a0\u5165 INSTALLED_APPS tuple \u4e2d<br \/>\n\u5916\u88c5\u63d2\u4ef6\u6ce8\u518c\uff1a\u63d2\u4ef6\u7684 setup.py \u91cc\u6267\u884c\u6ce8\u518c entry_points \u7684\u8fc7\u7a0b\uff1a<\/p>\n<p>\u4f8b\uff1a<a href=\"https:\/\/github.com\/getsentry\/sentry-groveio\/blob\/master\/setup.py\" target=\"_blank\">https:\/\/github.com\/getsentry\/sentry-groveio\/blob\/master\/setup.py<\/a><br \/>\n\u53c2\u8003\u8d44\u6599\uff1a<a href=\"https:\/\/pythonhosted.org\/setuptools\/pkg_resources.html\" target=\"_blank\">https:\/\/pythonhosted.org\/setuptools\/pkg_resources.html<\/a><\/p>\n<pre class=\"brush: python;\">#!\/usr\/bin\/env python\r\nimport pkg_resources\r\n\r\nfor ep in pkg_resources.iter_entry_points('sentry.apps'):\r\n    print str(ep)\r\n\r\nfor ep in pkg_resources.iter_entry_points('sentry.plugins'):\r\n    print str(ep)<\/pre>\n<h2>sentry-jira \u63d2\u4ef6<\/h2>\n<h3>\u63d2\u4ef6\u57fa\u672c\u914d\u7f6e<\/h3>\n<p>\u6bcf Project \u5206\u522b\u914d\u7f6e\uff0c\u9700\u8981\u8f93\u5165 jira \u7684 instance URL\u3001\u7528\u6237\u540d\u548c\u5bc6\u7801\u3002\u4ee5\u4e0a\u5185\u5bb9 base64 \u5b58\u5728\u6570\u636e\u5e93 sentry_projectoptions \u8868\u91cc where `key` like &#8216;jira%&#8217;<br \/>\n\u914d\u7f6e\u7528\u6237\u540d\u5bc6\u7801\u4e4b\u540e\uff0c\u9009\u62e9 Sentry project \u5173\u8054\u5230\u54ea\u4e2a JIRA Project\uff0c\u4fdd\u5b58\u8bbe\u7f6e\uff0c\u5e76 Enable Plugin \u5373\u53ef\u3002<\/p>\n<h3>Due Date \u95ee\u9898<\/h3>\n<p>\u5728 Sentry Event \u9875\u9762\u53f3\u8fb9\u70b9\u51fb Create JIRA Issue \u8fdb\u5165\u521b\u5efa\u9875\u9762\u3002\u4f46\u4e0b\u9762 Due Date \u603b\u63d0\u793a Operation value must be a string \u3002<br \/>\n\u7ecf tcpdump\uff0c\u63d2\u4ef6\u53d1\u9001\u683c\u5f0f\u4e3a<\/p>\n<pre class=\"brush: python;\">\"duedate\": {\"id\": \"2015-07-31\"}<\/pre>\n<p>\u6839\u636e \/rest\/api\/2\/issue\/createmeta?projectKeys=&lt;\u6211\u4eec\u7684KEY&gt;&amp;expand=projects.issuetypes.fields \u7684\u8bf4\u660e\uff0cduedate \u7684 schema \u4e3a<\/p>\n<pre class=\"brush: js;\">\"duedate\": {\r\n    \"hasDefaultValue\": false,\r\n    \"name\": \"Due Date\",\r\n    \"operations\": [\r\n        \"set\"\r\n    ],\r\n    \"required\": true,\r\n    \"schema\": {\r\n        \"system\": \"duedate\",\r\n        \"type\": \"date\"\r\n    }\r\n}<\/pre>\n<p>\u6839\u636e\u7f51\u4e0a\u6d41\u4f20\u7684\u6d88\u606f\uff08<a href=\"https:\/\/answers.atlassian.com\/questions\/319018\/jira-eclipse-mylyn-transition-fails-when-date-is-required-french-format#comment-319464\" target=\"_blank\">https:\/\/answers.atlassian.com\/questions\/319018\/jira-eclipse-mylyn-transition-fails-when-date-is-required-french-format#comment-319464<\/a>\uff09\uff0cJira\u671f\u671b\u7684\u683c\u5f0f\u5e94\u8be5\u662f<\/p>\n<pre class=\"brush: python;\">\"duedate\":\"2014-07-23\"<\/pre>\n<p>\u53d1\u9001\u683c\u5f0f\u548c\u671f\u671b\u683c\u5f0f\u7684\u4e0d\u540c\u5bfc\u81f4\u4e86\u65e0\u6cd5\u521b\u5efa Issue\u3002\u4e0d\u8fc7 sentry-jira \u63d2\u4ef6\u521b\u5efa\u7684\u5185\u5bb9\u662f id\uff0c\u800c\u4e0a\u8ff0 bugreport \u4e2d\u662f name\uff0c\u4e5f\u4e0d\u592a\u4e00\u6837\u3002<br \/>\n\u5012\u63a8\u68c0\u67e5\u63d2\u4ef6\u6e90\u4ee3\u7801\uff0c\u53d1\u73b0\u4ece Form \u63d0\u4ea4\u5230 jira \u5ba2\u6237\u7aef\u5bf9\u8c61\u7684\u6570\u636e\u5c31\u5df2\u7ecf\u662fu&#8217;duedate&#8217;: {&#8216;id&#8217;: u&#8217;2015-07-31&#8242;} \u4e86<br \/>\nsentry_jira:forms.py\u91cc<\/p>\n<pre class=\"brush: python;\">elif (schema.get(\"type\") != \"string\"\r\n  or schema.get(\"item\") != \"string\"\r\n  or schema.get(\"custom\") == CUSTOM_FIELD_TYPES.get(\"select\")):\r\n    v = {\"id\": v}<\/pre>\n<p>\u8fd9\u4e00\u6bb5\u7f3a\u4e4f\u5bf9 date \u7c7b\u578b\u7684 Jira \u5b57\u6bb5\u7684\u7279\u6b8a\u5904\u7406\uff0c\u5bfc\u81f4\u524d\u9762\u591a\u52a0\u4e86 id\u3002<br \/>\n\u4e5f\u5c31\u662f\u8bf4\uff0c\u5982\u679c\u4e0d\u6539 sentry-jira \u63d2\u4ef6\uff0c\u5c31\u65e0\u89e3\u3002\u6240\u4ee5\u6211\u63d0\u4ea4\u4e86pull request <a href=\"https:\/\/github.com\/thurloat\/sentry-jira\/pull\/71\" target=\"_blank\">https:\/\/github.com\/thurloat\/sentry-jira\/pull\/71<\/a><br \/>\n5\u65e5\u4e0b\u5348\u7a81\u7136\u53d1\u73b0\uff0c\u76ee\u524d\u7ebf\u4e0a Sentry 6.4.4 \u7684 duedate \u663e\u793a\u4e3a django \u7684 SelectDateWidget\uff0c\u800c\u4e0d\u50cf\u6211\u81ea\u5df1\u7684\u6d4b\u8bd5\u88c5 Sentry 7.7 \u4e00\u6837\u76f4\u63a5\u7528\u6587\u672c\u6846\u3002\u7ecf\u8fc7\u4ed4\u7ec6\u5bf9\u6bd4\uff0c\u53d1\u73b0\u670d\u52a1\u5668\u4e0a\u7684 sentry-jira \u63d2\u4ef6\u662f\u4fee\u6539\u8fc7\u7684\u7248\u672c\uff0cforms.py \u6587\u4ef6class JIRAIssueForm \u65b0\u589e\u4e86\u4e00\u6bb5<\/p>\n<pre class=\"brush: python;\">duedate = forms.DateField(\r\n    label=\"duedate\",\r\n    #widget=adminwidgets.AdminDateWidget(),\r\n    widget=SelectDateWidget(),\r\n    initial=datetime.datetime.now(),\r\n    #widget=DateWidget(usel10n=True)\r\n    required=True\r\n)<\/pre>\n<p>\u4f46\u8fd9\u6bb5\u4ee3\u7801\u6ca1\u5728\u516c\u53f8\u7684git\u5e93\u91cc\u4fdd\u5b58\u3002<\/p>\n<h1>SSO\u96c6\u6210<\/h1>\n<p>\u5382\u5bb6SSO\u8ba8\u8bba\uff1a<a href=\"https:\/\/github.com\/getsentry\/sentry\/issues\/1372\" target=\"_blank\">https:\/\/github.com\/getsentry\/sentry\/issues\/1372<\/a><br \/>\n\u65b0\u7248Sentry\u6709 auth backend \u57fa\u7c7b<a href=\"https:\/\/github.com\/getsentry\/sentry\/tree\/master\/src\/sentry\/auth\/\" target=\"_blank\">https:\/\/github.com\/getsentry\/sentry\/tree\/master\/src\/sentry\/auth\/<\/a><br \/>\nSENTRY_FEATURES[&#8216;organizations:sso&#8217;]\u6539\u4e3a True \u53ef\u4ee5\u5f00\u542f Auth \u9875\u9762\uff0c\u8bbe\u7f6esso\u3002<br \/>\n\u7136\u540e\u6211\u5c31\u53c2\u8003 sentry-sso-google \u5199\u4e86\u4e00\u4e2a\u63d2\u4ef6\u3002<\/p>\n<p>SENTRY_SINGLE_ORGANIZATION=True \u4f1a\u5bfc\u81f4 \/auth\/login\/ \u8df3\u8f6c\u5230 \/auth\/login\/org_slug\/ \uff0c\u4ece\u800c\u65e0\u6cd5\u767b\u5f55 \u975e SSO \u7684\u7528\u6237\uff08\u5982\u7cfb\u7edf\u81ea\u5e26\u7684\u540d\u4e3a sentry \u7684\u8d85\u7ea7\u7528\u6237\uff09<\/p>\n<h2>Organizations<\/h2>\n<p>\u5f53 SENTRY_SINGLE_ORGANIZATION=False \u65f6\uff0cutils\/runner.py\u52a0\u8f7d\u914d\u7f6e\u4e4b\u540e\u4f1a\u5c06 SENTRY_FEATURES[&#8216;organizations:create&#8217;] \u5f3a\u5236\u6539\u4e3a False\uff0c\u4ece\u800c\u7981\u7528\u4e86\u53f3\u4e0a\u89d2\u65b0 \u521b\u5efa Organization \u7684\u201c\u52a0\u53f7\u201d\u94fe\u63a5\u3002\u5982\u679c\u5728\u6b64\u72b6\u6001\u4e0b\u5220\u9664\u4e86\u6700\u540e\u4e00\u4e2a Organization\uff0c\u5219\u5176\u4e2d\u7684 \u00a0Team\u4f1a\u53d8\u6210\u6e38\u79bb\u72b6\u6001\uff0c\u53ea\u80fd\u6539\u6389\u53c2\u6570\u91cd\u542f\u670d\u52a1\u91cd\u65b0\u521b\u5efa\u4e86\uff0c\u800c\u4e14\u91cd\u5efa\u4e4b\u540e\u67d0\u79cd\u60c5\u51b5\u4e0b\u4f1a\u5bfc\u81f4\u6e38\u79bb\u72b6\u6001\u7684 Team \u4e22\u5931\u3002\u5207\u8bb0\u4e0d\u8981\u5220\u9664 Organization\uff01\uff01<br \/>\n\u6839\u636e getsentry \u539f\u5382GH-1372\u53f7 issue\uff0c\u6bcf\u4e2a Organization \u53ea\u80fd\u5f00\u542f\u4e00\u4e2a SSO AuthProvider<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u8ba8\u8bba\u5747\u57fa\u4e8eSentry 7.7\u7248\u672c \u63d2\u4ef6\u673a\u5236 \u81ea\u5e26\u63d2\u4ef6 src\/sentry\/plugins\/ \u6bcf\u63d2\u4ef6\u4e00\u4e2a\u76ee\u5f55 \u81ea\u5e26\u63d2\u4ef6loader\uff1asrc\/sentry\/conf\/server.py \u91cc\u7684 INSTALLED_APPS tuple \u5916\u88c5\u63d2\u4ef6loader\uff1autils\/runner.py \u91cc\u7684 install_plugins()\u51fd\u6570\uff0c\u5bf9iter_entry_points()\u904d\u5386\u5e76\u5c06\u5176\u52a0\u5165 INSTALLED_APPS tuple \u4e2d \u5916\u88c5\u63d2\u4ef6\u6ce8\u518c\uff1a\u63d2\u4ef6\u7684 setup.py \u91cc\u6267\u884c\u6ce8\u518c entry_points \u7684\u8fc7\u7a0b\uff1a \u4f8b\uff1ahttps:\/\/github.com\/getsentry\/sentry-groveio\/blob\/master\/setup.py \u53c2\u8003\u8d44\u6599\uff1ahttps:\/\/pythonhosted.org\/setuptools\/pkg_resources.html #!\/usr\/bin\/env python import pkg_resources for ep in pkg_resources.iter_entry_points(&#8216;sentry.apps&#8217;): print str(ep) for ep in pkg_resources.iter_entry_points(&#8216;sentry.plugins&#8217;): print str(ep) sentry-jira &hellip; <a href=\"https:\/\/julyclyde.org\/?p=490\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[27,12],"class_list":["post-490","post","type-post","status-publish","format-standard","hentry","category-default","tag-python","tag-standardization"],"_links":{"self":[{"href":"https:\/\/julyclyde.org\/index.php?rest_route=\/wp\/v2\/posts\/490","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/julyclyde.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/julyclyde.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/julyclyde.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/julyclyde.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=490"}],"version-history":[{"count":0,"href":"https:\/\/julyclyde.org\/index.php?rest_route=\/wp\/v2\/posts\/490\/revisions"}],"wp:attachment":[{"href":"https:\/\/julyclyde.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=490"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/julyclyde.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=490"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/julyclyde.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=490"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}