Skip to content

Commit ca3c5a7

Browse files
Craig Corneliussven-oly
authored andcommitted
ICU-23056 Update "scrub issues" miscellaneous.md
This describes the new script for finding issues marked "done" but that that haven't had comments updated in test code.
1 parent 127df50 commit ca3c5a7

File tree

1 file changed

+83
-2
lines changed

1 file changed

+83
-2
lines changed

docs/processes/release/tasks/miscellaneous.md

Lines changed: 83 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,92 @@ a model.
139139
140140
## Scrub closed issues in code
141141
142+
ICU and CLDR issues are tracked with the [Unicode JIRA tool](https://unicode-org.atlassian.net/jira/dashboards/last-visited). Each open issue should be indicated in code with either "TODO" or "knownIssue" as a comment that includes the JIRA identifier.
143+
144+
Sometimes an issue has been marked as "done" without updating the "TODO" or "knownIssue" item in the code or test routines. This step is used to synchronize the issue database and the code.
145+
146+
The idea is simple:
147+
142148
(1) Search for "TODO(12345)" to detect TODO items for closed issues.
143149
144150
(2) Do the same for logKnownIssue. (the data related logKnownIssues are often
145151
addressed during CLDR data integration)
146152
147-
If the TODO or logKnownIssue references a closed issue, if the problem is fixed,
148-
remove the TODO/logKnownIssue, or if the problem is not fixed, open a new issue
153+
(3) For each TODO or logKnownIssue that is marked as "done", check the status:
154+
* If the problem is fixed,remove the TODO/logKnownIssue.
155+
* If the problem is not fixed, either reopen the issue or create a new issue
149156
and update the reference in the code.
157+
* Communicate problems with the Unicode tech team.
158+
159+
> [!NOTE]
160+
> New in ICU78: Finding issues is automated with a python script in
161+
icu/tools/scripts/scrub_issues. Here's how:
162+
163+
1. Install the python jira module, e.g., `pip install jira`. See [pypi.org.project/jira](https://pypi.org/project/jira/).
164+
2. Get the latest version of ICU code in local directory, e.g., ~/newICU.
165+
3. Execute the script from the scrub_issues directory with the ICU code path:
166+
```
167+
# In the new ICU directory
168+
cd icu/tools/scripts/scrub_issues/scrub_issues.py
169+
python scrub_issues.py --icu_base ~/newICU/icu |& tee new_scrub_results.txt
170+
```
171+
4. Examine each line of the "Closed ids" section of the output file:
172+
* Try removing the code that prevents tests from failing in the lines for each of the "knownIssue" and "TODO" items.
173+
* If a modified test passes, update the code in the Github repository.
174+
* After merging changes, synch with the repository. Then rerun the python script to verify that the status is updated.
175+
176+
By default, the script reports all instances of each TODO or knownIssue by file and line number in that file.
177+
178+
### Possible closed issues: update the comments
179+
```
180+
INFO:scrub issues:----------------------------------------------------------------
181+
INFO:scrub issues:2 Closed ids: ['ICU-23185', 'CLDR-18905']
182+
INFO:scrub issues: ['CLDR-18905', 'logKnownIssue', '/icu/icu4j/main/common_tests/src/test/java/com/ibm/icu/dev/test/format/MeasureUnitTest.java', 529]
183+
INFO:scrub issues: ['CLDR-18905', 'logKnownIssue', '/icu/icu4c/source/test/intltest/measfmttest.cpp', 5529]
184+
INFO:scrub issues: ['CLDR-18905', 'logKnownIssue', '/icu/icu4c/source/test/intltest/measfmttest.cpp', 5956]
185+
INFO:scrub issues: ['ICU-23185', 'logKnownIssue', '/icu/icu4j/main/core/src/test/java/com/ibm/icu/dev/test/format/DateIntervalFormatTest.java', 895]
186+
INFO:scrub issues: ['ICU-23185', 'logKnownIssue', '/icu/icu4j/main/core/src/test/java/com/ibm/icu/dev/test/format/DateIntervalFormatTest.java', 900]
187+
INFO:scrub issues: ['ICU-23185', 'logKnownIssue', '/icu/icu4c/source/test/intltest/dtifmtts.cpp', 1255]
188+
INFO:scrub issues: ['ICU-23185', 'logKnownIssue', '/icu/icu4c/source/test/intltest/dtifmtts.cpp', 1262]
189+
```
190+
191+
### Non-standard identifiers. Issues not in JIRA
192+
193+
This script also finds commented lines that are not named with either "ICU-" or "CLDR-" plus a number. Often these are very old issues that may have been resolved without updating the code.
194+
195+
Sometimes just an indentifier that is simple a number is found. In these cases, the script checks if there is a JIRA issue with either prefix and that number.
196+
Consider updating the test code with the full identifier. In that case "REPLACEMENT" is shown.
197+
198+
Examples:
199+
200+
```
201+
INFO:root:Base Directory: /usr/local/google/home/ccornelius/ICU78-new/icu
202+
INFO:scrub issues:----------------------------------------------------------------
203+
INFO:scrub issues: ['knownIssue', 'logKnownIssue', '/icu/icu4j/main/core/src/test/java/com/ibm/icu/dev/test/format/PersonNameConsistencyTest.java', 89]
204+
INFO:scrub issues: ['knownIssue', 'logKnownIssue', '/icu/icu4j/main/core/src/test/java/com/ibm/icu/dev/test/format/PersonNameConsistencyTest.java', 99]
205+
INFO:scrub issues:REPLACEMENT 22099 --> ICU-22099 (Accepted)
206+
INFO:scrub issues: ['22099', 'logKnownIssue', '/icu/icu4j/main/core/src/test/java/com/ibm/icu/dev/test/number/ExhaustiveNumberTest.java', 61]
207+
INFO:scrub issues: ['a/b/c', 'logKnownIssue', '/icu/icu4j/main/core/src/test/java/com/ibm/icu/dev/test/TestUnicodeKnownIssues.java', 25]
208+
INFO:scrub issues: ['a/b/c', 'logKnownIssue', '/icu/icu4j/main/core/src/test/java/com/ibm/icu/dev/test/TestUnicodeKnownIssues.java', 37]
209+
...
210+
INFO:scrub issues: ['String ticket', 'logKnownIssue', '/icu/icu4j/main/framework/src/test/java/com/ibm/icu/dev/test/TestFmwk.java', 198]
211+
WARNING:scrub issues:Not in JIRA : "Tom" (1 instances)
212+
INFO:scrub issues: ['Tom', 'TODO', '/icu/icu4j/main/core/src/main/java/com/ibm/icu/impl/SimpleFilteredSentenceBreakIterator.java', 32]
213+
WARNING:scrub issues:Not in JIRA : "a/b/c" (7 instances)
214+
INFO:scrub issues: ['a/b/c', 'logKnownIssue', '/icu/icu4j/main/core/src/test/java/com/ibm/icu/dev/test/TestUnicodeKnownIssues.java', 25]
215+
INFO:scrub issues: ['a/b/c', 'logKnownIssue', '/icu/icu4j/main/core/src/test/java/com/ibm/icu/dev/test/TestUnicodeKnownIssues.java', 37]
216+
INFO:scrub issues: ['a/b/c', 'logKnownIssue', '/icu/icu4j/main/core/src/test/java/com/ibm/icu/dev/test/TestUnicodeKnownIssues.java', 54]
217+
...
218+
```
219+
220+
Finally, the script reports all issues that have JIRA entries with status 'Accepted' or 'Design', showing the instances in code:
221+
222+
```
223+
INFO:scrub issues:Unresolved IDS: 57 still not "Done" in Jira
224+
...
225+
INFO:scrub issues:id: ['13034', 'Accepted']
226+
INFO:scrub issues: ['13034', 'TODO', '/icu/icu4c/source/test/intltest/numfmtst.cpp', 8613]
227+
INFO:scrub issues: ['13034', 'TODO', '/icu/icu4c/source/i18n/number_padding.cpp', 32]
228+
```
229+
230+
It is recommended to review such unresolved issues periodically.

0 commit comments

Comments
 (0)