-
Notifications
You must be signed in to change notification settings - Fork 0
feat(elt-pipelines) - Add transform method to get times spent in status per issue #461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
1b0c2bf
Add issue status changelog definition
ambolt314 aaa3a3d
Clean ingested changelog data
ambolt314 3b12e25
corrected staging yml file for expected sql
ambolt314 2585b8d
Initial presentation of data in mart for time in each status. TODO: c…
ambolt314 fdca41d
rename file for specific board
ambolt314 ee0bbbf
chore(airflow): implementing uv cache within airflow setup (#457)
mehta-pooja123 df1a619
feat(elt-pipelines): Add issue status changelog method to Jira pipeli…
ambolt314 09cccef
feat(elt-pipelines): Proposal postgresql sources pipeline (#396)
bashanlam e889c3a
corrected table name
ambolt314 4566708
add correct sql to retrieve status time information. TODO: handle spe…
ambolt314 d35b806
extract time status logic into intermediate group; present report-spe…
ambolt314 6dc6e00
Add user software board
ambolt314 288aa07
Add data driven facility to mart
ambolt314 7666d1c
corrected errors in user software status retrieval
ambolt314 008c5a4
add computing infrastructure to mart
ambolt314 adb2d3d
Refactor scientific software to retrieve correct fields, alphabetically
ambolt314 2628606
filter correct data based on issue keys
ambolt314 e409888
Merge branch 'main' into 450_time_in_status_transform
ambolt314 9b80c20
specify refreshment of table data, referencing https://github.com/ISI…
ambolt314 31db429
Align nomenclature in schemas, referencing https://github.com/ISISNeu…
ambolt314 c226d10
remove trailing comma, referencing https://github.com/ISISNeutronMuon…
ambolt314 0471162
feat(elt-common): Add .env configuration loading (#465)
WHTaylor 018fcec
feat(elt-pipelines): Port opralogweb to elt-pipelines (#462)
ambolt314 56fd8ae
:us: Americanized spelling, referencing https://github.com/ISISNeutro…
ambolt314 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
elt-pipelines/facility_ops/transform/models/intermediate/computing/int_times_in_status.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| -- Get the differences between the status. No need for final status, so this query is perfectly suitable | ||
| with status_to_from as ( | ||
| select | ||
| issue_key, | ||
| from_status as status, | ||
| lag(changed_at) over (partition by issue_key order by changed_at) as status_from, | ||
| changed_at as status_to | ||
|
martyngigg marked this conversation as resolved.
|
||
| from {{ ref('stg_jira_issue_status_changelogs') }} as changelogs | ||
| ), | ||
|
|
||
| -- Populate null values of status from with the issue creation date. Join required | ||
| nn_status_to_from as ( | ||
| select | ||
| status_to_from.issue_key, | ||
| status_to_from.status, | ||
| COALESCE(status_to_from.status_from, issues.created) as status_from, | ||
| status_to_from.status_to | ||
| from status_to_from | ||
| inner join facility_ops_landing.computing_jira.isis_jira_issues as issues | ||
| on status_to_from.issue_key = issues.issue_key | ||
| ), | ||
|
|
||
| -- Subtract to and from date | ||
| status_durations as ( | ||
| select | ||
| issue_key, | ||
| status, | ||
| date_diff('second', status_from, status_to) as status_duration | ||
| from nn_status_to_from | ||
| ), | ||
|
|
||
| -- Aggregate similar statuses and add their durations | ||
| times_in_status as ( | ||
| select | ||
| issue_key, | ||
| status, | ||
| sum(status_duration) as time_in_status | ||
| from status_durations | ||
| group by issue_key, | ||
| status | ||
| ) | ||
|
|
||
| select * from times_in_status | ||
84 changes: 84 additions & 0 deletions
84
...facility_ops/transform/models/marts/computing/time_in_status_computing_infrastructure.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| {{ | ||
| config( | ||
| on_table_exists = 'drop' | ||
| ) | ||
| }} | ||
|
|
||
| with times_in_status as ( | ||
|
ambolt314 marked this conversation as resolved.
|
||
| select * from {{ ref('int_times_in_status') }} where issue_key like 'CI-%' | ||
| ), | ||
|
|
||
| time_in_status_data_driven_facility as ( | ||
| select | ||
| issue_key, | ||
| MAX( | ||
|
martyngigg marked this conversation as resolved.
|
||
| case | ||
| when status = 'analyzing' then time_in_status | ||
| else null | ||
| end | ||
| ) as time_in_analyzing_secs, | ||
| MAX( | ||
| case | ||
| when status = 'backlog' then time_in_status | ||
| else null | ||
| end | ||
| ) as time_in_backlog_secs, | ||
| MAX( | ||
| case | ||
| when status = 'done' then time_in_status | ||
| else null | ||
| end | ||
| ) as time_in_done_secs, | ||
| MAX( | ||
| case | ||
| when status = 'funnel' then time_in_status | ||
| else null | ||
| end | ||
| ) as time_in_funnel_secs, | ||
| MAX( | ||
| case | ||
| when status = 'implementing' then time_in_status | ||
| else null | ||
| end | ||
| ) as time_in_implementing_secs, | ||
| MAX( | ||
| case | ||
| when status = 'implementing (mvp)' then time_in_status | ||
| else null | ||
| end | ||
| ) as time_in_implementing_mvp_secs, | ||
| MAX( | ||
| case | ||
| when status = 'implementing (persevere)' then time_in_status | ||
| else null | ||
| end | ||
| ) as time_in_implementing_persevere_secs, | ||
| MAX( | ||
| case | ||
| when status = 'in progress' then time_in_status | ||
| else null | ||
| end | ||
| ) as time_in_in_progress_secs, | ||
| MAX( | ||
| case | ||
| when status = 'portfolio backlog' then time_in_status | ||
| else null | ||
| end | ||
| ) as time_in_portfolio_backlog_secs, | ||
| MAX( | ||
| case | ||
| when status = 'ready' then time_in_status | ||
| else null | ||
| end | ||
| ) as time_in_ready_secs, | ||
| MAX( | ||
| case | ||
| when status = 'reviewing' then time_in_status | ||
| else null | ||
| end | ||
| ) as time_in_reviewing_secs | ||
| from times_in_status | ||
| group by issue_key | ||
|
|
||
| ) | ||
| select * from time_in_status_data_driven_facility | ||
19 changes: 19 additions & 0 deletions
19
...facility_ops/transform/models/marts/computing/time_in_status_computing_infrastructure.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| models: | ||
| - name: time_in_status_computing_infrastructure | ||
| description: > | ||
| Get length of time a Computing Infrastructure issue spends in each status for user software issues. | ||
| columns: | ||
| - name: issue_key | ||
| data_tests: | ||
| - not_null | ||
| - name: time_in_analyzing_secs | ||
| - name: time_in_backlog_secs | ||
| - name: time_in_done_secs | ||
| - name: time_in_funnel_secs | ||
| - name: time_in_implementing_secs | ||
| - name: time_in_implementing_mvp_secs | ||
| - name: time_in_implementing_persevere_secs | ||
| - name: time_in_in_progress_secs | ||
| - name: time_in_portfolio_backlog_secs | ||
| - name: time_in_ready_secs | ||
| - name: time_in_reviewing_secs |
90 changes: 90 additions & 0 deletions
90
...nes/facility_ops/transform/models/marts/computing/time_in_status_data_driven_facility.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| {{ | ||
| config( | ||
| on_table_exists = 'drop' | ||
| ) | ||
| }} | ||
|
|
||
| with times_in_status as ( | ||
| select * from {{ ref('int_times_in_status') }} where issue_key like 'DD-%' | ||
| ), | ||
|
|
||
| time_in_status_data_driven_facility as ( | ||
| select | ||
| issue_key, | ||
| MAX( | ||
| case | ||
| when status = 'analyzing' then time_in_status | ||
| else null | ||
| end | ||
| ) as time_in_analyzing_secs, | ||
| MAX( | ||
| case | ||
| when status = 'backlog' then time_in_status | ||
| else null | ||
| end | ||
| ) as time_in_backlog_secs, | ||
| MAX( | ||
| case | ||
| when status = 'done' then time_in_status | ||
| else null | ||
| end | ||
| ) as time_in_done_secs, | ||
| MAX( | ||
| case | ||
| when status = 'funnel' then time_in_status | ||
| else null | ||
| end | ||
| ) as time_in_funnel_secs, | ||
| MAX( | ||
| case | ||
| when status = 'implementing' then time_in_status | ||
| else null | ||
| end | ||
| ) as time_in_implementing_secs, | ||
| MAX( | ||
| case | ||
| when status = 'implementing (mvp)' then time_in_status | ||
| else null | ||
| end | ||
| ) as time_in_implementing_mvp_secs, | ||
| MAX( | ||
| case | ||
| when status = 'implementing (persevere)' then time_in_status | ||
| else null | ||
| end | ||
| ) as time_in_implementing_persevere_secs, | ||
| MAX( | ||
| case | ||
| when status = 'in progress' then time_in_status | ||
| else null | ||
| end | ||
| ) as time_in_in_progress_secs, | ||
| MAX( | ||
| case | ||
| when status = 'portfolio backlog' then time_in_status | ||
| else null | ||
| end | ||
| ) as time_in_portfolio_backlog_secs, | ||
| MAX( | ||
| case | ||
| when status = 'ready' then time_in_status | ||
| else null | ||
| end | ||
| ) as time_in_ready_secs, | ||
| MAX( | ||
| case | ||
| when status = 'reviewing' then time_in_status | ||
| else null | ||
| end | ||
| ) as time_in_reviewing_secs, | ||
| MAX( | ||
| case | ||
| when status = 'selected for development' then time_in_status | ||
| else null | ||
| end | ||
| ) as time_in_selected_for_development_secs | ||
| from times_in_status | ||
| group by issue_key | ||
|
|
||
| ) | ||
| select * from time_in_status_data_driven_facility |
20 changes: 20 additions & 0 deletions
20
...nes/facility_ops/transform/models/marts/computing/time_in_status_data_driven_facility.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| models: | ||
| - name: time_in_status_data_driven_facility | ||
| description: > | ||
| Get length of time a Data-Driven Facility issue spends in each status for user software issues. | ||
| columns: | ||
| - name: issue_key | ||
| data_tests: | ||
| - not_null | ||
| - name: time_in_analyzing_secs | ||
| - name: time_in_backlog_secs | ||
| - name: time_in_done_secs | ||
| - name: time_in_funnel_secs | ||
| - name: time_in_implementing_secs | ||
| - name: time_in_implementing_mvp_secs | ||
| - name: time_in_implementing_persevere_secs | ||
| - name: time_in_in_progress_secs | ||
| - name: time_in_portfolio_backlog_secs | ||
| - name: time_in_ready_secs | ||
| - name: time_in_reviewing_secs | ||
| - name: time_in_selected_for_development_secs |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.