Skip to content
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

Bug/sprint history missing #62

Conversation

troyschuetrumpf-elation
Copy link
Contributor

Pull Request
Are you a current Fivetran customer?

Troy Schuetrumpf, VP Platform Engineering, Elation Health

What change(s) does this PR introduce?

Bug introduced in 8.0. This PR resolves the introduced bug and updates the status selection to use field_name (I verified that this is how this columns ID and Name are represented in jira)

Did you update the CHANGELOG?

  • Yes

Does this PR introduce a breaking change?

  • Yes (please provide breaking change details below.)
  • No (please provide an explanation as to how the change is non-breaking below.)

This will cause the status column of jira__daily_issue_field_history to be populated with data again. No column names or functionality changed.

Did you update the dbt_project.yml files with the version upgrade (please leverage standard semantic versioning)? (In both your main project and integration_tests)

  • Yes

Is this PR in response to a previously created Bug or Feature Request

How did you test the PR changes?

  • CircleCi
  • Local (please provide additional testing details below)

Updated our dbt project that is built on fivetran jira data to use the updated models, run against our dataset and observed sprint column populated with data.

Select which warehouse(s) were used to test the PR

  • BigQuery
  • Redshift
  • Snowflake
  • Postgres
  • Databricks
  • Other (provide details below)

Provide an emoji that best describes your current mood

👍

Feedback

We are so excited you decided to contribute to the Fivetran community dbt package! We continue to work to improve the packages and would greatly appreciate your feedback on our existing dbt packages or what you'd like to see next.

Copy link
Contributor

@fivetran-joemarkiewicz fivetran-joemarkiewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@troyschuetrumpf-elation thanks so much for opening this PR!! 🏅

There are just a few small edits I feel we need to make around the status filter and ensuring we are using the field_id instead of the field_name for those records. Once you make those edits we should be good to merge!

Let me know if you have any questions 😄

@@ -28,8 +28,8 @@ pivot_out as (
select
valid_starting_on,
issue_id,
max(case when lower(field_id) = 'status' then field_value end) as status,
max(case when lower(field_name) = 'sprint' then field_value end) as sprint -- As sprint is a custom field, we aggregate on the field_name.
max(case when lower(field_name) = 'status' then field_value end) as status,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually believe we would want to retain this to be the field_id rather than the field_name for status.

Similar to the below comment, status will always have an ID as status within Jira data. However, the name is mutable and can be changed by the user. I think it would be best to keep status linked to the ID.

Comment on lines 31 to 33
where lower(field_name) in
('status'
,'sprint'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we still want to have the filter look for the field_id for status as the ID within the field table for status will always be status. The name is mutable and can change. Therefore, I think we should keep status linked to field_id.

sprint on the other-hand I feel we should 100% link to field_name.
image

Suggested change
where lower(field_name) in
('status'
,'sprint'
where lower(field_id) = 'status'
or lower(field_name) in ('sprint'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense, Thanks for the review! Reverted status to be checked against field_id as recommended

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this as a seperate commit (instead of accepting the change) in order to update models/intermediate/field_history/int_jira__pivot_daily_field_history.sql at the same time

Copy link
Contributor

@fivetran-joemarkiewicz fivetran-joemarkiewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for applying those changes @troyschuetrumpf-elation 🙌

I made a quick commit to update the CHANGELOG to include relevant links to this PR and your profile for contribution recognition. This PR looks good to go now. I tested the changes and we are seeing the sprint and status records being replicated correctly.

We greatly appreciate your eagle eyes for catching this bug and for working with us to apply the fix. These packages are made better by contributors like yourself. Thank you for contributing back to the community! 🏅

@fivetran-joemarkiewicz fivetran-joemarkiewicz merged commit 78c4963 into fivetran:main Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants