Fix attr reader to force the intended values for source and target shas
What does this MR do?
When importing a pull request from GitHub, the old and new branches may no longer actually exist by those names, but we need to recreate the merge
request diff with the right source and target shas. We use these
source_branch_sha attributes to force these to the intended values. But the reader methods were always looking up to the target/source branch head instead of check if these values was previously set, this MR applies a memoization pattern to both of them.
Are there points in the code the reviewer needs to double check?
This commit introduced this bug in the importer.
What are the relevant issue numbers?
Does this MR meet the acceptance criteria?
- CHANGELOG entry added
API support added
- Added for this feature/bug
- All builds are passing
- Conform by the style guides
Branch has no merge conflicts with
master(if you do - rebase it please)
- Squashed related commits together