Skip to content
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

scripts: release_notes can track original issue #6009

Merged
1 commit merged into from Sep 30, 2015

Conversation

Projects
None yet
2 participants
@theanalyst
Copy link
Member

theanalyst commented Sep 21, 2015

ceph_release_notes helper now has --original-issue and
--no-original-issue (default) flags added. This is useful
in backport tracker as the original upstream issue generally tends to be
more informative than the backport issue reference number in the release
notes. Since turning on this flag adds the additional network query of
redmine tracker for each issue, it is turned off by default

Signed-off-by: Abhishek Lekshmanan abhishek.lekshmanan@ril.com

@theanalyst theanalyst added the tools label Sep 21, 2015

@theanalyst theanalyst assigned ghost Sep 21, 2015

try:
relations = r.json()["issue"]["relations"]
except KeyError:
break

This comment has been minimized.

@ghost

This comment has been minimized.

@theanalyst

theanalyst Sep 21, 2015

Author Member

good catch :)

This comment has been minimized.

@ghost

ghost Sep 21, 2015

Actually, we it should not be continue either, just make it so the rest of the if original_issue is not run

This comment has been minimized.

@theanalyst

theanalyst Sep 21, 2015

Author Member

continue should break out of the inner loop so I guess purpose is served..

@@ -29,6 +29,7 @@ import github
import os
import re
import sys
import requests

This comment has been minimized.

@ghost

ghost Sep 21, 2015

could you add it to the pip install in the comment at the beginning of the file ?

This comment has been minimized.

@theanalyst

theanalyst Sep 21, 2015

Author Member

adding

@@ -96,9 +110,14 @@ if __name__ == "__main__":
help="path to ceph git repo")
parser.add_argument("--token", default=os.getenv("GITHUB_ACCESS_TOKEN"),
help="Github Access Token ($GITHUB_ACCESS_TOKEN otherwise)")
parser.add_argument("--original_issue", dest='original_issue', action='store_true',

This comment has been minimized.

@ghost

ghost Sep 21, 2015

I would make this the default instead

This comment has been minimized.

@theanalyst

theanalyst Sep 21, 2015

Author Member

the only reason I didn't default that was when running against master branch etc. (ie non backport releases) this will significantly slow down things. But since the number of times this activity is done is relatively small I guess I can change the defaults.

This comment has been minimized.

@ghost

ghost Sep 21, 2015

You have a point, let's keep it this way.

This comment has been minimized.

@theanalyst

theanalyst Sep 21, 2015

Author Member

oops I changed to --original-issue as the default now, should I change it back ?

@theanalyst theanalyst force-pushed the theanalyst:scripts/orig-issue branch from e8a9340 to 60781fb Sep 21, 2015

@theanalyst

This comment has been minimized.

Copy link
Member Author

theanalyst commented Sep 21, 2015

updated

relations = r.json()["issue"]["relations"]
except KeyError:
break
related_issues = [str(i['issue_id']) for i in relations if i["relation_type"] == "copied_to"]

This comment has been minimized.

@ghost

ghost Sep 21, 2015

there are cases where the issue is not a backport issue. In this case we can just keep the original issue because the relations field is not strictly well maintained.

This comment has been minimized.

@theanalyst

theanalyst Sep 21, 2015

Author Member

I'm hoping the relations key would error out then... or the filter ie copied_to would fail... if both of this fail then I guess we can add a check for "the issue tracker is backports" or something. WDYT?

This comment has been minimized.

@ghost

ghost Sep 21, 2015

that seem fragile and difficult to figure out should it fail. We have to account for the fact that the Bug tracker is loosely maintain. The Backport tracker is much more reliable and the odds of a misleading "Copied to" are very low.

This comment has been minimized.

@theanalyst

theanalyst Sep 21, 2015

Author Member

I'll check for this as a precondition

This comment has been minimized.

@theanalyst

theanalyst Sep 21, 2015

Author Member

Added a check

scripts: release_notes can track original issue
ceph_release_notes helper now has `--original-issue` (default) and
`--no-original-issue` flags added. This is useful
in backport tracker as the original upstream issue generally tends to be
more informative than the backport issue reference number in the release
notes. Since turning on this flag adds the additional network query of
redmine tracker for each issue, it is turned off by default

Signed-off-by: Abhishek Lekshmanan <abhishek.lekshmanan@ril.com>

@theanalyst theanalyst force-pushed the theanalyst:scripts/orig-issue branch from 60781fb to 5e2c665 Sep 21, 2015

try:
relations = r.json()["issue"]["relations"]
except KeyError:
continue

This comment has been minimized.

@ghost

ghost Sep 21, 2015

if a Backport issue has no relation it will be skipped, i.e. the issue2prs.setdefault below won't be set

This comment has been minimized.

@theanalyst

theanalyst Sep 22, 2015

Author Member

I kind of did this to silence the key error exception which arises when we query an non existent key whenever the relation is not set.

This comment has been minimized.

@ghost

ghost Sep 24, 2015

but it means we'll miss some issue, right ?

This comment has been minimized.

@theanalyst

theanalyst Sep 24, 2015

Author Member

This should break only the if original issue so we should be ok I guess?

ghost pushed a commit that referenced this pull request Sep 30, 2015

Loic Dachary
Merge pull request #6009 from theanalyst/scripts/orig-issue
scripts: release_notes can track original issue

Reviewed-by: Loic Dachary <ldachary@redhat.com>

@ghost ghost merged commit 3e487c3 into ceph:master Sep 30, 2015

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.