How to prevent a Java project from building when TODO present

前端 未结 3 1022
挽巷
挽巷 2021-01-24 02:33

Recently code containing a debugging override was release to production. The code was clearly marked

// TODO - Remove before releasing to production

<
3条回答
  •  余生分开走
    2021-01-24 02:57

    You could use the following plugin to detect TODO and/or FIXME (or any other comment text you define) and mark the build as unstable or failed if any are found: Task Scanner Plugin

    However this analysis would be performed after the code is pulled down so it would depend on how your move-to-production process is set up. This plugin would allow you to mark the build job as failed (once you add it as a post-build step) and you could then cancel any downstream jobs if TODO was detected. If your move-to-production job is downstream from this build job, this would solve your problem.

提交回复
热议问题