Changing the number of approvals needed does not update the MRs

Summary

Changing the number of approvals needed does not update the MRs

Steps to reproduce

  1. Set a minimum number of approvals to
  2. Create an MR
  3. Have someone else approve it
  4. Increase the minimum number of approvals to 2
  5. Verify that the MR is still approved and mergeable
  6. Press the Merge button
  7. Verify that it will spin forever

What is the current bug behavior?

MR appears mergeable in the UI, but validations will prevent it from merging, causing confusion

What is the expected correct behavior?

MR stop appearing mergeable in the UI when the number of approvals is raised

Relevant logs and/or screenshots

2019-03-14_16:27:25.04761 2019-03-14T16:27:25.047Z 7855 TID-oxqxfdhuv MergeWorker JID-5885226f1ba4232742815b53 INFO: start
2019-03-14_16:27:25.63211 2019-03-14T16:27:25.632Z 7855 TID-oxqxfdhuv MergeWorker JID-5885226f1ba4232742815b53 INFO: fail: 0.585 sec
2019-03-14_16:27:25.63228 2019-03-14T16:27:25.632Z 7855 TID-oxqxfdhuv WARN: {"context":"Job raised exception","job":{"class":"MergeWorker","args":[2,4,{"should_remove_source_branch":false,"commit_message":"Merge branch 'try-some-change' into 'master'\n\nDelete package.json.old\n\nSee merge request haa/bar!1","squash_commit_message":"Delete package.json.old","squash":false}],"retry":3,"queue":"merge","jid":"5885226f1ba4232742815b53","created_at":1552580845.0462577,"correlation_id":"uN3nhFzCPY8","enqueued_at":1552580845.046628},"jobstr":"{\"class\":\"MergeWorker\",\"args\":[2,4,{\"should_remove_source_branch\":false,\"commit_message\":\"Merge branch 'try-some-change' into 'master'\\n\\nDelete package.json.old\\n\\nSee merge request haa/bar!1\",\"squash_commit_message\":\"Delete package.json.old\",\"squash\":false}],\"retry\":3,\"queue\":\"merge\",\"jid\":\"5885226f1ba4232742815b53\",\"created_at\":1552580845.0462577,\"correlation_id\":\"uN3nhFzCPY8\",\"enqueued_at\":1552580845.046628}"}
2019-03-14_16:27:58.22504 2019-03-14T16:27:58.224Z 7855 TID-oxqxfdwoj MergeWorker JID-5885226f1ba4232742815b53 INFO: start
2019-03-14_16:27:58.28678 2019-03-14T16:27:58.286Z 7855 TID-oxqxfdwoj MergeWorker JID-5885226f1ba4232742815b53 INFO: done: 0.062 sec

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

System information System: Ubuntu 18.04 Proxy: no Current User: git Using RVM: no Ruby Version: 2.5.3p105 Gem Version: 2.7.6 Bundler Version:1.16.6 Rake Version: 12.3.2 Redis Version: 3.2.12 Git Version: 2.18.1 Sidekiq Version:5.2.5 Go Version: go1.10.4 linux/amd64

GitLab information Version: 11.8.0-ee Revision: 002a28279f5 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql DB Version: 9.6.11 URL: https://gitlab.tpresa.com HTTP Clone URL: https://gitlab.tpresa.com/some-group/some-project.git SSH Clone URL: git@gitlab.tpresa.com:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: no Using Omniauth: yes Omniauth Providers: saml

GitLab Shell Version: 8.4.4 Repository storage paths:

  • default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git

Results of GitLab application Check

Expand for output related to the GitLab application check
Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 8.4.4 ? ... OK (8.4.4) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK

Access to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Gitaly ...

Gitaly: ... default ... OK

Checking Gitaly ... Finished

Checking Sidekiq ...

Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking Incoming Email ...

Incoming Email: ... Reply by email is disabled in config/gitlab.yml

Checking Incoming Email ... Finished

Checking LDAP ...

LDAP: ... LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab App ...

Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... skipped (no tmp uploads folder yet) Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 6/1 ... yes 4/2 ... yes 5/3 ... yes 6/4 ... yes 6/5 ... yes 1/6 ... yes 7/7 ... yes 1/8 ... yes 1/9 ... yes 10/10 ... yes 1/11 ... yes 1/12 ... yes 1/13 ... yes 12/14 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.5 ? ... yes (2.5.3) Git version >= 2.18.0 ? ... yes (2.18.1) Git user has default SSH configuration? ... yes Active users: ... 4 Elasticsearch version 5.6 - 6.x? ... skipped (elasticsearch is disabled)

Checking GitLab App ... Finished

Checking GitLab subtasks ... Finished

Possible fixes

(If you can, link to the line of code that might be responsible for the problem)

ZD https://gitlab.zendesk.com/agent/tickets/116540 (internal)