rorybyrne / git-plan

Git Plan - a better workflow for git
MIT License
181 stars 5 forks source link

feat: swappable plan providers #83

Open indigoviolet opened 3 years ago

indigoviolet commented 3 years ago

I understand you probably won't develop this yourself, but wanted to put it on your/this community's radar anyway: support for this workflow in magit would be great for emacs users.

I'm very excited that this tool exists: a few weeks ago I was looking to scratch a similar itch. I plan on trying to see how I can integrate git plan into a dev-journal-driven git work flow (which isn't so different than a github or linear-driven flow #33, #24) - hopefully this can be designed with the ability to swap in different plan providers and templates.

rorybyrne commented 3 years ago

I think adding native support for other tools is outside the scope of this project, but I opened an issue (https://github.com/synek/git-plan/issues/86) to add JSON output support so that others can integrate git plan easily.

The plan-provider idea is really interesting! If you could tidy up the title above (and remove the magit reference, or open a new issue for it) then we can use this issue to discuss the API for swappable plan-providers.

rorybyrne commented 3 years ago

As a starting point, one possible entrypoint for plan-provider functionality is a subcommand like the following:

git plan add --from linear --id XYZ-450
git plan add --from github --id 65

A plan provider could implement an interface that looks something like:

class PlanProvider(ABC):

    def get_by_id(self, id: str) -> Commit:
        raise NotImplementedError()
rorybyrne commented 3 years ago

One issue I have with this is that Github/Linear issues usually map to branches, whereas our tool currently maps each plan to a commit in a branch.

It will still work fine, but there is a slight abstraction-confusion which we shouldn't ignore.