mirror of
https://github.com/status-im/sourcecred.git
synced 2025-02-20 00:08:10 +00:00
For every `TextContentEntity` (`Issue`, `Pull`, `Review`, `Comment`), this commit adds a `references` method that iterates over the entities that the text content entity references. For every `ReferentEntity` (actually, every entity), this commit adds a `referencedBy` method which iterates over the text content entities that reference that referent entity. This method also adds `referentEntities` and `textContentEntities` methods to the `RelationalView`, as they are used in both implementation and test code. Test plan: The snapshot tests include every reference, in a format that is very convenient for inspecting the ground truth on GitHub. For every reference, it's easy to check that the reference actually exists by copying the `from` url and pasting it into the browser. I've done this and they check out. (It's not easy to prove that there are no missing references, but I'm pretty confident that this code is working.) Unit tests ensure that the `references` and `referencedBy` methods are consistent.