Skip to content

Conversation

@superbuggy
Copy link
Contributor

@superbuggy superbuggy commented Sep 25, 2025

When closed trackers are unembargoed, with this PR their security levels will be updated instead of being passed over due to being closed.

Closes OSIDB-3729

@superbuggy superbuggy requested a review from a team September 25, 2025 17:40
Copy link
Contributor

@Jincxz Jincxz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A suggestion: I think there can be tests written, probably in the endpoints directory, to test that we can un-embargo closed trackers.

Copy link
Contributor

@JakubFrejlach JakubFrejlach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this approach will achieve the desired outcome.

Comment on lines 1284 to 1287
embargo_status_changed = differ(
old_affect.flaw, new_affect.flaw, ["is_embargoed", "unembargo_dt"]
)
if tracker.is_closed and not embargo_status_changed:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the correct solution for this problem. First, I don't understand why unembargo_dt is taken into account here as it can change multiple times, we are really interested here only about the actual unembargo process. Second, I am looking at the Jira issue description and it states that the only update which should really apply in this case is the security level change (aka unembargo), nothing else. Current implementation will propagate the update to a CLOSED Tracker in Jira during unembargo process but will propagate any changes which would have been made so far between the Tracker becoming CLOSED and the unembargo action.

@superbuggy
Copy link
Contributor Author

A suggestion: I think there can be tests written, probably in the endpoints directory, to test that we can un-embargo closed trackers.
Good point, I wasn't sure how to test the JIRA/jiraffe portion, so I opted to do a manual test, but maybe there is a way to test the security_level field as well?

@Jincxz
Copy link
Contributor

Jincxz commented Oct 1, 2025

It looks like the JIRA convertor translates the security field to a LDAP group (link to code) which I believe dictates whether the tracker is embargoed. The JIRA tracker can be converted into a OSIDB Tracker and tested as such (example).

@superbuggy superbuggy force-pushed the OSIDB-3729-update-sl-on-closed-tracker-unembargo branch from 0a24716 to a1801d1 Compare October 2, 2025 14:10
@superbuggy superbuggy force-pushed the OSIDB-3729-update-sl-on-closed-tracker-unembargo branch from a1801d1 to 3695c7e Compare October 2, 2025 14:12
@superbuggy
Copy link
Contributor Author

It looks like the JIRA convertor translates the security field to a LDAP group...

Super helpful, thank you. How does it look now?

@superbuggy superbuggy self-assigned this Oct 2, 2025
@Jincxz
Copy link
Contributor

Jincxz commented Oct 2, 2025

I believe that @JakubFrejlach's comment is still applicable. Changes that happen to the Tracker between it being closed and unembargoed might go through.

Example:

  1. Embargoed Tracker is closed
  2. Tracker is edited with change A and the related Flaw is set to be unembargoed
  3. Save occurs and the Tracker becomes unembargoed but also gets change A

Some condition would need to be in place to make sure only the unembargo happens.

Copy link
Contributor

@JakubFrejlach JakubFrejlach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As already pointed out by @Jincxz, this still does not fully address the issue requirements.

@superbuggy superbuggy force-pushed the OSIDB-3729-update-sl-on-closed-tracker-unembargo branch 2 times, most recently from 9c6023e to 2b8e92b Compare October 6, 2025 15:40
@superbuggy superbuggy force-pushed the OSIDB-3729-update-sl-on-closed-tracker-unembargo branch 2 times, most recently from 23f82f8 to 6c5c1f6 Compare October 30, 2025 14:00
Copy link
Contributor

@JakubFrejlach JakubFrejlach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of minor things but othewise LGTM now!


def generate_only_security(self):
self.generate_base()
self._query["fields"]["security"] = None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not necessary since you are now generating the base on the previous line, generate_security will eventually se this if necessary.

self._query["fields"]["security"] = {
"name": JIRA_EMBARGO_SECURITY_LEVEL_NAME
}
print(f" QUERY is: {self._query}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug print statement?

"""

self.generate_base()
self._query["fields"]["security"] = None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not necessary since you are now generating the base on the previous line, generate_security will eventually se this if necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah I think some stuff crept in from a stash I popped

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is still relevant (generate_only_embargo_and_security_level) but otherwise LGTM.

"""
builder = self.get_builder()
query = builder(tracker).query
built_query = builder(tracker)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

variable contains instantiated builder, not a query, so a think the name is misleading

Comment on lines 1305 to 1306
# no tracker updates for the closed ones
# because we consider these already done
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also update this comment so it reflects the current status - no tracker updates for the closed ones with the exception of the security level

Comment on lines 2256 to 2257
# no tracker updates for the closed ones
# because we consider these already done
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also update this comment so it reflects the current status - no tracker updates for the closed ones with the exception of the security level

Update changelog

Fix logic to exclude undesired behavior

Add test

Improve test

Remove unused imports

Update secrets

Prevent non-security closed tracker fields form being altered

Fix bug

Improve organization

Improve tests

Fix tests and linting

Clean up loose ends
@superbuggy superbuggy force-pushed the OSIDB-3729-update-sl-on-closed-tracker-unembargo branch from 6c5c1f6 to c3dbc3d Compare October 30, 2025 15:35
@superbuggy superbuggy added this pull request to the merge queue Oct 31, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants