1. 02 Jan, 2020 8 commits
    • Sean McGivern's avatar
      Prevent stack overflowing with a lot of user references · e8faadae
      Sean McGivern authored
      When an issue, MR, or epic contains a lot of user references (even to
      the same user), we use the method
      Banzai::ReferenceParser::BaseParser.collection_objects_for_ids to load
      those users and maintain the loaded users for the current request in a
      RequestStore cache.
      
      This method calls Hash#values_at with the splatted IDs - so one argument
      per ID passed in. If enough IDs are passed in, it's possible for the
      arguments here to overflow the stack.
      
      Let's say we have:
      
          ids = [1] * 1_000_000; ids.length
          #=> 1000000
          cache = {}
          #=> {}
          cache.values_at(*ids).compact
          # SystemStackError: stack level too deep
      
      We could do this `cache.values_at(*ids.uniq).compact`, but that would
      fail in this case:
      
          distinct_ids = 1.upto(1_000_000).to_a; distinct_ids.length
          #=> 1000000
          cache.values_at(*distinct_ids.uniq).compact
          # SystemStackError: stack level too deep
      
      So the best option seems to be to just write a slower, but
      non-stack-consuming, version:
      
          Benchmark.realtime { ids.uniq.map { |id| cache[id] }.compact }
          #=> 0.15192799968644977
          Benchmark.realtime { distinct_ids.uniq.map { |id| cache[id] }.compact }
          #=> 0.3621319998055696
      
      To test this locally, you can replace the last issue's description with
      a lot of mentions of a user (here I've created a user with the username
      't'), but it takes a long time:
      
          problem = ('@t ' * 1_000_000)[0...1_000_000]; problem.length
          #=> 1000000
          Issue.last.update!(description: problem_string)
      
      Visiting that issue in the UI will then overflow the stack. With this
      change, it won't (although it is very slow).
      e8faadae
    • Lin Jen-Shin's avatar
      Merge branch 'pass-through-top-upstream-source-ref' into 'master' · 718d00ee
      Lin Jen-Shin authored
      Pass through TOP_UPSTREAM_SOURCE_REF for qa pipeline
      
      See merge request gitlab-org/gitlab!22263
      718d00ee
    • Martin Wortschack's avatar
      Merge branch 'xanf-vtu-30-mount' into 'master' · bbbc58a1
      Martin Wortschack authored
      Fix shallowMount + stubs behavior change in `@vue/test-utils`
      
      Closes #145615
      
      See merge request gitlab-org/gitlab!22286
      bbbc58a1
    • Martin Wortschack's avatar
      Merge branch 'xanf-vtu-30-proper-mock-data' into 'master' · ebb9d17d
      Martin Wortschack authored
      Provide proper mock data for test
      
      Closes #191453
      
      See merge request gitlab-org/gitlab!22316
      ebb9d17d
    • Martin Wortschack's avatar
      Merge branch 'xanf-vtu-30-trigger-emit' into 'master' · f905a752
      Martin Wortschack authored
      Replace trigger with emit in test
      
      Closes #191430
      
      See merge request gitlab-org/gitlab!22315
      f905a752
    • Jan Provaznik's avatar
      Merge branch 'ab/add-column-with-default-specs' into 'master' · 97f28e0a
      Jan Provaznik authored
      Test for no offenses only makes sense with offense
      
      See merge request gitlab-org/gitlab!22301
      97f28e0a
    • Mark Lapierre's avatar
      Merge branch 'qa-shl-wait-for-requests' into 'master' · 8fc0d79a
      Mark Lapierre authored
      Add ajax wait for requests
      
      Closes #55286
      
      See merge request gitlab-org/gitlab!22291
      8fc0d79a
    • Ash McKenzie's avatar
      Merge branch 'stop-exposing-mr-refs-in-favor-of-persistent-refs' into 'master' · 9ced482f
      Ash McKenzie authored
      Stop exposing MR refs in favor of persistent pipeline refs
      
      Closes #35918 and #35140
      
      See merge request gitlab-org/gitlab!22198
      9ced482f
  2. 01 Jan, 2020 8 commits
  3. 31 Dec, 2019 19 commits
  4. 30 Dec, 2019 5 commits