diff --git a/Jenkinsfile b/Jenkinsfile index ce259c3c76..936709565a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,6 +6,11 @@ // Import pipeline library for utility methods & classes: // ansicolor(), Notifier, PullRequests, Strings +@Field +public static final String PIPELINE_LIBRARY_BRANCH = 'master' + +// GROOVY-3278: +// Using referenced String constant as value of Annotation causes compile error @Library('zanata-pipeline-library@master') import org.zanata.jenkins.Notifier import org.zanata.jenkins.PullRequests @@ -21,7 +26,10 @@ PullRequests.ensureJobDescription(env, manager, steps) @Field def notify // initialiser must be run separately (bindings not available during compilation phase) -notify = new Notifier(env, steps, currentBuild, 'https://github.com/zanata/zanata-platform.git', 'Jenkinsfile') +notify = new Notifier(env, steps, currentBuild, + 'https://github.com/zanata/zanata-platform.git', + 'Jenkinsfile', PIPELINE_LIBRARY_BRANCH, +) // we can't set these values yet, because we need a node to look at the environment @Field @@ -183,6 +191,8 @@ timestamps { // Build and Unit Tests // The built files are stashed for integration tests in other nodes. stage('Build') { + // Now SCM commit info is available (after checkout scm) + notify.startBuilding() // validate translations sh """./run-clean.sh ./mvnw -e -V \ diff --git a/build-tools/src/test/java/TestJenkinsfile.java b/build-tools/src/test/java/TestJenkinsfile.java index 30affe43d3..d451abc973 100644 --- a/build-tools/src/test/java/TestJenkinsfile.java +++ b/build-tools/src/test/java/TestJenkinsfile.java @@ -70,7 +70,14 @@ public void setUp() throws Exception { @SuppressWarnings("unchecked") Map a = (Map) args; if (TRUE.equals(a.get("returnStdout"))) { - return "JBOSS_HTTP_PORT=51081\nSMTP_PORT=34765\n"; + String script = a.get("script").toString(); + if (script.contains("allocate-jboss-ports")) { + return "JBOSS_HTTP_PORT=51081\nSMTP_PORT=34765\n"; + } + // Notifier.groovy in zanata-pipeline-library uses this: + if (script.contains("git ls-remote")) { + return "1234567890 abcdef\n"; + } } if (TRUE.equals(a.get("returnStatus"))) { return 0; @@ -105,6 +112,8 @@ public Object call(Object... args) { steps.put("echo", Closure.IDENTITY); steps.put("emailext", Closure.IDENTITY); steps.put("emailextrecipients", Closure.IDENTITY); + steps.put("library", Closure.IDENTITY); + steps.put("sh", Closure.IDENTITY); steps.put("step", Closure.IDENTITY); // we need this for CPS mode MethodClosure.ALLOW_RESOLVE = true; diff --git a/docs/release-notes.md b/docs/release-notes.md index 8b029c5028..429b6191ef 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -2,23 +2,39 @@ ##### Changes * [ZNTA-2184](https://zanata.atlassian.net/browse/ZNTA-2184) - A better icon for role Requests in language * [ZNTA-2172](https://zanata.atlassian.net/browse/ZNTA-2172) - Profile page should not render anything with inactive/non-existing account + * [ZNTA-2171](https://zanata.atlassian.net/browse/ZNTA-2171) - Storybook: reject with reason HISTORY UI + * [ZNTA-2156](https://zanata.atlassian.net/browse/ZNTA-2156) - Storybook: reject with reason MODAL UI + * [ZNTA-2147](https://zanata.atlassian.net/browse/ZNTA-2147) - Editor heading -> flex + * [ZNTA-2134](https://zanata.atlassian.net/browse/ZNTA-2134) - Help pages required for Version TM Merge + * [ZNTA-2119](https://zanata.atlassian.net/browse/ZNTA-2119) - Turn on storybook addons + * [ZNTA-2118](https://zanata.atlassian.net/browse/ZNTA-2118) - Upgrade webpack to 2.x or 3.x (if 3.x looks stable enough) + * [ZNTA-2116](https://zanata.atlassian.net/browse/ZNTA-2116) - Create tri-state checkbox component + * [ZNTA-2093](https://zanata.atlassian.net/browse/ZNTA-2093) - TM Merge no longer has "Next Condition" + * [ZNTA-2091](https://zanata.atlassian.net/browse/ZNTA-2091) - Please widen the vertical scroll bar on the right hand side of the editor * [ZNTA-2015](https://zanata.atlassian.net/browse/ZNTA-2015) - Allow admin to change a user's name * [ZNTA-1969](https://zanata.atlassian.net/browse/ZNTA-1969) - Add Project Name to Version Sort in Version Merge Modal Story * [ZNTA-1865](https://zanata.atlassian.net/browse/ZNTA-1865) - Feature: Enhance Version Merge feature * [ZNTA-1684](https://zanata.atlassian.net/browse/ZNTA-1684) - Replace 'tribes' with 'languages/locales' + * [ZNTA-975](https://zanata.atlassian.net/browse/ZNTA-975) - Add advanced search dropdown to React editor + * [ZNTA-709](https://zanata.atlassian.net/browse/ZNTA-709) - Set up consistent node versioning in projects ##### Bug Fixes * [ZNTA-2220](https://zanata.atlassian.net/browse/ZNTA-2220) - Dialogs have a "scroll line" on the right * [ZNTA-2208](https://zanata.atlassian.net/browse/ZNTA-2208) - NotSupportedException on po/csv glossary import * [ZNTA-2206](https://zanata.atlassian.net/browse/ZNTA-2206) - 404 page not found on help from more options + * [ZNTA-2201](https://zanata.atlassian.net/browse/ZNTA-2201) - updateGitHubCommitStatus should use the correct SHA in correct repo * [ZNTA-2191](https://zanata.atlassian.net/browse/ZNTA-2191) - Need HAccount index to find enabled users efficiently * [ZNTA-2187](https://zanata.atlassian.net/browse/ZNTA-2187) - Version "Settings" tab does not show up * [ZNTA-2186](https://zanata.atlassian.net/browse/ZNTA-2186) - CSS conflict in editor inputs * [ZNTA-2178](https://zanata.atlassian.net/browse/ZNTA-2178) - Zanata Client API (old endpoints support) + * [ZNTA-2168](https://zanata.atlassian.net/browse/ZNTA-2168) - Editor background for active translation needs fixing * [ZNTA-2152](https://zanata.atlassian.net/browse/ZNTA-2152) - Remove css that overrides frontend dropdown + icons * [ZNTA-2149](https://zanata.atlassian.net/browse/ZNTA-2149) - TM Merge pop-up closes on second mouse click. * [ZNTA-2148](https://zanata.atlassian.net/browse/ZNTA-2148) - Fix alignment of notification modal icons + * [ZNTA-2131](https://zanata.atlassian.net/browse/ZNTA-2131) - #, %, & are not treated as search chars on glossary search. * [ZNTA-1970](https://zanata.atlassian.net/browse/ZNTA-1970) - Side nav doesn't align correctly on some devices + * [ZNTA-1786](https://zanata.atlassian.net/browse/ZNTA-1786) - write lock when shutting down application server + * [ZNTA-234](https://zanata.atlassian.net/browse/ZNTA-234) - [REST] /stats/proj/gcc2/iter/4.9.0/doc/{docId} failed to handle the file with directory ----------------------- diff --git a/docs/user-guide/projects/project-settings.md b/docs/user-guide/projects/project-settings.md index 6493d0718a..1d3eee2a93 100644 --- a/docs/user-guide/projects/project-settings.md +++ b/docs/user-guide/projects/project-settings.md @@ -38,6 +38,11 @@ For example, a git checkout URL is provided for the Zanata server project that c $ git clone git@github.com:zanata/zanata-platform.git ``` +### Private + +This setting determines if the project will be visible to all Zanata users or just subset of users. +When it is activated, the project will only visible to assigned users and only translators in your [project team](/user-guide/projects/project-team/) are allowed to translate your project. + ### Make this project read only This button is used to set a project to read-only, which prevents translations being entered. This may be useful in some cases, but should be used sparingly so that translators are able to work on your project. @@ -90,12 +95,6 @@ To remove a language from the list of available locales, first move the cursor o ------------ -### Invite only - -This setting determines which users will be allowed to translate your project. -When it is inactive, any translator can translate your project into their language, -as long as their language is enabled in your project. When the setting is active, -only translators in your [project team](/user-guide/projects/project-team/) are allowed to translate your project. ### Validations diff --git a/server/docker/README.md b/server/docker/README.md index b52a0c0040..d967167a04 100644 --- a/server/docker/README.md +++ b/server/docker/README.md @@ -87,9 +87,18 @@ This script will start a docker container with the database. You can inspect the The container by default will map the mysql data directory to `$HOME/docker-volumes/zanata-mariadb`. This can be changed from the script file. -If you give the script ```-e`` option (stands for ephemeral), it will not use any volume mapping. This means any data you save in Zanata using this mode will be lost once the container is stopped. It will also remove itself once stopped (e.g. no need to call docker rm zanatadb). This is useful for testing a fresh copy of Zanata instance. +If you give the script ```-e``` option (stands for ephemeral), it will not use any volume mapping. This means any data you save in Zanata using this mode will be lost once the container is stopped. It will also remove itself once stopped (e.g. no need to call docker rm zanatadb). This is useful for testing a fresh copy of Zanata instance. + +The database can be accessed via tcp via the `mysql` command or by using any database administration tool. You need to get the actual mapped port on the host by typing `docker ps`, e.g. based on the below output I would use port 32768: + +```sh +$ docker ps +... PORTS NAMES +... 0.0.0.0:32768->3306/tcp zanatadb +``` + +After you have the port, you can connect locally to the database. The following is an example to accomplish this using a locally installed mysql client: -The database can be accessed via tcp via the `mysql` command or by using any database administration tool. You need to get the actual mapped port on the host by typing `docker ps`. After you have the port, you can connect locally to the database. The following is an example to accomplish this using a locally installed mysql client: ```sh mysql --protocol=tcp -h localhost --port= -uzanata -pzanatapw zanata diff --git a/server/functional-test/pom.xml b/server/functional-test/pom.xml index 45347e96c4..80a017ddb8 100644 --- a/server/functional-test/pom.xml +++ b/server/functional-test/pom.xml @@ -298,9 +298,10 @@ com.google.guava guava + - commons-lang - commons-lang + org.apache.commons + commons-lang3 @@ -350,7 +351,7 @@ org.jetbrains.kotlin - kotlin-stdlib + kotlin-stdlib-jre8 org.jetbrains.kotlin diff --git a/server/functional-test/src/test/java/org/zanata/feature/manual/CopyTransTuningTest.java b/server/functional-test/src/test/java/org/zanata/feature/manual/CopyTransTuningTest.java index cf2b3a5bfb..6dfa52de4c 100644 --- a/server/functional-test/src/test/java/org/zanata/feature/manual/CopyTransTuningTest.java +++ b/server/functional-test/src/test/java/org/zanata/feature/manual/CopyTransTuningTest.java @@ -1,7 +1,6 @@ package org.zanata.feature.manual; import com.google.common.collect.ImmutableList; -import org.apache.commons.lang.RandomStringUtils; import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -15,6 +14,8 @@ import org.zanata.util.SampleDataRule; import org.zanata.util.ZanataRestCaller; import java.util.List; + +import static org.zanata.util.RandomStringUtils.randomAlphabetic; import static org.zanata.util.ZanataRestCaller.*; /** @@ -72,7 +73,7 @@ private static TextFlow[] generateTextFlows(int numOfTextFlows) { TextFlow[] textFlows = new TextFlow[numOfTextFlows]; for (int i = 0; i < textFlows.length; i++) { textFlows[i] = buildTextFlow("res" + i, - RandomStringUtils.randomAlphabetic(10)); + randomAlphabetic(10)); } return textFlows; } diff --git a/server/gwt-shared/src/main/java/org/zanata/webtrans/shared/model/UserOptions.java b/server/gwt-shared/src/main/java/org/zanata/webtrans/shared/model/UserOptions.java index 44d649d62f..2bfceef018 100644 --- a/server/gwt-shared/src/main/java/org/zanata/webtrans/shared/model/UserOptions.java +++ b/server/gwt-shared/src/main/java/org/zanata/webtrans/shared/model/UserOptions.java @@ -32,15 +32,15 @@ public enum UserOptions implements IsSerializable { private String persistentName; public static String editor() { - return "editor"; + return "gwt.editor"; } public static String doc() { - return "doc"; + return "gwt.doc"; } public static String common() { - return "common"; + return "gwt.common"; } UserOptions(String persistentName) { diff --git a/server/pom.xml b/server/pom.xml index b6a02aad9c..c7cf56c67f 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -22,7 +22,7 @@ 2.1.2 10 0 - 1.1.4-3 + 1.1.51 2.9.1 2.19.1 @@ -141,7 +141,13 @@ org.apache.commons commons-lang3 - 3.4 + 3.6 + + + + org.apache.commons + commons-text + 1.1 + + + Migrate gwt app settings to use distinct key. + + + UPDATE HAccountOption SET name = CONCAT('gwt.', name) + + + diff --git a/server/services/src/main/resources/db/changelogs/db.changelog-4.4.xml b/server/services/src/main/resources/db/changelogs/db.changelog-4.4.xml new file mode 100644 index 0000000000..9e0c03b1bb --- /dev/null +++ b/server/services/src/main/resources/db/changelogs/db.changelog-4.4.xml @@ -0,0 +1,26 @@ + + + + + + Rename allowGlobalTranslation to privateProject + + + + + Migrate allowGlobalTranslation data to privateProject + UPDATE HProject SET privateProject= !privateProject + + + + Update default value for HProject.privateProject column + + + + + diff --git a/server/services/src/main/resources/db/db.changelog.xml b/server/services/src/main/resources/db/db.changelog.xml index a8c6c32113..d0964b384f 100644 --- a/server/services/src/main/resources/db/db.changelog.xml +++ b/server/services/src/main/resources/db/db.changelog.xml @@ -49,6 +49,8 @@ file="changelogs/db.changelog-4.2.xml" /> +