Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion collectors/jiraffe/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
)

TASK_CHANGELOG_FIELD_MAPPING = {
"assignee": ["owner"],
"status": ["workflow_name", "workflow_state"],
"resolution": ["workflow_name", "workflow_state"],
}
Expand Down
19 changes: 0 additions & 19 deletions collectors/jiraffe/convertors.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from apps.workflows.workflow import WorkflowFramework
from osidb.core import generate_acls, set_user_acls
from osidb.models import Flaw, Tracker
from osidb.models.jira_user_mapping import JiraUserMapping
from osidb.validators import CVE_RE_STR

from ..utils import (
Expand Down Expand Up @@ -65,14 +64,10 @@ def _normalize(self) -> dict:
status = self.get_field_attr(self._raw, "status", "name")
resolution = self.get_field_attr(self._raw, "resolution", "name")
workflow, state = WorkflowFramework().jira_to_state(status, resolution)
assignee_cloud_id = self.get_field_attr(self._raw, "assignee", "accountId")

return {
"external_system_id": self._raw.key,
"labels": self._raw.fields.labels,
"owner": f"{JiraUserMapping.cloud_id_to_kerberos(assignee_cloud_id)}@redhat.com"
if assignee_cloud_id
else "",
"jira_status": status,
"jira_resolution": resolution,
"workflow_state": state,
Expand Down Expand Up @@ -180,7 +175,6 @@ def save(self):
task_attributes = [
"task_key",
"task_updated_dt",
"owner",
# the ACLs are not really directly fetched but can
# get modified due to state or resolution changes
"acl_read",
Expand Down Expand Up @@ -423,23 +417,10 @@ def _normalize(self) -> dict:
self._raw.fields.resolutiondate, JIRA_DT_FULL_FMT
)

assignee_cloud_id = self.get_field_attr(self._raw, "assignee", "accountId")
qe_cloud_id = self.get_field_attr(
self._raw, "customfield_12316243", "accountId"
)

return {
"jira_issuetype": self.get_field_attr(self._raw, "issuetype", "name"),
"external_system_id": self._raw.key,
"labels": json.dumps(self._raw.fields.labels),
"owner": JiraUserMapping.cloud_id_to_kerberos(assignee_cloud_id)
if assignee_cloud_id
else "",
# QE Assignee corresponds to customfield_12316243
# in RH Jira which is a field of schema type user
"qe_owner": JiraUserMapping.cloud_id_to_kerberos(qe_cloud_id)
if qe_cloud_id
else "",
"ps_module": ps_module,
"ps_component": ps_component,
"ps_update_stream": ps_update_stream,
Expand Down
4 changes: 0 additions & 4 deletions collectors/jiraffe/tests/test_collectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
from osidb.tests.factories import (
AffectFactory,
FlawFactory,
JiraUserMappingFactory,
PsModuleFactory,
PsUpdateStreamFactory,
TrackerFactory,
Expand Down Expand Up @@ -121,8 +120,6 @@ def test_update_only_changed_fields(self, enable_jira_task_sync, jira_token):

@pytest.mark.vcr
def test_link_on_cve(self):
# some random UUID
JiraUserMappingFactory(atlassian_cloud_id="test-cloud-id")
flaw = FlawFactory(cve_id="CVE-2024-34703")
# this is super-unprobable to happen but based
# on the review feedback I am adding the assert
Expand Down Expand Up @@ -568,7 +565,6 @@ def test_sync_task_links_affects_when_tracker_up_to_date(self, monkeypatch):
Regression: when Jira tracker data is up-to-date (convertor returns None),
sync_task should still link affects for an existing tracker.
"""
JiraUserMappingFactory(atlassian_cloud_id="test-cloud-id")
tracker_id = "RHEL-159920"
ps_module = PsModuleFactory(name="module", bts_name="jboss")
ps_update_stream = PsUpdateStreamFactory(name="stream", ps_module=ps_module)
Expand Down
6 changes: 0 additions & 6 deletions collectors/jiraffe/tests/test_convertors.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from osidb.tests.factories import (
AffectFactory,
FlawFactory,
JiraUserMappingFactory,
PsModuleFactory,
PsUpdateStreamFactory,
)
Expand Down Expand Up @@ -392,9 +391,6 @@ def test_ps_update_stream_and_component_syncing(
mock_issue.fields.created = "2026-01-01T00:00:00.000+0000"
mock_issue.fields.updated = "2026-01-01T00:00:00.000+0000"
mock_issue.fields.resolutiondate = None
mock_issue.fields.assignee = None
mock_issue.fields.customfield_12316243 = None

convertor = JiraTrackerConvertor(mock_issue)

assert convertor.ps_update_stream == "test-stream"
Expand All @@ -414,7 +410,6 @@ def test_convert(self):
"""
test that the convertor works
"""
mapping = JiraUserMappingFactory(atlassian_cloud_id="test-cloud-id")
task_data = JiraQuerier().get_issue(self.task_id, expand="changelog")
task_convertor = JiraTaskConvertor(task_data)

Expand Down Expand Up @@ -442,4 +437,3 @@ def test_convert(self):
)
assert flaw.workflow_name == "DEFAULT"
assert flaw.workflow_state == "TRIAGE"
assert flaw.owner == f"{mapping.associate_kerberos_id}@redhat.com"
3 changes: 3 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Affect(s) can be automatically created and assigned to Flaw(s) for
specific products (OSIDB-4878)

### Removed
- Remove `owner` and `qe_owner` parsing from Jira Tracker and Task download to prevent tracker sync failure(OSIDB-4875)

## [5.9.0] - 2026-04-09
### Fixed
- Fix invalid `in` field in kerberos OpenAPI security scheme (OSIDB-1590)
Expand Down
Loading