-
Notifications
You must be signed in to change notification settings - Fork 13
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
[pivotal] Assign a Shortcut Team/Group to Imported Epics & Stories #59
Merged
Conversation
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
NOTE: Shortcut's REST API uses the word "Group" to refer to the concept that in Shortcut's UI and documentation is called "Team". A Team is a group of Shortcut users; stories can belong to one Team; epics can belong to multiple Teams; and other entities in the Shortcut domain model can also have Team associations (e.g., Iterations, Objectives). You should completely ignore any references to `team_id` that you see in the Shortcut REST API; these refer to a deprecated concept and are not referring to the Team/Group concept used here. The config.json file must include a "group_id" entry which may be null or the ID of a Shortcut Team/Group. This commit leverages that entry to assign this Team/Group to every epic and story imported into Shortcut.
While working on tests in a previous commit, I noticed that we were not providing a `requested_by_id` field in our Shortcut "Create Epic" calls and thought this was an oversight. Upon further inspection, Pivotal's domain model does not expose a requester (or owners) for epics, and thus their export leaves those entries blank as well. In practice this means every imported epic is requested by the importing user and has no owners. The previous commit, however, does assign a Team/Group to imported epics, so that is at least one way for users to group epics as they import them.
This entry will have the story's epic_id if one is assigned, or a blank of no epic is assigned or the row is for a non-story entity.
The Pivotal export relies on labels to demonstrate epic membership of Pivotal stories. This importer follows a similar approach, whereby we rely on a shared label between epics and stories to determine epic membership. A bug was introduced that erroneously mapped our timestamped labels to an epic, thus marking every story being imported as belong to a specific epic. This commit corrects that behavior by ignoring that PIVOTAL_TO_SHORTCUT_RUN_LABEL lable when processing the mapping of epics and their labels. This commit also refactors the code to make the essential act of assigning an epic_id entry to stories being prepared for import testable, and adds a test to demonstrate that epic_id is only assigned if the story is in fact labeled with that epic.
cdemwell
approved these changes
Apr 12, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've read through this and I haven't found anything clearly broken. Assuming tests pass, I'm good to merge this.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
From the commit for assign Team/Group
NOTE: Shortcut's REST API uses the word "Group" to refer to the
concept that in Shortcut's UI and documentation is called "Team". A
Team is a group of Shortcut users; stories can belong to one Team;
epics can belong to multiple Teams; and other entities in the Shortcut
domain model can also have Team associations (e.g., Iterations,
Objectives). You should completely ignore any references to
team_id
that you see in the Shortcut REST API; these refer to a deprecated
concept and are not referring to the Team/Group concept used here.
The config.json file must include a "group_id" entry which may be null
or the ID of a Shortcut Team/Group. This commit leverages that entry
to assign this Team/Group to every epic and story imported into
Shortcut.
From the commit fixing the story <> epic relationship
The Pivotal export relies on labels to demonstrate epic membership of
Pivotal stories. This importer follows a similar approach, whereby we
rely on a shared label between epics and stories to determine epic
membership.
A bug was introduced that erroneously mapped our timestamped labels to
an epic, thus marking every story being imported as belong to a
specific epic.
This commit corrects that behavior by ignoring that
PIVOTAL_TO_SHORTCUT_RUN_LABEL lable when processing the mapping of
epics and their labels.
This commit also refactors the code to make the essential act of
assigning an epic_id entry to stories being prepared for import
testable, and adds a test to demonstrate that epic_id is only assigned
if the story is in fact labeled with that epic.
Other
This PR also includes improved validation of the
config.json
data and tests that validation.