Leave downstream assignment to owner when upstream is clear#380
Merged
Leave downstream assignment to owner when upstream is clear#380
Conversation
9148ebe to
db4f442
Compare
db4f442 to
060fb67
Compare
ralphbean
approved these changes
Oct 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, if an upstream issue is unassigned, then the downstream issue will be assigned to the project "owner" if one is configured. However, if the upstream issue is updated, and the project is configured to overwrite assignments, then downstream issues assignment will be cleared if the upstream issue is unassigned. This results in an unstable behavior where the downstream issue is alternately assigned to the project owner and then unassigned on each upstream update.
This PR splits the overwrite case from two options to three:
assign_user()unconditionally, andassign_user(), unless the assignments still match; however,assign_user()only if the downstream issue is not assigned to the project owner.This should produce a stable behavior.
This PR also tweaks the log message displayed when we cannot assign the downstream issue so that it shows the upstream assignee's login name if they don't have a "display name".
And, this PR updates the unit test for
_update_assignee():tryblock wrapped around the test assertions (the assertions themselves are otherwise unchanged).Because the CUT is largely a sequence of boolean expressions rather than branches, all of the statements are executed regardless of the input values, and so only a small set of inputs is required to produce "full coverage"; nevertheless, without testing the full range of inputs, we cannot ensure the proper outputs in all possible cases. So, strictly speaking, the changes to the unit test do not increase the (measured) coverage (Coveralls reports the coverage as increased because I added more lines (which are covered) and not because the improved test covers previously uncovered lines).