-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- This commit is work in progress towards reflecting some Tracker story edits back to the linked GitHub issue. - Refactor the tracker import endpoint into its own package. - Add a way to pass GitHub and Tracker API tokens into the app via the ytt templates. - Add a new endpoint which implements the Tracker webhook spec. - When the new Tracker webhook listener is called, check to see if any of the incoming story change events are stories that are linked to a GitHub issue. - Includes unit tests for the new Tracker webhook.
- Loading branch information
Showing
14 changed files
with
1,182 additions
and
133 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
module issues2stories | ||
|
||
go 1.15 | ||
|
||
require ( | ||
github.com/stretchr/testify v1.6.1 | ||
) |
This file contains 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,10 @@ | ||
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= | ||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= | ||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= | ||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= | ||
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= | ||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= | ||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= |
61 changes: 61 additions & 0 deletions
61
internal/trackeractivity/testdata/create_feature_story_in_icebox.json
This file contains 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,61 @@ | ||
{ | ||
"kind": "story_create_activity", | ||
"guid": "2453999_5703", | ||
"project_version": 5703, | ||
"message": "Ryan Richard added this feature", | ||
"highlight": "added", | ||
"changes": [ | ||
{ | ||
"kind": "story", | ||
"change_type": "create", | ||
"id": 176650922, | ||
"new_values": { | ||
"id": 176650922, | ||
"project_id": 2453999, | ||
"name": "Test story... please ignore", | ||
"story_type": "feature", | ||
"current_state": "unscheduled", | ||
"requested_by_id": 3344177, | ||
"owner_ids": [ | ||
], | ||
"label_ids": [ | ||
], | ||
"follower_ids": [ | ||
], | ||
"created_at": 1611623067000, | ||
"updated_at": 1611623067000, | ||
"before_id": 176518978, | ||
"after_id": 175402743, | ||
"blocked_story_ids": [ | ||
], | ||
"labels": [ | ||
] | ||
}, | ||
"name": "Test story... please ignore", | ||
"story_type": "feature" | ||
} | ||
], | ||
"primary_resources": [ | ||
{ | ||
"kind": "story", | ||
"id": 176650922, | ||
"name": "Test story... please ignore", | ||
"story_type": "feature", | ||
"url": "https://www.pivotaltracker.com/story/show/176650922" | ||
} | ||
], | ||
"secondary_resources": [ | ||
], | ||
"project": { | ||
"kind": "project", | ||
"id": 2453999, | ||
"name": "Example Project" | ||
}, | ||
"performed_by": { | ||
"kind": "person", | ||
"id": 3344177, | ||
"name": "Ryan Richard", | ||
"initials": "RR" | ||
}, | ||
"occurred_at": 1611623067000 | ||
} |
140 changes: 140 additions & 0 deletions
140
internal/trackeractivity/testdata/edit_add_label_to_story.json
This file contains 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,140 @@ | ||
{ | ||
"kind": "story_update_activity", | ||
"guid": "2453999_5710", | ||
"project_version": 5710, | ||
"message": "Ryan Richard edited this bug", | ||
"highlight": "edited", | ||
"changes": [ | ||
{ | ||
"kind": "label", | ||
"change_type": "update", | ||
"id": 22689375, | ||
"original_values": { | ||
"counts": { | ||
"number_of_zero_point_stories_by_state": { | ||
"accepted": 1, | ||
"started": 0, | ||
"finished": 0, | ||
"unstarted": 0, | ||
"planned": 0, | ||
"delivered": 0, | ||
"unscheduled": 0, | ||
"rejected": 0, | ||
"kind": "counts_by_story_state" | ||
}, | ||
"sum_of_story_estimates_by_state": { | ||
"accepted": 0, | ||
"started": 0, | ||
"finished": 0, | ||
"unstarted": 0, | ||
"planned": 0, | ||
"delivered": 0, | ||
"unscheduled": 0, | ||
"rejected": 0, | ||
"kind": "counts_by_story_state" | ||
}, | ||
"number_of_stories_by_state": { | ||
"accepted": 1, | ||
"started": 0, | ||
"finished": 0, | ||
"unstarted": 0, | ||
"planned": 0, | ||
"delivered": 0, | ||
"unscheduled": 0, | ||
"rejected": 0, | ||
"kind": "counts_by_story_state" | ||
}, | ||
"kind": "story_counts" | ||
} | ||
}, | ||
"new_values": { | ||
"counts": { | ||
"number_of_zero_point_stories_by_state": { | ||
"accepted": 1, | ||
"started": 0, | ||
"finished": 0, | ||
"unstarted": 0, | ||
"planned": 0, | ||
"delivered": 0, | ||
"unscheduled": 1, | ||
"rejected": 0, | ||
"kind": "counts_by_story_state" | ||
}, | ||
"sum_of_story_estimates_by_state": { | ||
"accepted": 0, | ||
"started": 0, | ||
"finished": 0, | ||
"unstarted": 0, | ||
"planned": 0, | ||
"delivered": 0, | ||
"unscheduled": 0, | ||
"rejected": 0, | ||
"kind": "counts_by_story_state" | ||
}, | ||
"number_of_stories_by_state": { | ||
"accepted": 1, | ||
"started": 0, | ||
"finished": 0, | ||
"unstarted": 0, | ||
"planned": 0, | ||
"delivered": 0, | ||
"unscheduled": 1, | ||
"rejected": 0, | ||
"kind": "counts_by_story_state" | ||
}, | ||
"kind": "story_counts" | ||
} | ||
}, | ||
"name": "good-first-issue" | ||
}, | ||
{ | ||
"kind": "story", | ||
"change_type": "update", | ||
"id": 176650922, | ||
"original_values": { | ||
"label_ids": [ | ||
|
||
], | ||
"updated_at": 1611623762000, | ||
"labels": [ | ||
|
||
] | ||
}, | ||
"new_values": { | ||
"label_ids": [ | ||
22689375 | ||
], | ||
"updated_at": 1611623836000, | ||
"labels": [ | ||
"good-first-issue" | ||
] | ||
}, | ||
"name": "Test story... please ignore", | ||
"story_type": "bug" | ||
} | ||
], | ||
"primary_resources": [ | ||
{ | ||
"kind": "story", | ||
"id": 176650922, | ||
"name": "Test story... please ignore", | ||
"story_type": "bug", | ||
"url": "https://www.pivotaltracker.com/story/show/176650922" | ||
} | ||
], | ||
"secondary_resources": [ | ||
|
||
], | ||
"project": { | ||
"kind": "project", | ||
"id": 2453999, | ||
"name": "Example Project" | ||
}, | ||
"performed_by": { | ||
"kind": "person", | ||
"id": 3344177, | ||
"name": "Ryan Richard", | ||
"initials": "RR" | ||
}, | ||
"occurred_at": 1611623836000 | ||
} |
Oops, something went wrong.