summaryrefslogtreecommitdiff
path: root/hacking
diff options
context:
space:
mode:
authorMatt Martz <matt@sivel.net>2019-04-15 15:28:25 -0500
committerGitHub <noreply@github.com>2019-04-15 15:28:25 -0500
commit65dcb4242a92798e750f1bd0f7d500a224f6e38d (patch)
tree2a40330e43c2fca0cb343a1e56d272f705658d21 /hacking
parent46420dd21a24791429bdf7e0a0b49a8aa6347337 (diff)
downloadansible-65dcb4242a92798e750f1bd0f7d500a224f6e38d.tar.gz
Fix deprecated issue creator (#55327)
Diffstat (limited to 'hacking')
-rw-r--r--hacking/create_deprecated_issues.py23
-rw-r--r--hacking/deprecated_issue_template.md2
2 files changed, 12 insertions, 13 deletions
diff --git a/hacking/create_deprecated_issues.py b/hacking/create_deprecated_issues.py
index f5e3f30903..9a6022988b 100644
--- a/hacking/create_deprecated_issues.py
+++ b/hacking/create_deprecated_issues.py
@@ -56,13 +56,12 @@ args = parser.parse_args()
body_tmpl = args.template.read()
args.template.close()
-text = args.problems.read()
-args.problems.close()
+text = args.problems[0].read()
+args.problems[0].close()
for line in text.splitlines():
- path, line, column, msg = line.split(':')
- msg = msg.strip()
+ path = line.split(':')[0]
if path.endswith('__init__.py'):
component = os.path.basename(os.path.dirname(path))
else:
@@ -73,7 +72,7 @@ for line in text.splitlines():
(component, ansible_major_version)
)
deprecated[component].append(
- dict(title=title, msg=msg, path=path, line=line, column=column)
+ dict(title=title, path=path, line=line)
)
@@ -84,15 +83,15 @@ repo = g.repository('ansible', 'ansible')
# so that we can later add the issue to a project column
# You will need the project and column IDs for this to work
# and then update the below lines
-# project = repo.project(1749241)
-# column = project.column(3314029)
+# project = repo.project(2141803)
+# project_column = project.column(4348504)
for component, items in deprecated.items():
title = items[0]['title']
- msg = '\n'.join(i['msg'] for i in items)
- path = '\n'.join(i['path'] for i in items)
- body = body_tmpl % dict(component=component, msg=msg, path=path,
- line=line, column=column,
+ path = '\n'.join(set((i['path']) for i in items))
+ line = '\n'.join(i['line'] for i in items)
+ body = body_tmpl % dict(component=component, path=path,
+ line=line,
version=ansible_major_version)
issue = repo.create_issue(title, body=body, labels=['deprecated'])
@@ -102,5 +101,5 @@ for component, items in deprecated.items():
# Uncomment the next 2 lines if you want to add issues to a project
# Needs to be done in combination with the above code for selecting
# the project/column
- # column.create_card_with_issue(issue)
+ # project_column.create_card_with_issue(issue)
# time.sleep(0.5)
diff --git a/hacking/deprecated_issue_template.md b/hacking/deprecated_issue_template.md
index e319fba794..45a8d37ad0 100644
--- a/hacking/deprecated_issue_template.md
+++ b/hacking/deprecated_issue_template.md
@@ -2,7 +2,7 @@
%(component)s contains call to Display.deprecated or AnsibleModule.deprecate and is scheduled for removal
```
-%(path)s:%(line)s:%(column)s: %(msg)s
+%(line)s
```
##### ISSUE TYPE