-
Notifications
You must be signed in to change notification settings - Fork 11
Update closed trackers if unembargoed #1071
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Update closed trackers if unembargoed #1071
Conversation
There was a problem hiding this 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.
There was a problem hiding this 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.
osidb/serializer.py
Outdated
| embargo_status_changed = differ( | ||
| old_affect.flaw, new_affect.flaw, ["is_embargoed", "unembargo_dt"] | ||
| ) | ||
| if tracker.is_closed and not embargo_status_changed: |
There was a problem hiding this 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 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.
|
|
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). |
0a24716 to
a1801d1
Compare
a1801d1 to
3695c7e
Compare
Super helpful, thank you. How does it look now? |
|
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:
Some condition would need to be in place to make sure only the unembargo happens. |
There was a problem hiding this 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.
9c6023e to
2b8e92b
Compare
23f82f8 to
6c5c1f6
Compare
There was a problem hiding this 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!
apps/trackers/jira/query.py
Outdated
|
|
||
| def generate_only_security(self): | ||
| self.generate_base() | ||
| self._query["fields"]["security"] = None |
There was a problem hiding this comment.
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.
apps/trackers/jira/query.py
Outdated
| self._query["fields"]["security"] = { | ||
| "name": JIRA_EMBARGO_SECURITY_LEVEL_NAME | ||
| } | ||
| print(f" QUERY is: {self._query}") |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
apps/trackers/jira/save.py
Outdated
| """ | ||
| builder = self.get_builder() | ||
| query = builder(tracker).query | ||
| built_query = builder(tracker) |
There was a problem hiding this comment.
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
osidb/serializer.py
Outdated
| # no tracker updates for the closed ones | ||
| # because we consider these already done |
There was a problem hiding this comment.
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
osidb/serializer.py
Outdated
| # no tracker updates for the closed ones | ||
| # because we consider these already done |
There was a problem hiding this comment.
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
6c5c1f6 to
c3dbc3d
Compare
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