Skip to content

Check for no open issues before build release #5801

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

Merged
merged 1 commit into from
Apr 14, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion dev-tools/build_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import urllib.request

from http.client import HTTPConnection
from http.client import HTTPSConnection


"""
This tool builds a release from the a given elasticsearch branch.
Expand Down Expand Up @@ -254,7 +256,33 @@ def build_release(run_tests=False, dry_run=True, cpus=1):
$ apt-get install rpm # on Ubuntu et.al
""")


# Uses the github API to fetch open tickets for the given release version
# if it finds any tickets open for that version it will throw an exception
def ensure_no_open_tickets(version):
version = "v%s" % version
conn = HTTPSConnection('api.github.com')
try:
log('Checking for open tickets on Github for version %s' % version)
log('Check if node is available')
print( 'https://api.github.com:443/repos/elasticsearch/elasticsearch/issues?state=open&labels=%s' % version)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this print statement intentional?

conn.request('GET', '/repos/elasticsearch/elasticsearch/issues?state=open&labels=%s' % version, headers= {'User-Agent' : 'Elasticsearch version checker'})
res = conn.getresponse()
if res.status == 200:
issues = json.loads(res.read().decode("utf-8"))
if issues:
urls = []
for issue in issues:
urls.append(issue['url'])
raise RuntimeError('Found open issues for release version %s see - %s' % (version, urls))
else:
log("No open issues found for version %s" % version)
else:
raise RuntimeError('Failed to fetch issue list from Github for release version %s' % version)
except socket.error as e:
log("Failed to fetch issue list from Github for release version %s' % version - Exception: [%s]" % (version, e))
#that is ok it might not be there yet
finally:
conn.close()

def wait_for_node_startup(host='127.0.0.1', port=9200,timeout=15):
for _ in range(timeout):
Expand Down Expand Up @@ -516,6 +544,7 @@ def check_s3_credentials():

if build:
release_version = find_release_version(src_branch)
ensure_no_open_tickets(release_version)
if not dry_run:
smoke_test_version = release_version
head_hash = get_head_hash()
Expand Down