Skip to content

Commit 1a7c783

Browse files
committed
Remove unused ReleaseBlock custom field handling.
1 parent 1f55ab1 commit 1a7c783

File tree

2 files changed

+0
-224
lines changed

2 files changed

+0
-224
lines changed

src/clusterfuzz/_internal/issue_management/google_issue_tracker/issue_tracker.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
# These custom fields use repeated enums.
3939
_CHROMIUM_OS_CUSTOM_FIELD_ID = '1223084'
4040
_CHROMIUM_COMPONENT_TAGS_CUSTOM_FIELD_ID = '1222907'
41-
_CHROMIUM_RELEASE_BLOCK_CUSTOM_FIELD_ID = '1223086'
4241

4342
_OSS_FUZZ_REPORTED_CUSTOM_FIELD_ID = '1349561'
4443
_OSS_FUZZ_PROJECT_CUSTOM_FIELD_ID = '1349507'
@@ -483,17 +482,6 @@ def _os_custom_field_values(self) -> List[str]:
483482
return enum_values.get('values') or []
484483
return []
485484

486-
@property
487-
def _releaseblock_custom_field_values(self):
488-
"""ReleaseBlock custom field values."""
489-
custom_fields = self._data['issueState'].get('customFields', [])
490-
for cf in custom_fields:
491-
if cf.get('customFieldId') == _CHROMIUM_RELEASE_BLOCK_CUSTOM_FIELD_ID:
492-
enum_values = cf.get('repeatedEnumValue')
493-
if enum_values:
494-
return enum_values.get('values') or []
495-
return []
496-
497485
@property
498486
def _foundin_versions(self):
499487
"""FoundIn versions."""
@@ -612,21 +600,6 @@ def _update_issue(self, new_comment=None, notify=True):
612600
# hotlist IDs.
613601
self.labels.remove_by_prefix('OS-')
614602

615-
# Special case ReleaseBlock custom field.
616-
added_releaseblocks = _get_labels(self.labels.added, 'ReleaseBlock-')
617-
if added_releaseblocks:
618-
releaseblocks = self._releaseblock_custom_field_values
619-
releaseblocks.extend(added_releaseblocks)
620-
custom_field_entries.append({
621-
'customFieldId': _CHROMIUM_RELEASE_BLOCK_CUSTOM_FIELD_ID,
622-
'repeatedEnumValue': {
623-
'values': releaseblocks,
624-
}
625-
})
626-
# Remove all ReleaseBlock labels or they will be attempted to be added as
627-
# hotlist IDs.
628-
self.labels.remove_by_prefix('ReleaseBlock-')
629-
630603
# Special case: OSS-Fuzz "Reported" custom field.
631604
added_reported = _get_oss_fuzz_reported_value(self.labels)
632605
if added_reported:
@@ -765,14 +738,6 @@ def save(self, new_comment=None, notify=True, skip_emails=[]): # pylint: disabl
765738
'values': oses,
766739
},
767740
})
768-
releaseblocks = _extract_all_labels(self.labels, 'ReleaseBlock-')
769-
if releaseblocks:
770-
custom_field_entries.append({
771-
'customFieldId': _CHROMIUM_RELEASE_BLOCK_CUSTOM_FIELD_ID,
772-
'repeatedEnumValue': {
773-
'values': releaseblocks
774-
},
775-
})
776741

777742
# Special case: OSS-Fuzz "Reported" custom field.
778743
added_reported = _get_oss_fuzz_reported_value(self.labels)

src/clusterfuzz/_internal/tests/appengine/libs/issue_management/google_issue_tracker/google_issue_tracker_test.py

Lines changed: 0 additions & 189 deletions
Original file line numberDiff line numberDiff line change
@@ -314,78 +314,6 @@ def test_new_issue_with_limit_view_label(self):
314314
mock.call().execute(http=None, num_retries=3),
315315
])
316316

317-
def test_new_issue_with_os_foundin_releaseblock_labels(self):
318-
"""Test new issue creation with os, foundin, releaseblock labels."""
319-
issue = self.issue_tracker.new_issue()
320-
issue.reporter = '[email protected]'
321-
issue.assignee = '[email protected]'
322-
issue.body = 'issue body'
323-
issue.ccs.add('[email protected]')
324-
issue.labels.add('12345')
325-
issue.labels.add('OS-Linux')
326-
issue.labels.add('OS-Android')
327-
issue.labels.add('FoundIn-123')
328-
issue.labels.add('FoundIn-789')
329-
issue.labels.add('ReleaseBlock-Dev')
330-
issue.labels.add('ReleaseBlock-Beta')
331-
issue.status = 'ASSIGNED'
332-
issue.title = 'issue title'
333-
issue.save()
334-
self.client.issues().create.assert_has_calls([
335-
mock.call(
336-
body={
337-
'issueState': {
338-
'componentId':
339-
1337,
340-
'ccs': [{
341-
'emailAddress': '[email protected]'
342-
}],
343-
'collaborators': [],
344-
'hotlistIds': [12345],
345-
'accessLimit': {
346-
'accessLevel': issue_tracker.IssueAccessLevel.LIMIT_NONE
347-
},
348-
'reporter': {
349-
'emailAddress': '[email protected]'
350-
},
351-
'assignee': {
352-
'emailAddress': '[email protected]'
353-
},
354-
'status':
355-
'ASSIGNED',
356-
'title':
357-
'issue title',
358-
'type':
359-
'BUG',
360-
'customFields': [
361-
{
362-
'customFieldId': '1223084',
363-
'repeatedEnumValue': {
364-
'values': ['Android', 'Linux']
365-
}
366-
},
367-
{
368-
'customFieldId': '1223086',
369-
'repeatedEnumValue': {
370-
'values': ['Dev', 'Beta']
371-
}
372-
},
373-
],
374-
'foundInVersions': ['123', '789'],
375-
'severity':
376-
'S4',
377-
'priority':
378-
'P4',
379-
},
380-
'issueComment': {
381-
'comment': 'issue body'
382-
},
383-
},
384-
templateOptions_applyTemplate=True,
385-
),
386-
mock.call().execute(http=None, num_retries=3),
387-
])
388-
389317
def test_new_issue_with_empty_os_label(self):
390318
"""Test new issue creation with "empty" OS label."""
391319
issue = self.issue_tracker.new_issue()
@@ -653,123 +581,6 @@ def test_update_issue(self):
653581
mock.call().execute(http=None, num_retries=3),
654582
])
655583

656-
def test_update_issue_with_os_foundin_releaseblock_labels(self):
657-
"""Test updating an existing issue with OS and FoundIn labels."""
658-
self.client.issues().get().execute.return_value = {
659-
'issueId': '68828938',
660-
'issueState': {
661-
'componentId':
662-
'29002',
663-
'type':
664-
'BUG',
665-
'customFields': [
666-
{
667-
'customFieldId': '1223084',
668-
'repeatedEnumValue': {
669-
'values': ['Linux'] # Existing OS-Linux.
670-
},
671-
},
672-
{
673-
'customFieldId': '1223086',
674-
'repeatedEnumValue': {
675-
'values': ['Dev'] # Existing ReleaseBlock-Dev.
676-
},
677-
},
678-
],
679-
'status':
680-
'NEW',
681-
'priority':
682-
'P2',
683-
'severity':
684-
'S2',
685-
'title':
686-
'test',
687-
'reporter': {
688-
'emailAddress': '[email protected]',
689-
'userGaiaStatus': 'ACTIVE'
690-
},
691-
'assignee': {
692-
'emailAddress': '[email protected]',
693-
'userGaiaStatus': 'ACTIVE'
694-
},
695-
'retention':
696-
'COMPONENT_DEFAULT',
697-
'foundInVersions': ['123'], # Existing FoundIn-123.
698-
},
699-
'createdTime': '2019-06-25T01:29:30.021Z',
700-
'modifiedTime': '2019-06-25T01:29:30.021Z',
701-
'userData': {},
702-
'accessLimit': {
703-
'accessLevel': 'INTERNAL'
704-
},
705-
'etag': 'TmpnNE1qZzVNemd0TUMweA==',
706-
'lastModifier': {
707-
'emailAddress': '[email protected]',
708-
'userGaiaStatus': 'ACTIVE'
709-
},
710-
}
711-
issue = self.issue_tracker.get_issue(68828938)
712-
issue.reporter = '[email protected]'
713-
issue.assignee = '[email protected]'
714-
issue.ccs.add('[email protected]')
715-
issue.labels.add('12345')
716-
issue.status = 'ASSIGNED'
717-
issue.title = 'issue title2'
718-
# Adding OS Android here (in addition to the Linux already set).
719-
issue.labels.add('OS-Android')
720-
# Adding FoundIn 789 here (in addition to the 123 already set).
721-
issue.labels.add('FoundIn-789')
722-
# Adding ReleaseBlock Beta and Stable (in addition to Dev already set).
723-
issue.labels.add('ReleaseBlock-Beta')
724-
issue.labels.add('ReleaseBlock-Stable')
725-
issue.save()
726-
727-
self.client.issues().modify.assert_has_calls([
728-
mock.call(
729-
issueId='68828938',
730-
body={
731-
'add': {
732-
'status':
733-
'ASSIGNED',
734-
'assignee': {
735-
'emailAddress': '[email protected]'
736-
},
737-
'reporter': {
738-
'emailAddress': '[email protected]'
739-
},
740-
'title':
741-
'issue title2',
742-
'ccs': [{
743-
'emailAddress': '[email protected]'
744-
}],
745-
'customFields': [
746-
{
747-
'customFieldId': '1223084',
748-
'repeatedEnumValue': {
749-
'values': ['Android', 'Linux']
750-
}
751-
},
752-
{
753-
'customFieldId': '1223086',
754-
'repeatedEnumValue': {
755-
'values': ['Dev', 'Beta', 'Stable']
756-
}
757-
},
758-
],
759-
'foundInVersions': ['123', '789'],
760-
},
761-
'addMask':
762-
'status,assignee,reporter,title,ccs,customFields,foundInVersions',
763-
'remove': {},
764-
'removeMask':
765-
'',
766-
'significanceOverride':
767-
'MAJOR',
768-
},
769-
),
770-
mock.call().execute(http=None, num_retries=3),
771-
])
772-
773584
def test_update_issue_with_empty_os(self):
774585
"""Test updating an existing issue with an "empty" OS label."""
775586
self.client.issues().get().execute.return_value = {

0 commit comments

Comments
 (0)