Skip to content

Commit f5b689b

Browse files
committed
Fix for Workflow Analysis Repo Selector
Updated the workflow analysis dashboard and associated javascript to fix the broken repo select input and mismatched time token.
1 parent f072d12 commit f5b689b

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

github_app_for_splunk/appserver/static/workflowdetails.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ require([
1717
preview: true,
1818
cache: true,
1919
search: mvc.tokenSafe("index=github_webhook eventtype=\"GitHub::Workflow\" \"workflow_job.run_id\"=$workflow_id$| fields * | eval queued=if(action==\"queued\",_time,null), started=if(action==\"in_progress\",_time,null), completed=if(action==\"completed\",_time,null) | stats latest(workflow_job.conclusion) as status, latest(workflow_job.name) as Name, latest(queued) as queued, latest(started) as started, latest(completed) as completed by workflow_job.id | eval queueTime=toString(round(started-queued),\"Duration\"), runTime=toString(round(completed-started),\"Duration\"), totalTime=toString(round(completed-queued),\"Duration\"), status=if(status==\"null\",\"in_progress\",status) | rename workflow_job.id AS JobID | fields status, Name, JobID, queueTime, runTime, totalTime"),
20-
earliest_time: mvc.tokenSafe("$field1.earliest$"),
21-
latest_time: mvc.tokenSafe("$field1.latest$")
20+
earliest_time: mvc.tokenSafe("timeTkn.earliest$"),
21+
latest_time: mvc.tokenSafe("timeTkn.latest$")
2222
});
2323

2424
// Create a table for a custom row expander

github_app_for_splunk/default/data/ui/views/workflow_analysis.xml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<form version="1.1" script="example_customtables.js" stylesheet="custom.css" theme="dark">
22
<label>Workflow Analysis</label>
33
<fieldset submitButton="false" autoRun="true">
4-
<input type="time" token="field1">
4+
<input type="time" token="timeTkn">
55
<label></label>
66
<default>
77
<earliest>-24h@h</earliest>
@@ -10,6 +10,13 @@
1010
</input>
1111
<input type="multiselect" token="repos">
1212
<label>Repositories</label>
13+
<fieldForLabel>repository.name</fieldForLabel>
14+
<fieldForValue>repository.name</fieldForValue>
15+
<search>
16+
<query>`github_webhooks` eventtype="GitHub::Workflow"|dedup repository.name| table repository.name</query>
17+
<earliest>$timeTkn.earliest$</earliest>
18+
<latest>$timeTkn.latest$</latest>
19+
</search>
1320
<choice value="*">All</choice>
1421
<default>*</default>
1522
<initialValue>*</initialValue>
@@ -21,8 +28,8 @@
2128
<title>Workflow Conclusions Over Time</title>
2229
<search>
2330
<query>`github_webhooks` "workflow_run.name"="*" | spath "repository.full_name" | search repository.full_name="$repos$" | stats latest(_time) as _time, latest(workflow_run.conclusion) as workflow_run.conclusion by repository.full_name,workflow_run.name,workflow_run.id | timechart count by workflow_run.conclusion span=1h | rename null as "in-progress"</query>
24-
<earliest>$field1.earliest$</earliest>
25-
<latest>$field1.latest$</latest>
31+
<earliest>$timeTkn.earliest$</earliest>
32+
<latest>$timeTkn.latest$</latest>
2633
<sampleRatio>1</sampleRatio>
2734
</search>
2835
<option name="charting.axisLabelsX.majorLabelStyle.overflowMode">ellipsisNone</option>

0 commit comments

Comments
 (0)