Opened 4 years ago

Closed 4 years ago

# Validate configuration

Reported by: Owned by: ejucovy ejucovy normal WorkflowNotificationPlugin normal

### Description

There should be some validation of the configuration and its templates. Otherwise, an invalid configuration will mean that end users will see trac errors when the plugin is in use.

At minimum, this should verify that the configuration is well formed, and that every templated configuration value can be parsed by genshi's TextTemplate class without error.

There should be a trac-admin command to invoke this, and perhaps also a configuration option for wiring it into an environment setup participant.

### comment:1 Changed 4 years ago by ejucovy

• Resolution set to fixed
• Status changed from new to closed

The next release will include a trac-admin command that does this and prints an error message if a piece of the configuration fails to validate:

$trac-admin /my/env/ workflow_notifications validate Syntax error in reviewed.body Hi$ticket.reporter,\n\nYour request has been reviewed by $change.author. It is now assigned to${ticket.owner}.\n\n{% if change and change.comment %}$change.author said:\n\n$change.comment\n\n{% end %}-----\nTicket URL: $link\n$project.name <${project.url or abs_href()}>\n$project.descr
TemplateSyntaxError: unexpected EOF while parsing (, line 1) (<string>, line 1)