Add EE scope to IssuableLink concern
The following discussion from !80499 (merged) should be addressed:
-
@felipe_artur started a discussion: (+6 comments) The code above looks right. I think you should test using
IssueLink.inverse_link_type('blocks')
instead ofIssuableLink.inverse_link_type('blocks')
If you test using
FOSS_ONLY
console you will get the correct results:$ FOSS_ONLY=1 rails c Loading development environment (Rails 6.1.4.4) [1] pry(main)> IssueLink.inverse_link_type('blocks') => "blocks"
$ rails c Loading development environment (Rails 6.1.4.4) [1] pry(main)> IssueLink.inverse_link_type('blocks') > => "is_blocked_by"
We will need an
ee
version ofinverse_link_type
forEpic::RelatedEpicLink
too but maybe we can attempt in a follow-up.I don't think we need to unless
blocked
andblocked_by
relationship changes for epic links. I suppose this won't happen right? In this case we can keep that method only on concerns.I am ok if you think it is better to do these changes in a follow-up and keep this MR more related to database changes.
Also, there is another follow-up I think we will need. It is about moving other methods from
EE::IssueLink
toEE::IssuableLink
. For example,refresh_blocking_issue_cache
which caches blocking issues, I believe we will have the same performance issue for epic links when sorting epics by count of blocking epics. Maybe we can keep this out of the MVC, but would be nice to have it on an issue so we can remember to get it scheduled.