forcedotcom / git2gus

A Github application to keep issues in sync with Agile Accelerator
https://lwc-gus-bot.herokuapp.com
BSD 3-Clause "New" or "Revised" License
27 stars 16 forks source link

Rename CREATE_WORK_ITEM to CREATE_OR_UPDATE_WORK_ITEM #83

Open edmorley opened 4 years ago

edmorley commented 4 years ago

Whilst reading the source to try and work out what gets synced and when, I saw the hook name CREATE_WORK_ITEM here: https://github.com/forcedotcom/git2gus/blob/dbe8c53c7bf703d7607ca595ef0a473a843eb3b9/api/actions/createWorkItem.js#L118

...which led to the impression that a work item would always be created whenever new labels were added. ie: If I swapped the labels around and switched from a bug to a user story, it seemed like Git2Gus would create a second work item rather than updating the original one.

However looking closer at the hook, I see it actually creates OR updates: https://github.com/forcedotcom/git2gus/blob/dbe8c53c7bf703d7607ca595ef0a473a843eb3b9/api/hooks/issues-hook/index.js#L20-L21

Renaming CREATE_WORK_ITEM to CREATE_OR_UPDATE_WORK_ITEM would make this clearer :-)