From 76c52001ab08cfe9e9789b1311fe330f4ac689ee Mon Sep 17 00:00:00 2001 From: Maarten de Kruijf <16100232+MaartendeKruijf@users.noreply.github.com> Date: Wed, 4 Sep 2024 20:17:06 +0200 Subject: [PATCH] Update api endpoint --- routes/reporter/reporter_parser.go | 4 ++++ test/unittest/routes/reporter_api/reporter_api_test.go | 3 +++ 2 files changed, 7 insertions(+) diff --git a/routes/reporter/reporter_parser.go b/routes/reporter/reporter_parser.go index c494dc3f..36b390a6 100644 --- a/routes/reporter/reporter_parser.go +++ b/routes/reporter/reporter_parser.go @@ -25,6 +25,8 @@ func parseCachePlaybookEntry(cacheEntry cache_model.ExecutionEntry) (api_model.P executionReport := api_model.PlaybookExecutionReport{ Type: "execution_status", + Name: cacheEntry.Name, + Description: cacheEntry.Description, ExecutionId: cacheEntry.ExecutionId.String(), PlaybookId: cacheEntry.PlaybookId, Started: cacheEntry.Started, @@ -55,6 +57,8 @@ func parseCacheStepEntries(cacheStepEntries map[string]cache_model.StepResult) ( parsedEntries[stepId] = api_model.StepExecutionReport{ ExecutionId: stepEntry.ExecutionId.String(), StepId: stepEntry.StepId, + Name: stepEntry.Name, + Description: stepEntry.Description, Started: stepEntry.Started, Ended: stepEntry.Ended, Status: stepStatus, diff --git a/test/unittest/routes/reporter_api/reporter_api_test.go b/test/unittest/routes/reporter_api/reporter_api_test.go index d9315a74..cf40b889 100644 --- a/test/unittest/routes/reporter_api/reporter_api_test.go +++ b/test/unittest/routes/reporter_api/reporter_api_test.go @@ -109,6 +109,7 @@ func TestGetExecutions(t *testing.T) { Type: "execution_status", ExecutionId: executionId.String(), PlaybookId: "test", + Name: "ssh-test", Started: expectedStarted, Ended: expectedEnded, Status: expectedStatus, @@ -262,6 +263,7 @@ func TestGetExecutionReport(t *testing.T) { "type":"execution_status", "execution_id":"6ba7b810-9dad-11d1-80b4-00c04fd430c0", "playbook_id":"test", + "name":"ssh-test", "started":"2014-11-12T11:45:26.371Z", "ended":"0001-01-01T00:00:00Z", "status":"ongoing", @@ -270,6 +272,7 @@ func TestGetExecutionReport(t *testing.T) { "action--test":{ "execution_id":"6ba7b810-9dad-11d1-80b4-00c04fd430c0", "step_id":"action--test", + "name":"ssh-tests", "started":"2014-11-12T11:45:26.371Z", "ended":"2014-11-12T11:45:26.371Z", "status":"successfully_executed",