BigW Consortium Gitlab
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 `target_branch_sha` and `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](https://gitlab.com/gitlab-org/gitlab-ce/commit/6ce25e7b4caa9e94de74378729178c7060d640b2) introduced this bug in the importer. ## What are the relevant issue numbers? gitlab-org/gitlab-ce#20385 ## Does this MR meet the acceptance criteria? - [X] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [X] ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~ - [X] ~~API support added~~ - Tests - [X] Added for this feature/bug - [ ] All builds are passing - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [ ] Branch has no merge conflicts with `master` (if you do - rebase it please) - [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) /cc @akitaonrails @DouweM See merge request !5573
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
ci | Loading commit data... | |
concerns | Loading commit data... | |
hooks | Loading commit data... | |
members | Loading commit data... | |
project_services | Loading commit data... | |
ability_spec.rb | Loading commit data... | |
abuse_report_spec.rb | Loading commit data... | |
appearance_spec.rb | Loading commit data... | |
application_setting_spec.rb | Loading commit data... | |
award_emoji_spec.rb | Loading commit data... | |
blob_spec.rb | Loading commit data... | |
broadcast_message_spec.rb | Loading commit data... | |
build_spec.rb | Loading commit data... | |
commit_range_spec.rb | Loading commit data... | |
commit_spec.rb | Loading commit data... | |
commit_status_spec.rb | Loading commit data... | |
deploy_key_spec.rb | Loading commit data... | |
deploy_keys_project_spec.rb | Loading commit data... | |
deployment_spec.rb | Loading commit data... | |
diff_note_spec.rb | Loading commit data... | |
email_spec.rb | Loading commit data... | |
environment_spec.rb | Loading commit data... | |
event_spec.rb | Loading commit data... | |
external_issue_spec.rb | Loading commit data... | |
forked_project_link_spec.rb | Loading commit data... | |
generic_commit_status_spec.rb | Loading commit data... | |
global_milestone_spec.rb | Loading commit data... | |
group_spec.rb | Loading commit data... | |
identity_spec.rb | Loading commit data... | |
issue_spec.rb | Loading commit data... | |
key_spec.rb | Loading commit data... | |
label_link_spec.rb | Loading commit data... | |
label_spec.rb | Loading commit data... | |
legacy_diff_note_spec.rb | Loading commit data... | |
member_spec.rb | Loading commit data... | |
merge_request_diff_spec.rb | Loading commit data... | |
merge_request_spec.rb | Loading commit data... | |
milestone_spec.rb | Loading commit data... | |
namespace_spec.rb | Loading commit data... | |
note_spec.rb | Loading commit data... | |
notification_setting_spec.rb | Loading commit data... | |
personal_access_token_spec.rb | Loading commit data... | |
project_group_link_spec.rb | Loading commit data... | |
project_security_spec.rb | Loading commit data... | |
project_snippet_spec.rb | Loading commit data... | |
project_spec.rb | Loading commit data... | |
project_team_spec.rb | Loading commit data... | |
project_wiki_spec.rb | Loading commit data... | |
protected_branch_spec.rb | Loading commit data... | |
release_spec.rb | Loading commit data... | |
repository_spec.rb | Loading commit data... | |
service_spec.rb | Loading commit data... | |
snippet_spec.rb | Loading commit data... | |
spam_log_spec.rb | Loading commit data... | |
todo_spec.rb | Loading commit data... | |
tree_spec.rb | Loading commit data... | |
user_spec.rb | Loading commit data... | |
wiki_page_spec.rb | Loading commit data... |