• Rémy Coutable's avatar
    Merge branch 'limit-number-of-shown-environments' into 'master' · b4dbc373
    Rémy Coutable authored
    Limit number of shown environments
    
    ## What does this MR do?
    
    This MR limits in context of Merge Request a list of shown environments. Previously we would show all environments containing the SHA of the head commit of Merge Request. However, with introducing of dynamically created environments this lead to a cases that we would show multiple review apps, for different branches, because these branches would contain a new questioned commit.
    
    This MR changes what environments we test against presence of the commit, to:
    1. We look for environments with deployments to source_branch of source_project: used for deployments to per-branch environments,
    2. We look for environments with deployments to target_branch of target_project: used for deployments to staging / production environments,
    3. We look for environments with deployments for tags on target_project: used for staging / production environments.
    
    ## Why was this MR needed?
    
    To improve a list of returned environments when we introduced ability to create dynamic environments for review apps:
    https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6323
    
    See merge request !6438
    b4dbc373
merge_request_spec.rb 38.5 KB