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
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/projects/ml/experiments_helper.rb')
-rw-r--r--app/helpers/projects/ml/experiments_helper.rb15
1 files changed, 10 insertions, 5 deletions
diff --git a/app/helpers/projects/ml/experiments_helper.rb b/app/helpers/projects/ml/experiments_helper.rb
index d5b2c3cd36a..6c7b6eb6fbc 100644
--- a/app/helpers/projects/ml/experiments_helper.rb
+++ b/app/helpers/projects/ml/experiments_helper.rb
@@ -14,17 +14,17 @@ module Projects
Gitlab::Json.generate(data)
end
- def candidates_table_items(candidates, user)
+ def candidates_table_items(candidates, current_user)
items = candidates.map do |candidate|
{
**candidate.params.to_h { |p| [p.name, p.value] },
**candidate.latest_metrics.to_h { |m| [m.name, number_with_precision(m.value, precision: 4)] },
- ci_job: job_info(candidate, user),
+ ci_job: job_info(candidate, current_user),
artifact: link_to_artifact(candidate),
details: link_to_details(candidate),
name: candidate.name,
created_at: candidate.created_at,
- user: user_info(candidate)
+ user: user_info(candidate, current_user)
}
end
@@ -87,8 +87,13 @@ module Projects
project_ml_experiment_path(project, experiment.iid)
end
- def user_info(candidate)
- user = candidate.user
+ def user_info(candidate, current_user)
+ user =
+ if candidate.from_ci?
+ candidate.ci_build.user if can?(current_user, :read_build, candidate.ci_build)
+ else
+ candidate.user
+ end
return unless user.present?