Template with invalid chars can be created but not modified or deleted

Just noticed the template name is unique.

So I tried to add the organization into the template name with this pattern: ORG/template-name.yaml. Additionally I tried to add a gitea template variable string within drone template name.

Unfortunately this broke my sqlite :wink: … These templates can not be edited or remove with the drone ui + drone cli:

To explain the templates hell here:

  • There is a Gitea organization named Templates
  • I tried to add the organization name as prefix for a drone template as workaround for the unique names: <Organization>/<Name>.yaml

:notebook: Additional Notes

  • :pushpin: It seems like the problem here is the /. It gets interpreted as part of the path for the API call. Maybe it’s worth adding a regex validation for the template name input field to avoid this?
  • :pushpin: Is it save to delete the template items with a sqlite command like DELETE FROM templates WHERE id = 999 ?

Hi @OCram85 apologies for the delay in reply.

Yeah that is a bug - bit of an edge case but a bug none the less. - I’ll raise a ticket but can’t promise a turnaround time.

feel free to delete it from the db as you suggest - I wouldn’t expect any issues to arise

1 Like