Skip to content

Commit

Permalink
add more debug lines
Browse files Browse the repository at this point in the history
  • Loading branch information
emilymye committed Sep 12, 2019
1 parent 263f4ad commit fe4e485
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
16 changes: 10 additions & 6 deletions .ci/magic-modules/downstream_changelog_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
unset.
"""
from pyutils import strutils, downstreams
from github import Github
import github
import os
import sys
import argparse
Expand Down Expand Up @@ -53,13 +53,13 @@ def downstream_changelog_info(gh, upstream_pr_num, changelog_repos):

for repo_name, pulls in parsed_urls:
print "Found downstream PR for repo %s" % repo_name

if repo_name not in changelog_repos:
print "[DEBUG] skipping repo %s with no CHANGELOG" % repo_name
continue

print "Generating changelog for pull requests in %s" % repo_name

print "Fetching repo %s" % repo_name
ghrepo = gh.get_repo(repo_name)

Expand Down Expand Up @@ -95,9 +95,13 @@ def set_changelog_info(gh_pull, release_note, labels_to_add):
print "Skipping, no downstreams repos given to downstream changelog info for"
sys.exit(0)

gh = Github(os.environ.get('GITHUB_TOKEN'))

gh = github.Github(os.environ.get('GITHUB_TOKEN'))
assert len(sys.argv) == 2, "expected id filename as argument"
with open(sys.argv[1]) as f:
pr_num = int(f.read())
downstream_changelog_info(gh, pr_num, downstream_repos)

try:
downstream_changelog_info(gh, pr_num, downstream_repos)
except github.GithubException.GithubException as e:
print "Error while trying to downstream changelog info: %s", e
raise e
3 changes: 1 addition & 2 deletions .ci/magic-modules/pyutils/downstreams.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,8 @@ def get_downstream_urls(client, pr_num):
List of downstream PR URLs.
"""
urls = []
print "Getting downstream URLs for PR %d..." % pr_num
pr = client.get_repo(UPSTREAM_REPO).get_pull(pr_num)
for comment in pr.get_issue_comments():
urls = urls + find_dependency_urls_in_comment(comment.body)
return urls


0 comments on commit fe4e485

Please sign in to comment.