Skip to content

Commit 3bda081

Browse files
author
Matthias Köppe
authored
Merge pull request #174 from tobiasdiez/update-labels
Add more prefixes to some labels
2 parents b9e2ddf + ce69bd8 commit 3bda081

File tree

3 files changed

+37
-39
lines changed

3 files changed

+37
-39
lines changed

docs/Migration-Trac-to-Github.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ See also: https://trac.sagemath.org/ticket/30363
5858
5959
- [Open an Issue on GitHub](https://docs.github.com/en/issues). Preview of Issues (converted from Trac): https://github.com/sagemath/trac_to_gh/issues
6060
- **Trac ticket box attributes** are mapped as follows (see https://github.com/sagemath/trac-to-github/issues/8):
61-
- **Type** ("defect", "enhancement", "task") are mapped to "Labels" "bug", "enhancement".
61+
- **Type** ("defect", "enhancement", "task") are mapped to "Labels" "t: bug", "t: enhancement".
6262
- **Component** ("basic arithmetic", "linear algebra", "geometry", ...) are mapped to "Labels"
6363
with prefix `c: `
6464
- **Priority** ("trivial"/"minor"/"major"/"critical"/"blocker") are mapped to "Labels" with prefix `p: `
@@ -71,7 +71,7 @@ See also: https://trac.sagemath.org/ticket/30363
7171
- **Milestone = duplicate/invalid/wontfix** and **Resolution** ("duplicate", "invalid", "wontfix")
7272
are replaced by
7373
- [marking as duplicate](https://docs.github.com/en/issues/tracking-your-work-with-issues/marking-issues-or-pull-requests-as-a-duplicate),
74-
- "Labels" "duplicate", "invalid", "wontfix", or
74+
- "Labels" "r: duplicate", "r: invalid", "r: wontfix", or
7575
- closing with a comment; use "Close as not wanted"
7676
- **Dependencies**: Use the phrase "Depends on ", followed by the Issue or PR reference.
7777
Repeat this in separate lines if there is more than one dependency.
@@ -125,7 +125,7 @@ See also: https://trac.sagemath.org/ticket/30363
125125
- alternatively, with the [GitHub command-line interface](https://trac.sagemath.org/ticket/34523), use [`gh pr checkout PULL_REQUEST_ID`](https://cli.github.com/manual/gh_pr_checkout)
126126
127127
- For closing issues, **instead of marking it as invalid/duplicate and ready for review**,
128-
- if you have the rights to do so, simply [close the issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/closing-an-issue), add a label to specify the reason (e.g. "duplicate") and maybe add a short comment explaining why the issue has been closed, if that's not already clear from the discussion; optionally, to change the reason for closing the issue, click the arrow next to "Close issue" and select a reason;
128+
- if you have the rights to do so, simply [close the issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/closing-an-issue), add a label to specify the reason (e.g. "r: duplicate") and maybe add a short comment explaining why the issue has been closed, if that's not already clear from the discussion; optionally, to change the reason for closing the issue, click the arrow next to "Close issue" and select a reason;
129129
- otherwise, add a short comment indicating that you think the issue should be closed and someone else with the necessary rights will take care of this.
130130
131131
> If you think an issue has been prematurely be closed, feel free to reopen it.

migrate.cfg.sagetracmigrationarchive

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ keywords_to_labels: {
6262
'elliptic curves': 'c: elliptic curves',
6363
'manifold': 'c: manifolds',
6464
'manifolds': 'c: manifolds',
65-
'memory leak': 'memleak',
66-
'memleak': 'memleak',
65+
'memory leak': 't: bug',
66+
'memleak': 't: bug',
6767
'number field': 'c: number fields',
6868
'number fields': 'c: number fields',
6969
'database': 'c: databases',
70-
'doctest': 'doctest coverage',
71-
'doctests': 'doctest coverage',
72-
'coverage': 'doctest coverage',
73-
'performance': 'performance',
70+
'doctest': 't: tests',
71+
'doctests': 't: tests',
72+
'coverage': 't: tests',
73+
'performance': 't: performance',
7474
'game theory': 'c: game theory',
7575
'geometry': 'c: geometry',
7676
'graph': 'c: graph theory',
@@ -109,12 +109,12 @@ migrate_milestones: yes
109109

110110
# Map for certain Trac milestones to GitHub labels
111111
milestones_to_labels = {
112-
'sage-duplicate/invalid/wontfix': 'invalid',
113-
'sage-duplicate/invalid': 'invalid',
114-
'sage-duplicate': 'duplicate',
115-
'sage-wait': 'pending',
116-
'sage-pending': 'pending',
117-
'sage-feature': 'feature',
112+
'sage-duplicate/invalid/wontfix': 'r: invalid',
113+
'sage-duplicate/invalid': 'r: invalid',
114+
'sage-duplicate': 'r: duplicate',
115+
'sage-wait': 's: pending',
116+
'sage-pending': 's: pending',
117+
'sage-feature': 't: feature',
118118
'sage-wishlist': 'wishlist item',
119119
'sage-combinat': 'c: combinatorics',
120120
'sage-symbolics': 'c: symbolics',
@@ -154,13 +154,12 @@ components_to_labels = {
154154
# Tiny components, merge into something larger
155155
'linbox': 'c: packages: standard',
156156
'givaro': 'c: packages: standard',
157-
# No "c: " prefix for these:
158-
'doctest': 'doctest coverage',
159-
'doctests': 'doctest coverage',
160-
'doctest coverage': 'doctest coverage',
161-
'memleak': 'memleak',
162-
'performance': 'performance',
163-
'refactoring': 'refactoring',
157+
'doctest': 't: tests',
158+
'doctests': 't: tests',
159+
'doctest coverage': 't: tests',
160+
'memleak': 't: bug',
161+
'performance': 't: performance',
162+
'refactoring': 't: refactoring',
164163
# Suppress
165164
'misc': None}
166165

@@ -198,10 +197,10 @@ label_colors = {
198197
'c: scripts': '0000b0',
199198
'c: spkg-check': '0000b0',
200199
'c: user interface': '0000b0',
201-
'needs work': 'ffff00',
202-
'needs info': 'ffff00',
203-
'needs review': '7fff00',
204-
'positive review': 'dfffc0',
200+
's: needs work': 'ffff00',
201+
's: needs info': 'ffff00',
202+
's: needs review': '7fff00',
203+
's: positive review': 'dfffc0',
205204
'help wanted': '008672',
206205
'p: blocker / 1': 'ff0000',
207206
'p: critical / 2': 'ff7700',
@@ -210,12 +209,11 @@ label_colors = {
210209
'p: trivial / 5': 'fff9e5',
211210
'wishlist item': 'e81ff9',
212211
'good first issue': '7057ff',
213-
'bug': 'd73a4a',
214-
'memleak': 'd73a4a',
215-
'enhancement': '696969',
216-
'performance': '696969',
217-
'refactoring': '696969',
218-
'doctest coverage': '696969',
212+
't: bug': 'd73a4a',
213+
't: enhancement': '696969',
214+
't: performance': '696969',
215+
't: refactoring': '696969',
216+
't: tests': '696969',
219217
'resolution': 'c6c6c6'}
220218

221219
# values to be ignored on issue conversion

migrate.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,9 +1593,9 @@ def map_tickettype(tickettype):
15931593
if not tickettype:
15941594
return None
15951595
if tickettype == 'defect':
1596-
return 'bug'
1596+
return 't: bug'
15971597
if tickettype == 'enhancement':
1598-
return 'enhancement'
1598+
return 't: enhancement'
15991599
# if tickettype == 'clarification':
16001600
# return 'question'
16011601
# if tickettype == 'task':
@@ -1650,7 +1650,7 @@ def map_status(status):
16501650
"Return a pair: (status, label)"
16511651
status = status.lower()
16521652
if status in ['needs_review', 'needs_work', 'needs_info', 'positive_review']:
1653-
return 'open', status.replace('_', ' ')
1653+
return 'open', 's: ' + status.replace('_', ' ')
16541654
elif status in ['', 'new', 'assigned', 'analyzed', 'reopened', 'open', 'needs_info_new']:
16551655
return 'open', None
16561656
elif status in ['closed'] :
@@ -1921,11 +1921,11 @@ def gh_comment_issue(dest, issue, comment, src_ticket_id, comment_id=None, minim
19211921
priority_labels = set(map_priority(priority)
19221922
for priority in ['trivial', 'minor', 'major', 'critical', 'blocker'])
19231923
def normalize_labels(dest, labels):
1924-
if 'invalid' in labels:
1925-
if any(x in labels for x in ['duplicate', 'invalid', 'wontfix', 'worksforme']):
1924+
if 'r: invalid' in labels:
1925+
if any(x in labels for x in ['r: duplicate', 'r: invalid', 'r: wontfix', 'r: worksforme']):
19261926
# Remove in favor of the more specific label.
1927-
labels.remove('invalid')
1928-
if any(x in labels for x in ['duplicate', 'invalid', 'wontfix', 'worksforme']):
1927+
labels.remove('r: invalid')
1928+
if any(x in labels for x in ['r: duplicate', 'r: invalid', 'r: wontfix', 'r: worksforme']):
19291929
labels = sorted(set(labels).difference(priority_labels))
19301930
return labels
19311931

0 commit comments

Comments
 (0)