The Unified and Autonomous Development Platform
Show incompatibilities link in help menu
Robin Shenac86cf97a601
diff --git a/license.txt b/license.txtindex 791f3a16db..d01e399e7b 100644--- a/license.txt+++ b/license.txt@@ -1,6 +1,6 @@The MIT License-Copyright (c) 2018-2020 onedev.io+Copyright (c) 2018-2022 onedev.ioPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealdiff --git a/server-core/src/main/java/io/onedev/server/maintenance/Upgrade.java b/server-core/src/main/java/io/onedev/server/maintenance/Upgrade.javaindex b36ba901c4..8c151ca6e9 100644--- a/server-core/src/main/java/io/onedev/server/maintenance/Upgrade.java+++ b/server-core/src/main/java/io/onedev/server/maintenance/Upgrade.java@@ -584,6 +584,7 @@ public class Upgrade extends DefaultPersistManager {FileUtils.copyFile(new File(Bootstrap.installDir, "readme.txt"), new File(upgradeDir, "readme.txt"));FileUtils.copyFile(new File(Bootstrap.installDir, "license.txt"), new File(upgradeDir, "license.txt"));FileUtils.copyFile(new File(Bootstrap.installDir, "version.txt"), new File(upgradeDir, "version.txt"));+ FileUtils.copyFile(new File(Bootstrap.installDir, "build.txt"), new File(upgradeDir, "build.txt"));} catch (IOException e) {throw new RuntimeException(e);}diff --git a/server-core/src/main/java/io/onedev/server/web/page/layout/LayoutPage.html b/server-core/src/main/java/io/onedev/server/web/page/layout/LayoutPage.htmlindex 89a9abf5d4..1314449f3e 100644--- a/server-core/src/main/java/io/onedev/server/web/page/layout/LayoutPage.html+++ b/server-core/src/main/java/io/onedev/server/web/page/layout/LayoutPage.html@@ -24,6 +24,7 @@<a wicket:id="docLink" class="dropdown-item" target="_blank">Documentation</a><a href="https://code.onedev.io/projects/160/issues?query=%22State%22+is+%22Open%22" class="dropdown-item" target="_blank">Support & Bug Report</a><a href="/help/api" class="dropdown-item" target="_blank">RESTful API</a>+ <a wicket:id="incompatibilities" class="dropdown-item" target="_blank">Incompatibilities</a></div></div></div>diff --git a/server-core/src/main/java/io/onedev/server/web/page/layout/LayoutPage.java b/server-core/src/main/java/io/onedev/server/web/page/layout/LayoutPage.javaindex e769558994..dc839f4925 100644--- a/server-core/src/main/java/io/onedev/server/web/page/layout/LayoutPage.java+++ b/server-core/src/main/java/io/onedev/server/web/page/layout/LayoutPage.java@@ -1,11 +1,15 @@package io.onedev.server.web.page.layout;+import java.io.File;+import java.io.IOException;import java.io.Serializable;+import java.nio.charset.StandardCharsets;import java.util.ArrayList;import java.util.List;import javax.servlet.http.Cookie;+import org.apache.commons.io.FileUtils;import org.apache.shiro.subject.PrincipalCollection;import org.apache.wicket.Component;import org.apache.wicket.RestartResponseAtInterceptPageException;@@ -32,6 +36,7 @@ import org.apache.wicket.request.mapper.parameter.PageParameters;import com.google.common.collect.Lists;+import io.onedev.commons.bootstrap.Bootstrap;import io.onedev.commons.loader.AppLoader;import io.onedev.commons.loader.Plugin;import io.onedev.server.OneDev;@@ -301,6 +306,20 @@ public abstract class LayoutPage extends BasePage {Plugin product = AppLoader.getProduct();sidebar.add(new Label("productVersion", "Ver. " + product.getVersion()));sidebar.add(new ExternalLink("docLink", OneDev.getInstance().getDocRoot() + "/"));+ try {+ String buildNumber = FileUtils.readFileToString(+ new File(Bootstrap.installDir, "build.txt"),+ StandardCharsets.UTF_8);+ if (buildNumber.length() != 0) {+ sidebar.add(new ExternalLink("incompatibilities",+ "https://code.onedev.io/projects/160/builds/" + buildNumber.trim()+ + "/markdown/Incompatibilities/doc/incompatibilities.md"));+ } else {+ sidebar.add(new WebMarkupContainer("incompatibilities").setVisible(false));+ }+ } catch (IOException e) {+ throw new RuntimeException(e);+ }WebMarkupContainer topbar = new WebMarkupContainer("topbar");add(topbar);diff --git a/server-product/system/build.txt b/server-product/system/build.txtnew file mode 100644index 0000000000..e69de29bb2diff --git a/server-product/system/license.txt b/server-product/system/license.txtindex 8fe3f97915..d9c187c834 100644--- a/server-product/system/license.txt+++ b/server-product/system/license.txt@@ -1,6 +1,6 @@The MIT License-Copyright (c) 2018 OneDev Pty+Copyright (c) 2018-2022 OneDev PtyPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to deal