Skip to content
Permalink
Browse files
Board: Summary of non-fixed failures as new screen (phase 1) - Fixes #…
…140.

Signed-off-by: Dmitriy Pavlov <dpavlov@apache.org>
  • Loading branch information
dspavlov committed Aug 6, 2019
1 parent 1e998ae commit d5c757b86fddd58ad53ee593d60087e3e92ce1e4
Show file tree
Hide file tree
Showing 49 changed files with 1,317 additions and 88 deletions.
@@ -25,7 +25,7 @@
import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.ci.issue.Issue;
import org.apache.ignite.ci.issue.IssueKey;
import org.apache.ignite.ci.issue.IssuesStorage;
import org.apache.ignite.tcbot.engine.issue.IssuesStorage;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.tcservice.model.result.Build;
import org.jetbrains.annotations.NotNull;
@@ -106,11 +106,6 @@ public static <K, V> CacheConfiguration<K, V> getCacheV3TxConfig(String name) {
return TcHelperDb.<K, V>getCacheV3Config(name).setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
}

public static <K, V> CacheConfiguration<K, V> getCacheV2TxConfig(String name) {
return CacheConfigs.<K, V>getCacheV2Config(name).setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);

}

public static class LocalOnlyTcpDiscoveryIpFinder implements TcpDiscoveryIpFinder {
/** Port. */
private int port;
@@ -35,7 +35,7 @@
* list for specific {@link org.apache.ignite.ci.web.model.ContributionKey}.
* It's needed for proper changing of status and result of
* {@link org.apache.ignite.ci.web.model.VisaRequest} by {@link org.apache.ignite.ci.observer.ObserverTask}.
* If happens an attempt to add observation
* If happens an attempt to addBuild observation
* for {@link org.apache.ignite.ci.web.model.ContributionKey} while current
* observation is not finished, then current observation will be marked as
* cancelled and overwritten by the new one.
@@ -22,7 +22,7 @@
import org.apache.ignite.ci.db.TcHelperDb;
import org.apache.ignite.githubignited.IGitHubConnIgnited;
import org.apache.ignite.ci.issue.Issue;
import org.apache.ignite.ci.issue.IssuesStorage;
import org.apache.ignite.tcbot.engine.issue.IssuesStorage;
import org.apache.ignite.jiraignited.JiraTicketDao;

/**
@@ -35,8 +35,8 @@
import org.apache.ignite.Ignition;
import org.apache.ignite.ci.issue.Issue;
import org.apache.ignite.ci.issue.IssueKey;
import org.apache.ignite.ci.issue.IssueType;
import org.apache.ignite.ci.issue.IssuesStorage;
import org.apache.ignite.tcbot.engine.issue.IssueType;
import org.apache.ignite.tcbot.engine.issue.IssuesStorage;
import org.apache.ignite.ci.tcbot.user.UserAndSessionsStorage;
import org.apache.ignite.ci.teamcity.ignited.BuildRefCompacted;
import org.apache.ignite.ci.teamcity.ignited.fatbuild.FatBuildCompacted;
@@ -49,7 +49,6 @@
import org.apache.ignite.tcignited.ITeamcityIgnited;
import org.apache.ignite.tcignited.build.FatBuildDao;
import org.apache.ignite.tcignited.buildref.BuildRefDao;
import org.apache.ignite.tcignited.history.BuildStartTimeStorage;
import org.apache.ignite.tcservice.model.hist.BuildRef;
import org.apache.ignite.tcservice.model.result.Build;
import org.apache.ignite.tcservice.util.XmlUtil;
@@ -26,15 +26,15 @@
import javax.inject.Provider;
import org.apache.ignite.Ignite;
import org.apache.ignite.ci.db.Ignite1Init;
import org.apache.ignite.ci.issue.IssuesStorage;
import org.apache.ignite.ci.tcbot.conf.LocalFilesBasedConfig;
import org.apache.ignite.ci.tcbot.issue.IIssuesStorage;
import org.apache.ignite.ci.tcbot.trends.MasterTrendsService;
import org.apache.ignite.ci.tcbot.user.IUserStorage;
import org.apache.ignite.ci.tcbot.user.UserAndSessionsStorage;
import org.apache.ignite.tcbot.common.conf.IDataSourcesConfigSupplier;
import org.apache.ignite.tcbot.engine.TcBotEngineModule;
import org.apache.ignite.tcbot.engine.conf.ITcBotConfig;
import org.apache.ignite.tcbot.engine.issue.IIssuesStorage;
import org.apache.ignite.tcbot.engine.issue.IssuesStorage;
import org.apache.ignite.tcbot.notify.TcBotNotificationsModule;
import org.apache.ignite.tcbot.persistence.scheduler.SchedulerModule;
import org.apache.ignite.githubignited.GitHubIgnitedModule;
@@ -93,7 +93,6 @@ public class TcBotWebAppModule extends AbstractModule {
//todo remove duplication of instances for base and for overriden class
bind(IDataSourcesConfigSupplier.class).to(LocalFilesBasedConfig.class).in(new SingletonScope());
bind(IUserStorage.class).to(UserAndSessionsStorage.class).in(new SingletonScope());
bind(IIssuesStorage.class).to(IssuesStorage.class).in(new SingletonScope());
bind(MasterTrendsService.class).in(new SingletonScope());
bind(ITcBotBgAuth.class).to(TcBotBgAuthImpl.class).in(new SingletonScope());
}
@@ -35,7 +35,8 @@
import javax.inject.Provider;
import org.apache.ignite.ci.issue.Issue;
import org.apache.ignite.ci.issue.IssueKey;
import org.apache.ignite.ci.issue.IssueType;
import org.apache.ignite.tcbot.engine.issue.IIssuesStorage;
import org.apache.ignite.tcbot.engine.issue.IssueType;
import org.apache.ignite.ci.jobs.CheckQueueJob;
import org.apache.ignite.tcbot.engine.tracked.DisplayMode;
import org.apache.ignite.tcbot.notify.ISlackSender;
@@ -24,9 +24,9 @@
import javax.inject.Provider;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.ci.db.TcHelperDb;
import org.apache.ignite.ci.user.TcHelperUser;
import org.apache.ignite.ci.user.UserSession;
import org.apache.ignite.tcbot.persistence.CacheConfigs;
import org.jetbrains.annotations.Nullable;

public class UserAndSessionsStorage implements IUserStorage {
@@ -38,7 +38,7 @@ public class UserAndSessionsStorage implements IUserStorage {
private volatile Ignite ignite;

public IgniteCache<String, TcHelperUser> users() {
return getIgnite().getOrCreateCache(TcHelperDb.getCacheV2TxConfig(USERS));
return getIgnite().getOrCreateCache(CacheConfigs.<String, TcHelperUser>getCacheV2TxConfig(USERS));
}

public Ignite getIgnite() {
@@ -56,7 +56,7 @@ public Ignite getIgnite() {
}

private IgniteCache<String, UserSession> sessions() {
return getIgnite().getOrCreateCache(TcHelperDb.getCacheV2TxConfig(USER_SESSIONS));
return getIgnite().getOrCreateCache(CacheConfigs.<String, UserSession>getCacheV2TxConfig(USER_SESSIONS));
}

/** {@inheritDoc} */
@@ -0,0 +1,55 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ignite.ci.web.rest.board;

import com.google.inject.Injector;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import org.apache.ignite.ci.user.ITcBotUserCreds;
import org.apache.ignite.ci.web.CtxListener;
import org.apache.ignite.tcbot.engine.board.BoardService;
import org.apache.ignite.tcbot.engine.ui.BoardSummaryUi;

@Path(BoardRestService.BOARD)
@Produces(MediaType.APPLICATION_JSON)
public class BoardRestService {
public static final String BOARD = "board";

/** Servlet Context. */
@Context
private ServletContext ctx;

/** Current Request. */
@Context
private HttpServletRequest req;

@GET
@Path("summary")
public BoardSummaryUi getSummary() {

final ITcBotUserCreds creds = ITcBotUserCreds.get(req);
final Injector injector = CtxListener.getInjector(ctx);
final BoardService boardSvc = injector.getInstance(BoardService.class);

return boardSvc.summary(creds);
}
}
@@ -27,8 +27,8 @@
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import org.apache.ignite.ci.issue.IssueList;
import org.apache.ignite.ci.tcbot.issue.IIssuesStorage;
import org.apache.ignite.tcbot.engine.ui.IssueListUi;
import org.apache.ignite.tcbot.engine.issue.IIssuesStorage;
import org.apache.ignite.ci.web.CtxListener;
import org.apache.ignite.ci.web.model.SimpleResult;
import org.apache.ignite.tcbot.engine.ui.UpdateInfo;
@@ -58,7 +58,7 @@ public UpdateInfo getAllTestFailsUpdates(@Nullable @QueryParam("branch") String

@GET
@Path("list")
public IssueList listIssues(@Nullable @QueryParam("branch") String branchOpt,
public IssueListUi listIssues(@Nullable @QueryParam("branch") String branchOpt,
@Nullable @QueryParam("count") Integer count,
@Nullable @QueryParam("checkAllLogs") Boolean checkAllLogs) {
Injector injector = CtxListener.getInjector(ctx);
@@ -67,7 +67,7 @@ public IssueList listIssues(@Nullable @QueryParam("branch") String branchOpt,

IIssuesStorage issues = injector.getInstance(IIssuesStorage.class);

IssueList issueList = new IssueList(issues.allIssues().collect(Collectors.toList()));
IssueListUi issueList = new IssueListUi(issues.allIssues().collect(Collectors.toList()));

issueList.branch = branch;

@@ -140,7 +140,7 @@ public TcHelperUserUi getUserData(@Nullable @QueryParam("login") final String lo
tcHelperUserUi.data.add(credsUi);
}

//todo if user is not current disable add creds
//todo if user is not current disable addBuild creds
return tcHelperUserUi;
}

0 comments on commit d5c757b

Please sign in to comment.