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

[pivotal] Assign a Shortcut Team/Group to Imported Epics & Stories #59

Merged
merged 6 commits into from
Apr 12, 2024

Conversation

semperos
Copy link
Member

@semperos semperos commented Apr 12, 2024

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.

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.
@semperos semperos requested a review from opoku as a code owner April 12, 2024 13:14
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.
Copy link
Contributor

@cdemwell cdemwell left a 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.

@semperos semperos merged commit 5c6c6f5 into main Apr 12, 2024
2 checks passed
@semperos semperos deleted the daniel/sc-264702/shortcut-team-per-import-run branch April 12, 2024 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants