SomeFire commented on a change in pull request #38: IGNITE-9849 Remove invalid builds from the selection URL: https://github.com/apache/ignite-teamcity-bot/pull/38#discussion_r226609952
########## File path: ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/build/GetBuildTestFailures.java ########## @@ -158,6 +164,50 @@ public TestFailuresSummary getBuildTestFails( return res; } + /** + * Mark builds as "valid" or "invalid" for a specific user. + * + * @param buildId Build id. + * @param isValid Is valid. + * @param field Field. + * @param srv Server. + */ + @GET + @Path("condition") + public SimpleResult setBuildCondition( + @QueryParam("buildId") Integer buildId, + @QueryParam("isValid") Boolean isValid, + @QueryParam("field") String field, + @QueryParam("serverId") String srv) { + String srvId = isNullOrEmpty(srv) ? "apache" : srv; + + if (buildId == null || isValid == null) + return new SimpleResult("<i class='fas fa-exclamation-circle'></i><br><br>" + (buildId == null ? + ("BuildId" + (isValid == null ? "and condition are" : "is")) : "Build condition is") + " <b>null</b>!"); + + final ITcHelper tcHelper = CtxListener.getTcHelper(ctx); + + final ICredentialsProv prov = ICredentialsProv.get(req); + Review comment: ```suggestion if (!prov.hasAccess(serverId)) throw ServiceUnauthorizedException.noCreds(serverId); ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services