Commit 2d0f7c65 authored by Krzysztof Dąbrowski's avatar Krzysztof Dąbrowski Committed by Vitaly Slobodin

Always use job name for Terraform plan

parent d6e94fa6
......@@ -20,8 +20,8 @@ export default {
'Terraform|Reported Resource Changes: %{addNum} to add, %{changeNum} to change, %{deleteNum} to delete',
),
generationErrored: s__('Terraform|Generating the report caused an error.'),
namedReportFailed: s__('Terraform|The report %{name} failed to generate.'),
namedReportGenerated: s__('Terraform|The report %{name} was generated in your pipelines.'),
namedReportFailed: s__('Terraform|The job %{name} failed to generate a report.'),
namedReportGenerated: s__('Terraform|The job %{name} generated a report.'),
reportFailed: s__('Terraform|A report failed to generate.'),
reportGenerated: s__('Terraform|A report was generated in your pipelines.'),
},
......
......@@ -34,7 +34,7 @@ module Gitlab
def job_details(job)
{
'job_id' => job.id.to_s,
'job_name' => job.options.dig(:artifacts, :name).to_s,
'job_name' => job.name,
'job_path' => Gitlab::Routing.url_helpers.project_job_path(job.project, job)
}
end
......
......@@ -34173,10 +34173,10 @@ msgstr ""
msgid "Terraform|Terraform init command"
msgstr ""
msgid "Terraform|The report %{name} failed to generate."
msgid "Terraform|The job %{name} failed to generate a report."
msgstr ""
msgid "Terraform|The report %{name} was generated in your pipelines."
msgid "Terraform|The job %{name} generated a report."
msgstr ""
msgid "Terraform|To get access to this terraform state from your local computer, run the following command at the command line. The first line requires a personal access token with API read and write access. %{linkStart}How do I create a personal access token?%{linkEnd}."
......
......@@ -1377,7 +1377,7 @@ RSpec.describe Projects::MergeRequestsController do
'create' => 0,
'delete' => 0,
'update' => 1,
'job_name' => build.options.dig(:artifacts, :name).to_s
'job_name' => build.name
)
)
)
......
......@@ -32,9 +32,7 @@ describe('TerraformPlan', () => {
});
it('diplays the header text with a name', () => {
expect(wrapper.text()).toContain(
`The report ${validPlanWithName.job_name} was generated in your pipelines.`,
);
expect(wrapper.text()).toContain(`The job ${validPlanWithName.job_name} generated a report.`);
});
it('diplays the reported changes', () => {
......@@ -70,7 +68,7 @@ describe('TerraformPlan', () => {
it('diplays the header text with a name', () => {
expect(wrapper.text()).toContain(
`The report ${invalidPlanWithName.job_name} failed to generate.`,
`The job ${invalidPlanWithName.job_name} failed to generate a report.`,
);
});
......
......@@ -103,7 +103,7 @@ RSpec.describe Gitlab::Ci::Parsers::Terraform::Tfplan do
'create' => 0,
'update' => 1,
'delete' => 0,
'job_name' => artifact.job.options.dig(:artifacts, :name).to_s
'job_name' => artifact.job.name
)
)
)
......@@ -124,7 +124,7 @@ RSpec.describe Gitlab::Ci::Parsers::Terraform::Tfplan do
'create' => 0,
'update' => 1,
'delete' => 0,
'job_name' => artifact.job.options.dig(:artifacts, :name).to_s
'job_name' => artifact.job.name
)
)
)
......
......@@ -4474,7 +4474,7 @@ RSpec.describe Ci::Build do
'create' => 0,
'update' => 1,
'delete' => 0,
'job_name' => build.options.dig(:artifacts, :name).to_s
'job_name' => build.name
)
)
)
......
......@@ -23,7 +23,7 @@ RSpec.describe Ci::GenerateTerraformReportsService do
'create' => 0,
'delete' => 0,
'update' => 1,
'job_name' => build.options.dig(:artifacts, :name).to_s
'job_name' => build.name
))
),
key: an_instance_of(Array)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment