Page MenuHomePhabricator

Gerrit: Convert Velocity templates to Closure Templates
Closed, ResolvedPublic

Description

This task cannot be completed till the day we migrate to gerrit 2.14. Low priority.

But we need to create a patch that at least does this, as Velocity templates are deprecated, per gerrit's 2.14 release notes https://www.gerritcodereview.com/releases/2.14.md#Emails

I doint know what type of warnings they will generate in the logs. It's best to convert instead of seeing a ton of Deperecated in the logs.

Event Timeline

Paladox renamed this task from Covert Velocity templates to Closure Templates to Gerrit: Covert Velocity templates to Closure Templates .Feb 13 2017, 9:52 PM
Paladox triaged this task as Low priority.
Paladox lowered the priority of this task from Low to Lowest.
Paladox moved this task from Bugs & stuff to WMF customizations on the Gerrit board.

Here's the 3 velocity templates we use:

demon@cobalt /var/lib/gerrit2/review_site/etc$ find . -name '*.vm'
./its/templates/DraftPublished.vm
./its/templates/PatchSetCreated.vm
./mail/ChangeSubject.vm

As long as the Closure templates use a different file extension, I don't see why can't go ahead and support both for the time being (gerrit will ignore ones it doesn't recognize).

Also worth comparing our existing ones against new upstreams to see if they need any adjustment in language.

Here's the 3 velocity templates we use:

demon@cobalt /var/lib/gerrit2/review_site/etc$ find . -name '*.vm'
./its/templates/DraftPublished.vm
./its/templates/PatchSetCreated.vm
./mail/ChangeSubject.vm

As long as the Closure templates use a different file extension, I don't see why can't go ahead and support both for the time being (gerrit will ignore ones it doesn't recognize).

Also worth comparing our existing ones against new upstreams to see if they need any adjustment in language.

Here is a patch converting some of them https://github.com/gerrit-review/gerrit/commit/42639e43149197bc3a2e31e973ec53fee5ac93dc and https://github.com/gerrit-review/gerrit/commit/93ccc93607caeae3a67f9cc148568e8a6ac7897a

Here is a patch converting some of them https://github.com/gerrit-review/gerrit/commit/42639e43149197bc3a2e31e973ec53fee5ac93dc and https://github.com/gerrit-review/gerrit/commit/93ccc93607caeae3a67f9cc148568e8a6ac7897a

So with ChangeSubject.soy, I think we can just copy upstreams new version into Puppet (identical to ChangeSubject.vm). Our existing install will ignore them. The only change we need to make is prefixing the line with [Gerrit] per how we do right now.

For the ITS ones, the structure will probably be similar. But do any of its-* plugins use Soy yet?

For the ITS ones, the structure will probably be similar. But do any of its-* plugins use Soy yet?

Answering my own question: no, they don't

This comment was removed by Paladox.

Change 337613 had a related patch set uploaded (by Paladox):
Gerrit: Converts ChangeSubject Velocity template into soy template

https://gerrit.wikimedia.org/r/337613

Change 337613 merged by Dzahn:
Gerrit: Converts ChangeSubject Velocity template into soy template

https://gerrit.wikimedia.org/r/337613

We should knock out the ITS templates so we can resolve this.

Yep, the its-base ones will have to stay as its-base doesn't support closure yet.

I've been testing gerrit 2.14 for about 1+ weeks now. I will tested removing the vm template for emails now.

Change 353693 had a related patch set (by Paladox) published:
[operations/puppet@production] Gerrit: Remove velocity templates but keep the ones for its-base

https://gerrit.wikimedia.org/r/353693

Upstream are now removing support for velocity.

mmodell renamed this task from Gerrit: Covert Velocity templates to Closure Templates to Gerrit: Convert Velocity templates to Closure Templates .Oct 4 2017, 10:01 PM

Upstream have removed support for velocity now. I will now have to try and find someone to merge my soy support change in its-base :).

I will also have to remove support for velocity in its-base to get the plugin to compile now.

This should not affect 2.14 or 2.15.

@demon did we remove the .vm templates on gerrit? my changes only stopped re adding them. We need to remove them so that soy is used :).

demon claimed this task.

Just deleted them now.