{ "info": { "author": "Josh Bialkowski", "author_email": "josh.bialkowski@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "==============\nWorkflow Tools\n==============\n\nSome tools for automating gerrit, jira, etc.\n\nWhen my work team moved our issue tracking to JIRA, it was a boon for project\nmanagement, but introduced some significant development friction. Jira is\npowerful, but it is not fast. It takes about 12 clicks to accomplish anything\nand it seems that every UI interaction involves some massive database update.\n\n``flow-tools`` started as a couple of scripts to automate common time-consuming\ninteractions with JIRA. This has come to include a couple of Gerrit -> JIRA\nintegrations as well.\n\n\n-----\nUsage\n-----\n\n::\n\n usage: flow-tools [-h] [-c CONFIG] [-v] ...\n\n Command line client to automate parts of our agile workflow.\n\n positional arguments:\n \n close-issues-merged\n Walk the list of merges on master for the given user.\n Look for tags in the commit message indicating that\n the commit closes/resolves an issue. Then login to\n jira and close those issues if they are not already\n closed.\n set-issues-fixed-in-release\n For each issue closed in a release, set the \"Fixed\n Release\" field of jira\n add-mentions-to-watchers\n Get a list of all mentioned users in the issue\n comments and description, and add any to the watcher\n list that are not already watchers.\n print-releases Parse tags on the gerrit remote and print a sorted\n list of version strings, using the pattern and sort\n functions from the config file.\n release-notes Show a list of commit message summaries for each\n commit in the series between one version and another.\n issues-in-release Show a list of issues that were closed in a release.\n In particular, lookup all commits that went into a\n release (since the common ancestor with the previous\n release). For each commit, get the list of issues\n closed or resolved through commit message meta data.\n These are the issues considered \"in\" the release.\n increment-jira-from-gerrit\n Monitor changes on gerrit for tags indicating\n associated issues that are resolved by those changes.\n As a change moves through the gerrit workflow, move\n the associated issue through the jira workflow. Same\n as update-jira-from-gerrit but in this case the start\n of the period to search will the last successful time\n we ran this command, and the end time will be right\n now.\n update-jira-from-gerrit\n Monitor changes on gerrit for tags indicating\n associated issues that are resolved by those changes.\n As a change moves through the gerrit workflow, move\n the associated issue through the jira workflow.\n\n optional arguments:\n -h, --help show this help message and exit\n -c CONFIG, --config CONFIG\n -v, --version show program's version number and exit\n\n Subcommands have their own options. Use -h or --help to\n see specific help for each subcommand.\n\n\n--------\nExamples\n--------\n\nMove at-mentions to watchers\n============================\n\nFind all the users who are `@`-mentioned in comments on the ticket `PROJ-1234`\nand make them watchers of that ticket::\n\n flow-tools add-mentions-to-watchers PROJ-1234\n\nSimple Gerrit/Jira integration\n==============================\n\nTo utilize jira/gerrit integration, add tags to your commit message like::\n\n Closes: bug-1234, bug-1235, bug-1236\n Resolves: bug-1237, bug-1238\n\nThe integration script will read commit messages and parse them for these tags.\nFor any issue mentioned, that issue will be moved, in jira, to the status\n\"In Review\". Then, once the change is merged, any associated ticket mentioned\nin \"Closes\" will be moved to \"Closed\" and any ticket mentioned in \"Resolves\"\nwill be moved to \"Resolved\".\n\nTo scan gerrit changes updated in the past 10 days use::\n\n flow-tools update-jira-from-gerrit --project my_project \\\n --start-time \"$(date '+%Y-%m-%d %H:%M:%S' -d '-10 days')\" \\\n --end-time \"$(date '+%Y-%m-%d %H:%M:%S' -d '-10 days')\"\n\nTo incrementally scan gerrit changes (since the last time you ran this\ncommand or 1 week if this is the first time you've run it)::\n\n flow-tools increment-jira-from-gerrit --project my_project\n\nFor gerrit/jira integration, you can set up a cron job to batch-advance issues\nbased on their gerrit status::\n\n crontab -e\n\nHere's a simple cron job that will advance issues on the 12th minute of every\nhour::\n\n PYTHONPATH=/path/to/flow-tools\n # Minute Hour Day of Month Month Day of Week Command\n # (0-59) (0-23) (1-31) (1-12 or Jan-Dec) (0-6 or Sun-Sat)\n 12 * * * * flow-tools increment-jira-from-gerrit --project my_project >> /path/to/flow_tools.log\n\n-------------\nConfiguration\n-------------\n\nConfiguration is managed by a python file stored at::\n\n ~/.flowtools/config.py\n\nHere's an example.::\n\n\n # URL for the database that sqlalchemy should use. The database is used to\n # cache certain objects fetched from either the gerrit or jira REST APIs\n # and to store some state for doing incremental jobs.\n db_url = \"sqlite:////home/user/.flowtools/db.sqlite\",\n\n # Jira rest configuration. These are passed directly as kwargs to the\n # jira rest client constructor.\n jira = {\n \"auth\" : {\n \"url\" : \"https://company.atlassian.net\",\n \"username\" : \"user+robo\",\n \"password\" : \"abc123!@#\",\n },\n\n # The nominal flow of a jira ticket from the perspective of gerrit/jira\n # integration. This is used to prevent any \"backwards\" movement of a\n # ticket in the event that a human being changes the status of a ticket\n # before the integration script does.\n \"nominal-flow\" : {\n \"PROJA\": {\n \"New\": [\n \"Open\",\n \"In Progress\",\n \"In Review\",\n \"Verify (QA)\",\n \"Closed\"\n ],\n \"Open\": [\n \"In Progress\",\n \"In Review\",\n \"Verify (QA)\",\n \"Closed\"\n ],\n \"In Progress\": [\n \"In Review\",\n \"Verify (QA)\",\n \"Closed\"\n ],\n \"In Review\": [\n \"Verify (QA)\",\n \"Closed\"\n ],\n \"Verify (QA)\": [\n \"Closed\"\n ]\n }\n\n\n },\n\n gerrit = {\n # Gerrit rest configuration. The password is the http password added to\n # gerrit for the account. You can add an http password to an account\n # through either the web UI or command line tools.\n \"rest\" : {\n \"url\" : \"https://gerrit.company.com\",\n \"username\" : \"user+robo\",\n \"password\" : \"ABDCEFGHIJKLMNOPQRSTUVWXYZXabcdefghjijklmnopqurst\"\n },\n\n # Gerrit ssh connection information.\n \"ssh\" : {\n \"host\" : \"gerrit.company.com\",\n \"port\" : 29418\n }\n },\n\n gerrit_jira = {\n # Maps commit change message tags to jira ticket status that a ticket\n # should be transitioned to in the event that a gerrit change is\n # merged.\n \"tag-map\": {\n \"Closes\": \"Closed\",\n \"Resolves\": \"QA (Resolved)\"\n }\n }\n", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/cheshirekow/flow_tools/archive/1.0.3.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/cheshirekow/flow_tools", "keywords": "jira", "license": "", "maintainer": "", "maintainer_email": "", "name": "flow_tools", "package_url": "https://pypi.org/project/flow_tools/", "platform": "", "project_url": "https://pypi.org/project/flow_tools/", "project_urls": { "Download": "https://github.com/cheshirekow/flow_tools/archive/1.0.3.tar.gz", "Homepage": "https://github.com/cheshirekow/flow_tools" }, "release_url": "https://pypi.org/project/flow_tools/1.0.3/", "requires_dist": null, "requires_python": "", "summary": "Integrations and scripts for jira and gerrit", "version": "1.0.3" }, "last_serial": 3774248, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "3772f8e45b01030eb10281945fd2b1ed", "sha256": "0919010d691bc2343035771814ed24dbdd9bb969279c24eff28e838843d774a0" }, "downloads": -1, "filename": "flow_tools-1.0.0.tar.gz", "has_sig": false, "md5_digest": "3772f8e45b01030eb10281945fd2b1ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16972, "upload_time": "2018-04-06T16:25:09", "url": "https://files.pythonhosted.org/packages/9b/3a/0a9cd81778fb9b7b98bb98a1b39d1868987699f86eef27eeebe9b222a54e/flow_tools-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "8ebe07bb32b25ef84f8bd8b1349a384b", "sha256": "77ecd1bc93cd1ff2f51f372f7d6dc012193639504edfd3f6f7f90d1841c3200a" }, "downloads": -1, "filename": "flow_tools-1.0.1.tar.gz", "has_sig": false, "md5_digest": "8ebe07bb32b25ef84f8bd8b1349a384b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16981, "upload_time": "2018-04-09T18:14:57", "url": "https://files.pythonhosted.org/packages/1b/e0/67ead6dff1d43495f729218f379f16d6c0b7cc2421e8f5f02e611a30659c/flow_tools-1.0.1.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "96d6001766e332e15a2d9f4a021b6850", "sha256": "76dee82015fb2efe0531ab5dc75f64de6420964d370339b9775935f9ccb65475" }, "downloads": -1, "filename": "flow_tools-1.0.3.tar.gz", "has_sig": false, "md5_digest": "96d6001766e332e15a2d9f4a021b6850", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17121, "upload_time": "2018-04-17T18:10:01", "url": "https://files.pythonhosted.org/packages/76/32/7153c8a28d7ad0734016d0c14e92c52bed447ee90c2758418ff6c449d060/flow_tools-1.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "96d6001766e332e15a2d9f4a021b6850", "sha256": "76dee82015fb2efe0531ab5dc75f64de6420964d370339b9775935f9ccb65475" }, "downloads": -1, "filename": "flow_tools-1.0.3.tar.gz", "has_sig": false, "md5_digest": "96d6001766e332e15a2d9f4a021b6850", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17121, "upload_time": "2018-04-17T18:10:01", "url": "https://files.pythonhosted.org/packages/76/32/7153c8a28d7ad0734016d0c14e92c52bed447ee90c2758418ff6c449d060/flow_tools-1.0.3.tar.gz" } ] }