1. 05 Oct, 2016 9 commits
    • Rémy Coutable's avatar
      Merge branch 'test-improve-gitlab-identifier' into 'master' · c9396bc7
      Rémy Coutable authored
      Refactor Gitlab::Identifier
      
      ## What does this MR do?
      
      This refactors `Gitlab::Identifier` so that it:
      
      1. Has tests
      2. Caches output in an instance variable to reduce queries
      3. Uses only a single query to find a user by an SSH key, instead of 2
      
      ## Why was this MR needed?
      
      This code was untested and would execute more SQL queries than needed.
      
      See merge request !6680
      c9396bc7
    • Yorick Peterse's avatar
      Refactor Gitlab::Identifier · 16ed9b61
      Yorick Peterse authored
      This refactors Gitlab::Identifier so it uses fewer queries and is
      actually tested. Queries are reduced by caching the output as well as
      using 1 query (instead of 2) to find a user using an SSH key.
      16ed9b61
    • Rémy Coutable's avatar
      Merge branch 'update-runner-information' into 'master' · 6d74e474
      Rémy Coutable authored
      Update runner version only when updating contacted_at
      
      ## What does this MR do?
      
      Improves how we update runners table, especially the version.
      
      This is another round of improvements to reduce number of `ci_runners` updates.
      
      I did make `contacted_at` to be updated more often (on average every 15 minutes).
      We will also update version information in one go to solve: https://gitlab.com/gitlab-org/gitlab-ce/issues/22206
      
      Improves: https://gitlab.com/gitlab-org/gitlab-ce/issues/22590
      Solves: https://gitlab.com/gitlab-org/gitlab-ce/issues/22206
      
      See merge request !6537
      6d74e474
    • Rémy Coutable's avatar
      Merge branch 'all-skipped-equals-success' into 'master' · 4dc61dc7
      Rémy Coutable authored
      Skipped jobs should be considered successful
      
      ## What does this MR do?
      
      If all jobs in previous stage are all skipped, the next stage should consider previous stage succeeded.
      
      ## Why was this MR needed?
      
      Since for now we consider all manual jobs if skipped, should not block the next stage from running.
      
      Closes #22598 
      
      See also #20342 (because this merge request conflicts with it)
      
      See merge request !6604
      4dc61dc7
    • Sean McGivern's avatar
      Merge branch 'doc/using_docker_images' into 'master' · 1b7dda70
      Sean McGivern authored
      Fix small typo in using_docker_images.md, file is called `build_script` (using underscore)
      
      ## What does this MR do?
      
      This MR fixes a very small typo in the using_docker_images.md documentation, a space was used in the filename `build_script` while it should be an underscore. Not sure of a MR is the best way to get this changed, trying it anyway :).
      
      ## Moving docs to a new location?
      
      No
      
      See merge request !6682
      1b7dda70
    • Rémy Coutable's avatar
      Merge branch 'remove-reset-project-activity-lease' into 'master' · 92bacb99
      Rémy Coutable authored
      Remove lease from Event#reset_project_activity
      
      ## What does this MR do?
      
      This removes the exclusive lease used by `Event#reset_project_activity` in favour of conditional UPDATE queries. See dbcc623a901cb3fb725976217416bafad73dbf69 for more information.
      
      ## Why was this MR needed?
      
      Obtaining the lease can, for whatever reason, be _really_ slow. See https://gitlab.com/gitlab-org/gitlab-ce/issues/22473 for more information.
      
      https://gitlab.com/gitlab-org/gitlab-ce/issues/22473
      
      See merge request !6678
      92bacb99
    • Rémy Coutable's avatar
      Merge branch 'doc-admin-housekeeping' into 'master' · 6948e1c8
      Rémy Coutable authored
      Update housekeeping docs for new GitLab UI.
      
      I spent far too much time trying to find this button.
      
      See merge request !6679
      6948e1c8
    • Rémy Coutable's avatar
      Merge branch 'sh-fix-project-deletion-private-visibility' into 'master' · eb202136
      Rémy Coutable authored
      Fix project deletion when feature visibility is set to private
      
      Projects that are destroyed are put in the pending_delete state.
      The ProjectDestroyWorker checks whether the current user has
      access, but since the ProjectFeature class uses the default scope
      of the Project, it will not be able to find the right project.
      
      This was a regression in 8.12 that caused the following stack trace:
      
      ```
      NoMethodError: undefined method `team' for nil:NilClass
        from app/models/project_feature.rb:62:in `get_permission'
        from app/models/project_feature.rb:34:in `feature_available?'
        from app/models/project.rb:21:in `feature_available?'
        from app/policies/project_policy.rb:170:in `disabled_features!'
        from app/policies/project_policy.rb:29:in `rules'
        from app/policies/base_policy.rb:82:in `block in abilities'
        from app/policies/base_policy.rb:113:in `collect_rules'
        from app/policies/base_policy.rb:82:in `abilities'
        from app/policies/base_policy.rb:50:in `abilities'
        from app/models/ability.rb:64:in `uncached_allowed'
        from app/models/ability.rb:58:in `allowed'
        from app/models/ability.rb:49:in `allowed?'
        from app/services/base_service.rb:11:in `can?'
        from lib/gitlab/metrics/instrumentation.rb:155:in `block in can?'
        from lib/gitlab/metrics/method_call.rb:23:in `measure'
        from lib/gitlab/metrics/instrumentation.rb:155:in `can?'
        from app/services/projects/destroy_service.rb:18:in `execute'
      ```
      
      Closes #22948
      
      See merge request !6688
      eb202136
    • Stan Hu's avatar
      Fix project deletion when feature visibility is set to private · fea80aa1
      Stan Hu authored
      Projects that are destroyed are put in the pending_delete state.
      The ProjectDestroyWorker checks whether the current user has
      access, but since the ProjectFeature class uses the default scope
      of the Project, it will not be able to find the right project.
      
      This was a regression in 8.12 that caused the following stack trace:
      
      ```
      NoMethodError: undefined method `team' for nil:NilClass
        from app/models/project_feature.rb:62:in `get_permission'
        from app/models/project_feature.rb:34:in `feature_available?'
        from app/models/project.rb:21:in `feature_available?'
        from app/policies/project_policy.rb:170:in `disabled_features!'
        from app/policies/project_policy.rb:29:in `rules'
        from app/policies/base_policy.rb:82:in `block in abilities'
        from app/policies/base_policy.rb:113:in `collect_rules'
        from app/policies/base_policy.rb:82:in `abilities'
        from app/policies/base_policy.rb:50:in `abilities'
        from app/models/ability.rb:64:in `uncached_allowed'
        from app/models/ability.rb:58:in `allowed'
        from app/models/ability.rb:49:in `allowed?'
        from app/services/base_service.rb:11:in `can?'
        from lib/gitlab/metrics/instrumentation.rb:155:in `block in can?'
        from lib/gitlab/metrics/method_call.rb:23:in `measure'
        from lib/gitlab/metrics/instrumentation.rb:155:in `can?'
        from app/services/projects/destroy_service.rb:18:in `execute'
      ```
      
      Closes #22948
      fea80aa1
  2. 04 Oct, 2016 31 commits