bitcrowd / tickety-tick

A browser extension that helps you name branches and write better commit messages
MIT License
57 stars 10 forks source link

Additional information for the JIRA adapters #372

Closed andreasknoepfle closed 3 months ago

andreasknoepfle commented 1 year ago

For us it would be super useful if we could have the jira EPIC and software component as a configurable placeholder, that does not do anything for the other adapters. Like this it could very well be in the default set still.

andreasknoepfle commented 1 year ago

Due to some other ideas in releasing, this just got a bit less of an issue. But I guess it would still be nice to have.

pmeinhardt commented 1 year ago

Great idea for a new feature. 👌


I think that would entail some more significant changes to the templating. Here's why I think so:

You probably want more logic in the templates in this case. Rather than not rendering anything in place of, say,

… {{ jira.epic }} …

you'll probably want something more like this:

… {% if jira.epic !== '' %} {{ jira.epic }}{% endif %} …

Otherwise you'll end up with whitespace/formatting inconsistencies when trying to use the same template for Jira and non-Jira projects.

It's possible, but will make the template implementation more complex (and possibly more error-prone).


For some additional background:

In a previous iteration, when I first added the configurable message/branch/command templates to Tickety-Tick, I actually went for a proper templating system first. I don't remember which ones I've tried, but the issue all of those existing ones had, was that in the web-extension, certain JavaScript features are disallowed. Notably eval() and Function("…") to dynamically evaluate template expressions raised exceptions.

I think more expressive templates (ideally based off an existing template syntax) would be a great addition to Tickety-Tick. It will probably take some re-evaluation of the template engines out there and checking them in a web-extension (security) context or - as pointed out - implementing at least conditional template sections.


Just my 2 cents. 🤷

I may have overlooked a simpler but still user-friendly approach.

Happy to brainstorm some more or flesh out further steps. ❤️

klappradla commented 3 months ago

As this topic is not as pressing as it was (because of Jira automations, Moco, etc.) I'd close this for now in order to keep TicketyTick as simple as it is.

Of course, feel free to reopen the discussion whenever you want or think it's necessary 🤗