Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-01-11 15:10:33 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-01-11 15:10:33 +0300
commitf41b535ced0cdddb67661bdb0a6216216dc6b89c (patch)
treed9656ae0dfb354d1a41b16edb818075fffc08624 /app
parent57a4319d4277b2d7897afd91936694308e8016bf (diff)
parentd5c8f1fdde7dd9c0467f7743694ffdecd15fdf94 (diff)
Merge branch 'fix-build-status-caching' into 'master'
Fix caching issue where build status was not updating in project dashboard The project dashboard page would show a stale build status since the caching key did not depend on it. Fix by adding the commit status if CI is applicable. Closes #3268 See merge request !2353
Diffstat (limited to 'app')
-rw-r--r--app/views/shared/projects/_project.html.haml13
1 files changed, 8 insertions, 5 deletions
diff --git a/app/views/shared/projects/_project.html.haml b/app/views/shared/projects/_project.html.haml
index 86249851a82..5db8056b77c 100644
--- a/app/views/shared/projects/_project.html.haml
+++ b/app/views/shared/projects/_project.html.haml
@@ -4,8 +4,12 @@
- skip_namespace = false unless local_assigns[:skip_namespace] == true
- css_class = '' unless local_assigns[:css_class]
- css_class += " no-description" unless project.description.present?
+- ci_commit = project.ci_commit(project.commit.sha) if ci && !project.empty_repo? && project.commit
+- cache_key = [project.namespace, project, controller.controller_name, controller.action_name, current_application_settings, 'v2.2']
+- cache_key.push(ci_commit.status) if ci_commit
+
%li.project-row{ class: css_class }
- = cache [project.namespace, project, controller.controller_name, controller.action_name, current_application_settings, 'v2.2'] do
+ = cache(cache_key) do
= link_to project_path(project), class: dom_class(project) do
- if avatar
.dash-project-avatar
@@ -19,10 +23,9 @@
= project.name
.project-controls
- - if ci && !project.empty_repo? && project.commit
- - if ci_commit = project.ci_commit(project.commit.sha)
- = render_ci_status(ci_commit)
- &nbsp;
+ - if ci_commit
+ = render_ci_status(ci_commit)
+ &nbsp;
- if stars
%span
%i.fa.fa-star