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

bugfix/revised-parent-id-datatype #122

Merged
merged 8 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 10 additions & 32 deletions .github/PULL_REQUEST_TEMPLATE/maintainer_pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,26 @@
**This PR will result in the following new package version:**
<!--- Please add details around your decision for breaking vs non-breaking version upgrade. If this is a breaking change, were backwards-compatible options explored? -->

**Please detail what change(s) this PR introduces and any additional information that should be known during the review of this PR:**
**Please provide the finalized CHANGELOG entry which details the relevant changes included in this PR:**
<!--- Copy/paste the CHANGELOG for this version below. -->

## PR Checklist
### Basic Validation
Please acknowledge that you have successfully performed the following commands locally:
- [ ] dbt compile
- [ ] dbt run –full-refresh
- [ ] dbt run
- [ ] dbt test
- [ ] dbt run –vars (if applicable)
- [ ] dbt run –full-refresh && dbt test
- [ ] dbt run (if incremental models are present) && dbt test

Before marking this PR as "ready for review" the following have been applied:
- [ ] The appropriate issue has been linked and tagged
- [ ] You are assigned to the corresponding issue and this PR
- [ ] The appropriate issue has been linked, tagged, and properly assigned
- [ ] All necessary documentation and version upgrades have been applied
- [ ] docs were regenerated (unless this PR does not include any code or yml updates)
- [ ] BuildKite integration tests are passing
- [ ] Detailed validation steps have been provided below

### Detailed Validation
Please acknowledge that the following validation checks have been performed prior to marking this PR as "ready for review":
- [ ] You have validated these changes and assure this PR will address the respective Issue/Feature.
- [ ] You are reasonably confident these changes will not impact any other components of this package or any dependent packages.
- [ ] You have provided details below around the validation steps performed to gain confidence in these changes.
Please share any and all of your validation steps:
<!--- Provide the steps you took to validate your changes below. -->

### Standard Updates
Please acknowledge that your PR contains the following standard updates:
- Package versioning has been appropriately indexed in the following locations:
- [ ] indexed within dbt_project.yml
- [ ] indexed within integration_tests/dbt_project.yml
- [ ] CHANGELOG has individual entries for each respective change in this PR
<!--- If there is a parallel upstream change, remember to reference the corresponding CHANGELOG as an individual entry. -->
- [ ] README updates have been applied (if applicable)
<!--- Remember to check the following README locations for common updates. →
<!--- Suggested install range (needed for breaking changes) →
<!--- Dependency matrix is appropriately updated (if applicable) →
<!--- New variable documentation (if applicable) -->
- [ ] DECISIONLOG updates have been updated (if applicable)
- [ ] Appropriate yml documentation has been added (if applicable)

### dbt Docs
Please acknowledge that after the above were all completed the below were applied to your branch:
- [ ] docs were regenerated (unless this PR does not include any code or yml updates)

### If you had to summarize this PR in an emoji, which would it be?
<!--- For a complete list of markdown compatible emojis check our this git repo (https://gist.github.com/rxaviers/7360908) -->
:dancer:
:dancer:
13 changes: 13 additions & 0 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: 'auto release'
on:
pull_request:
types:
- closed
branches:
- main

jobs:
call-workflow-passing-data:
if: github.event.pull_request.merged
uses: fivetran/dbt_package_automations/.github/workflows/auto-release.yml@main
secrets: inherit
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ dbt_modules/
logs/
.DS_Store
models/intermediate/int_jira__all_field_options.sql
dbt_packages/
dbt_packages/
package-lock.yml
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
# dbt_jira VERSION.VERSION
# dbt_jira v0.16.0
[PR #122](https://github.com/fivetran/dbt_jira/pull/122) contains the following updates:

## 🚨 Breaking Changes: Bug Fixes 🚨
- The following fields in the below mentioned models have been converted to a string datatype (previously integer) to ensure classic Jira projects may link issues to epics. In classic Jira projects the epic reference is in a hyperlink form (ie. "https://ulr-here/epic-key") as opposed to an ID. As such, a string datatype is needed to successfully link issues to epics. If you are referencing these fields downstream, be sure to make any changes to account for the new datatype.
- `revised_parent_issue_id` field within the `int_jira__issue_type_parents` model
- `parent_issue_id` field within the `jira__issue_enhanced` model

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see parent_issue_id in the jira__issue_enhanced. Did you mean issue_id? Or did you mean to mention a different model, int_jira__issue_users?

Also, if you're mentioning int_jira__issue_type_parents, should you mention the changes in int_jira__issue_epic and int_jira__issue_users too?

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 don't see parent_issue_id in the jira__issue_enhanced. Did you mean issue_id? Or did you mean to mention a different model, int_jira__issue_users?

parent_issue_id is included in the jira__issue_enhanced model. It is not included in the code due to it being brought in via the *.

image

Also, if you're mentioning int_jira__issue_type_parents, should you mention the changes in int_jira__issue_epic and int_jira__issue_users too?

These are both ephemeral models which which will not result in any destination changes on the customers side. This is why they were not listed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it, thanks for clarifying, looks good!

## Documentation updates
- Update README to highlight requirements for using custom fields with the `issue_field_history_columns` variable.

## Under the Hood
- Included auto-releaser GitHub Actions workflow to automate future releases.
- Updated the maintainer PR template to resemble the most up to date format.
- Updated `field` and `issue_field_history` seed files to ensure we have an updated test case to capture the epic-link scenario for classic Jira environments.

# dbt_jira v0.15.0
[PR #108](https://github.com/fivetran/dbt_jira/pull/108) contains the following updates:
## 🚨 Breaking Changes 🚨
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Include the following jira package version in your `packages.yml` file:
```yaml
packages:
- package: fivetran/jira
version: [">=0.15.0", "<0.16.0"]
version: [">=0.16.0", "<0.17.0"]

```
## Step 3: Define database and schema variables
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'jira'
version: '0.15.0'
version: '0.16.0'
config-version: 2
require-dbt-version: [">=1.3.0", "<2.0.0"]
vars:
Expand Down
2 changes: 1 addition & 1 deletion docs/catalog.json

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions docs/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/manifest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/run_results.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions integration_tests/ci/sample.profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ integration_tests:
pass: "{{ env_var('CI_REDSHIFT_DBT_PASS') }}"
dbname: "{{ env_var('CI_REDSHIFT_DBT_DBNAME') }}"
port: 5439
schema: jira_integrations_tests_3
schema: jira_integrations_tests_41
threads: 8
bigquery:
type: bigquery
method: service-account-json
project: 'dbt-package-testing'
schema: jira_integrations_tests_3
schema: jira_integrations_tests_41
threads: 8
keyfile_json: "{{ env_var('GCLOUD_SERVICE_KEY') | as_native }}"
snowflake:
Expand All @@ -33,7 +33,7 @@ integration_tests:
role: "{{ env_var('CI_SNOWFLAKE_DBT_ROLE') }}"
database: "{{ env_var('CI_SNOWFLAKE_DBT_DATABASE') }}"
warehouse: "{{ env_var('CI_SNOWFLAKE_DBT_WAREHOUSE') }}"
schema: jira_integrations_tests_3
schema: jira_integrations_tests_41
threads: 8
postgres:
type: postgres
Expand All @@ -42,13 +42,13 @@ integration_tests:
pass: "{{ env_var('CI_POSTGRES_DBT_PASS') }}"
dbname: "{{ env_var('CI_POSTGRES_DBT_DBNAME') }}"
port: 5432
schema: jira_integrations_tests_3
schema: jira_integrations_tests_41
threads: 8
databricks:
catalog: "{{ env_var('CI_DATABRICKS_DBT_CATALOG') }}"
host: "{{ env_var('CI_DATABRICKS_DBT_HOST') }}"
http_path: "{{ env_var('CI_DATABRICKS_DBT_HTTP_PATH') }}"
schema: jira_integrations_tests_3
schema: jira_integrations_tests_41
threads: 2
token: "{{ env_var('CI_DATABRICKS_DBT_TOKEN') }}"
type: databricks
5 changes: 2 additions & 3 deletions integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: 'jira_integration_tests'
version: '0.15.0'
version: '0.16.0'
config-version: 2
profile: 'integration_tests'


vars:
jira_source:
jira_schema: jira_integrations_tests_3
jira_schema: jira_integrations_tests_41
jira_comment_identifier: "comment"
jira_component_identifier: "component"
jira_epic_identifier: "epic"
Expand Down
1 change: 0 additions & 1 deletion integration_tests/packages.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@

packages:
- local: ../
4 changes: 3 additions & 1 deletion integration_tests/seeds/field.csv
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ timeoriginalestimate,2020-11-23 22:20:39.685,false,false,Original Estimate
creator,2020-11-23 22:20:39.711,false,false,Creator
issuerestriction,2020-11-23 22:20:39.643,false,false,Restrict to
components,2020-11-23 22:20:40.643,false,false,Components
summary,2020-11-23 22:20:41.553,false,false,Summary
summary,2020-11-23 22:20:41.553,false,false,Summary
epiclink,2020-11-23 22:20:41.553,false,false,Epic-Link
epic,2020-11-23 22:20:41.553,false,false,Epic
4 changes: 3 additions & 1 deletion integration_tests/seeds/issue_field_history.csv
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ created,10027,2020-11-10 19:19:41.472,2020-11-12 12:20:53.478,2020-11-10T19:19:4
customfield_10104,10027,2020-11-10 19:19:41.472,2020-11-12 12:20:53.472,3.0
summary,10027,2020-11-10 19:19:41.472,2020-11-12 12:20:53.500,"As a developer, I'd like to update story status during the sprint >> Click the Active sprints link at the top right of the screen to go to the Active sprints where the current Sprint's items can be updated"
components,10018,2020-11-10 19:19:41.472,2020-11-19 12:20:53.500,10019
summary,10018,2020-11-10 19:19:41.472,2020-11-19 12:20:53.500,10026
summary,10018,2020-11-10 19:19:41.472,2020-11-19 12:20:53.500,10026
epic,10015,2020-11-10 19:19:41.472,2020-11-19 12:20:53.500,1111111
epiclink,10018,2020-11-10 19:19:41.472,2020-11-12 12:20:53.500,https://ulr-here/epic-key
2 changes: 1 addition & 1 deletion models/intermediate/int_jira__issue_epic.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ order_epic_links as (

select
issue_id,
cast(field_value as {{ dbt.type_int() }} ) as epic_issue_id,
cast(field_value as {{ dbt.type_string() }} ) as epic_issue_id,

row_number() over (
partition by issue_id order by updated_at desc
Expand Down
5 changes: 3 additions & 2 deletions models/intermediate/int_jira__issue_type_parents.sql
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ issue_enriched_with_epics as (
select

issue.*,
coalesce(parent_issue_id, epic_issue_id) as revised_parent_issue_id
coalesce(cast(parent_issue_id as {{ dbt.type_string() }}), cast(epic_issue_id as {{ dbt.type_string() }})) as revised_parent_issue_id

from issue

Expand Down Expand Up @@ -65,7 +65,8 @@ add_parent_info as (
issue_w_types

-- do a left join so we can grab all issue types from this table in `issue_join`
left join issue_w_types as parent on issue_w_types.revised_parent_issue_id = parent.issue_id
left join issue_w_types as parent
on cast(issue_w_types.revised_parent_issue_id as {{ dbt.type_string() }}) = cast(parent.issue_id as {{ dbt.type_string() }})

)

Expand Down
2 changes: 1 addition & 1 deletion models/intermediate/int_jira__issue_users.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ with issue as (

select
issue_id,
coalesce(revised_parent_issue_id, parent_issue_id) as parent_issue_id,
coalesce(cast(revised_parent_issue_id as {{ dbt.type_string() }}), cast(parent_issue_id as {{ dbt.type_string() }})) as parent_issue_id,

{{ dbt_utils.star(from=ref('int_jira__issue_type_parents'),
except=except_columns) }}
Expand Down
Loading