Giter Club home page Giter Club logo

jirahub's Introduction

Jirahub: a package for syncing JIRA tickets and GitHub issues

This package provides a configurable tool for syncing tickets in a JIRA project and issues in a GitHub repository.

Please see the documentation for more information

License

This project is Copyright (c) Association of Universities for Research in Astronomy (AURA) and licensed under the terms of the BSD 3-Clause license. See LICENSE.rst for more information.

jirahub's People

Contributors

eslavich avatar rplesha avatar sosey avatar stscicrawford avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

jirahub's Issues

something still off with links

The emails sent by github leave out the organization in the link reference:

Previously documented in github issue [#917|https://github.com//issues/917]

The issue number has the correct link behind it, but the listed link text is wrong, not sure where this text is getting generated.

Automate syncing of more complex JIRA workflows via github labels

JIRA provides a lot of fairly complex workflows for issues that are customizable for specific projects. Github doesn't have such a thing (and arguably shouldn't), but it would be useful to be able to see the workflow status via, say a github label.

The catch here is how to manage transitions on the GH side - if someone changes the label on github-side to a state that's JIRA-illegal, what happens? But the simplest thing to start with is probably to just have it be one-way (JIRA->github).

A crazier idea might be to map the JIRA workflow status onto github projects, but that might be overkill since JIRA already provides a lot of tools like Kanban boards.

Typo in githubquery.py

There is a minor typo (an extra h) in githubquery.py on line 37:

self.github = Githubh(user, password) should be self.github = Github(user, password) in order to log in using username/password instead of a key.

Add locking of the jirabot

If there is a large amount of issues and the bot is running as a cron job, it can try to start spawning too many connections to github as described in spacetelescope/jwst#2628. Adding a mechanism to lock it so that it only has a single instance spawned would be useful

githubquery out of date

In PyGithub, the use of key, username, and password is moving towards deprecation. The user can now pass a token (https://github.com/settings/tokens) instead of the username. The current work around is to give the token for your project as the "user" variable, but this should at least be reflected in the docstring for jirahub.githubquery.GithubQuery().

Update the help

Tyler Desjardins mentions that we should consider moving emails from help[at]stsci.edu to point to the web portal where possible and appropriate. For HST (or any non-JWST), it is https://hsthelp.stsci.edu . For JWST, it is https://jwsthelp.stsci.edu . Please update info in setup.py, setup.cfg, documentation, etc as appropriate.

Please close this issue if it is irrelevant to your repository. This is an automated issue. If this is opened in error, please let pllim know!

xref spacetelescope/hstcal#317

Retire Python 2

Python 2 will not be maintained past Jan 1, 2020 (see https://pythonclock.org/). Please remove all Python 2 compatibility and move this package to Python 3 only.

For conda recipe (including astroconda-contrib), please include the following to prevent packaging it for Python 2 (https://conda.io/docs/user-guide/tasks/build-packages/define-metadata.html?preprocessing-selectors#skipping-builds):

build: 
  skip: true  # [py2k] 

Please close this issue if it is irrelevant to your repository. This is an automated issue. If this is opened in error, please let pllim know!

map jira and github users

Currently any comments on the JIRA-side appear as comments from the stscijgbot (e.g., spacetelescope/jwst#2399 ), and gh-comments on JIRA come from [email protected] . This is not ideal because it means JIRA comments are manifestly different and therefore seem like "second-class" on github, and vice versa.

So maybe there's someway to map JIRA to github users so the comments actually appear from the right person? This might be an administrative nightmare, but would be worth knowing exactly how hard it would be.

Consider changing design for Heroku deployment

Currently, your documentation says, "Need a list of issues to watch and are linked together โ€“ if not, all opened issues should be tracked." I don't think this is compatible with Heroku deployment workflow; please correct me if I am wrong.

Have you considered changing how this works so that it can be deployed in an automated fashion? For example, see baldrick and astropy-bot from the Astropy project, or any number of bots deployed for other big projects out there (CPython, matplotlib, etc).

Something wrong with setup.py on linux

When installing the package on a linux server, I get the error message: error: Setup script exited with error: command 'gcc' failed with exit status 1.

I don't understand what the issue is, but it appears that the root cause of this is coming from line 129 in setup.py: install_requires=[s.strip() for s in metadata.get('install_requires', 'astropy').split(',')], which is based off of line 51 in setup.cfg: install_requires = astropy, astropy-helpers, pygithub, jira.

Removing jira from the install_requires list allows the package to be installed on a linux machine without any errors. I had no issues installing from the same directory on a mac.

Handle Server Timeouts and 503 responses

Stacktrace

Traceback (most recent call last):
  File "./anaconda3/envs/jirahub/lib/python3.6/site-packages/requests-2.18.4-py3.6.egg/requests/adapters.py", line 440, in send
    timeout=timeout
  File "./anaconda3/envs/jirahub/lib/python3.6/site-packages/urllib3-1.22-py3.6.egg/urllib3/connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "./anaconda3/envs/jirahub/lib/python3.6/site-packages/urllib3-1.22-py3.6.egg/urllib3/util/retry.py", line 388, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.github.com', port=443): Max retries exceeded with url: /repos/spacetelescope/jwst/issues?since=2019-09-21T13%3A02%3A32Z (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f0c9d4887f0>, 'Connection to api.github.com timed out. (connect timeout=10)'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "jwst_pipeline_jgbot.py", line 162, in <module>
    issues = clean_issues(g, j, issues, args.clean)
  File "jwst_pipeline_jgbot.py", line 98, in clean_issues
    gh_issue_list = [str(github_issue.number) for github_issue in github_updated_issues]
  File "jwst_pipeline_jgbot.py", line 98, in <listcomp>
    gh_issue_list = [str(github_issue.number) for github_issue in github_updated_issues]
  File "./anaconda3/envs/jirahub/lib/python3.6/site-packages/PyGithub-1.40a3-py3.6.egg/github/PaginatedList.py", line 58, in __iter__
    newElements = self._grow()
  File "./anaconda3/envs/jirahub/lib/python3.6/site-packages/PyGithub-1.40a3-py3.6.egg/github/PaginatedList.py", line 70, in _grow
    newElements = self._fetchNextPage()
  File "./anaconda3/envs/jirahub/lib/python3.6/site-packages/PyGithub-1.40a3-py3.6.egg/github/PaginatedList.py", line 172, in _fetchNextPage
    headers=self.__headers
  File "./anaconda3/envs/jirahub/lib/python3.6/site-packages/PyGithub-1.40a3-py3.6.egg/github/Requester.py", line 258, in requestJsonAndCheck
    return self.__check(*self.requestJson(verb, url, parameters, headers, input, cnx))
  File "./anaconda3/envs/jirahub/lib/python3.6/site-packages/PyGithub-1.40a3-py3.6.egg/github/Requester.py", line 304, in requestJson
    return self.__requestEncode(cnx, verb, url, parameters, headers, input, encode)
  File "./anaconda3/envs/jirahub/lib/python3.6/site-packages/PyGithub-1.40a3-py3.6.egg/github/Requester.py", line 357, in __requestEncode
    status, responseHeaders, output = self.__requestRaw(cnx, verb, url, requestHeaders, encoded_input)
  File "./anaconda3/envs/jirahub/lib/python3.6/site-packages/PyGithub-1.40a3-py3.6.egg/github/Requester.py", line 384, in __requestRaw
    response = cnx.getresponse()
  File "./anaconda3/envs/jirahub/lib/python3.6/site-packages/PyGithub-1.40a3-py3.6.egg/github/Requester.py", line 105, in getresponse
    r = verb(url, headers=self.headers, data=self.input, timeout=self.timeout, verify=self.verify)
  File "./anaconda3/envs/jirahub/lib/python3.6/site-packages/requests-2.18.4-py3.6.egg/requests/sessions.py", line 521, in get
    return self.request('GET', url, **kwargs)
  File "./anaconda3/envs/jirahub/lib/python3.6/site-packages/requests-2.18.4-py3.6.egg/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "./anaconda3/envs/jirahub/lib/python3.6/site-packages/requests-2.18.4-py3.6.egg/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "./anaconda3/envs/jirahub/lib/python3.6/site-packages/requests-2.18.4-py3.6.egg/requests/adapters.py", line 496, in send
    raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='api.github.com', port=443): Max retries exceeded with url: /repos/spacetelescope/jwst/issues?since=2019-09-21T13%3A02%3A32Z (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f0c9d4887f0>, 'Connection to api.github.com timed out. (connect timeout=10)'))
Sat Sep 21 14:37:02 EDT 2019
Sat Sep 21 15:00:03 EDT 2019
Sat Sep 21 15:37:02 EDT 2019
Sat Sep 21 16:00:03 EDT 2019
Sat Sep 21 16:37:03 EDT 2019
Sat Sep 21 17:00:03 EDT 2019
Sat Sep 21 17:37:02 EDT 2019
Sat Sep 21 18:00:03 EDT 2019
Sat Sep 21 18:37:02 EDT 2019
WARNING:root:Got recoverable error from GET https://jira.stsci.edu/rest/api/2/serverInfo, will retry [1/3] in 3.5776933550275625s. Err: 503 Service Temporarily Unavailable
WARNING:root:Got recoverable error from GET https://jira.stsci.edu/rest/api/2/serverInfo, will retry [2/3] in 25.177439455726436s. Err: 503 Service Temporarily Unavailable
WARNING:root:Got recoverable error from GET https://jira.stsci.edu/rest/api/2/serverInfo, will retry [3/3] in 4.9389332646908635s. Err: 503 Service Temporarily Unavailable
Traceback (most recent call last):
  File "jda_jgbot.py", line 175, in <module>
    create_issues(issues, jirarepo, jirauser, jirapass, gitkey)
  File "jda_jgbot.py", line 104, in create_issues
    j = JiraQuery(jirarepo, user=jirauser, password=jirapass)
  File "./programs/jirahub/jirahub/jiraquery.py", line 39, in __init__
    self.jira = JIRA(site, basic_auth=(user, password))
  File "./anaconda3/envs/jirahub/lib/python3.6/site-packages/jira-1.0.15-py3.6.egg/jira/client.py", line 465, in __init__
    si = self.server_info()
  File "./anaconda3/envs/jirahub/lib/python3.6/site-packages/jira-1.0.15-py3.6.egg/jira/client.py", line 2100, in server_info
    j = self._get_json('serverInfo')
  File "./anaconda3/envs/jirahub/lib/python3.6/site-packages/jira-1.0.15-py3.6.egg/jira/client.py", line 2516, in _get_json
    r = self._session.get(url, params=params)
  File "./anaconda3/envs/jirahub/lib/python3.6/site-packages/jira-1.0.15-py3.6.egg/jira/resilientsession.py", line 151, in get
    return self.__verb('GET', url, **kwargs)
  File "./anaconda3/envs/jirahub/lib/python3.6/site-packages/jira-1.0.15-py3.6.egg/jira/resilientsession.py", line 147, in __verb
    raise_on_error(response, verb=verb, **kwargs)
  File "./anaconda3/envs/jirahub/lib/python3.6/site-packages/jira-1.0.15-py3.6.egg/jira/resilientsession.py", line 57, in raise_on_error
    r.status_code, error, r.url, request=request, response=r, **kwargs)
jira.exceptions.JIRAError: JiraError HTTP 503 url: https://jira.stsci.edu/rest/api/2/serverInfo
	text: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>503 Service Temporarily Unavailable</title>
</head><body>
<h1>Service Temporarily Unavailable</h1>
<p>The server is temporarily unable to service your
request due to maintenance downtime or capacity
problems. Please try again later.</p>
</body></html>

	
	response headers = {'Date': 'Sat, 21 Sep 2019 22:40:06 GMT', 'Content-Length': '323', 'Connection': 'close', 'Content-Type': 'text/html; charset=iso-8859-1'}
	response text = <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>503 Service Temporarily Unavailable</title>
</head><body>
<h1>Service Temporarily Unavailable</h1>
<p>The server is temporarily unable to service your
request due to maintenance downtime or capacity
problems. Please try again later.</p>
</body></html>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.