diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 60c414014106faf0391fea277f6f560e3ce709fd..ee1096aa39093b66c43095737d32d29225c5dd40 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -4,7 +4,6 @@ name-template: $NEXT_PATCH_VERSION version-template: $MAJOR.$MINOR tag-template: jenkins-$NEXT_MINOR_VERSION -# TODO: categories are YAGNI for now, until we can extract `type` somehow exclude-labels: - reverted - no-changelog @@ -17,6 +16,7 @@ change-template: |- pull: $NUMBER authors: - $AUTHOR + template: | **Disclaimer**: This is an automatically generated changelog draft for Jenkins weekly releases. See https://jenkins.io/changelog/ for the official changelogs. @@ -24,6 +24,26 @@ template: | ```yaml $CHANGES ``` + +# Categories will be commented out, because we use YAML +# Now we use categories only for sorting +categories: + - title: Major BUGs and regressions + labels: + - major-bug + - regression-fix + - title: Major RFE + label: major-rfe + - title: RFEs + label: rfe + - title: Bug fixes + label: bug + - title: Localization + label: localization + # TODO: consider merging category or changing emojis + - title: Internal/Developer changes + label: internal + replacers: - search: '/\[*JENKINS-(\d+)\]*\s*-*\s*/g' replace: |- @@ -34,3 +54,6 @@ replacers: message: |- issue: replace: "issue:" + + - search: "##" + replace: "#" diff --git a/Jenkinsfile b/Jenkinsfile index c7dc2954de90c3667a5dc07f88d41437ea6b270a..95c9becb3fd0161ff306ac7c7598634d4b8ca205 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,8 @@ def failFast = false properties([buildDiscarder(logRotator(numToKeepStr: '50', artifactNumToKeepStr: '3')), durabilityHint('PERFORMANCE_OPTIMIZED')]) -def buildTypes = ['Linux', 'Windows'] +// TODO: Restore 'Windows' once https://groups.google.com/forum/#!topic/jenkinsci-dev/v9d-XosOp2s is resolved +def buildTypes = ['Linux'] def jdks = [8, 11] def builds = [:] @@ -72,7 +73,9 @@ for(j = 0; j < jdks.size(); j++) { } }} +// TODO: Restore ATH once https://groups.google.com/forum/#!topic/jenkinsci-dev/v9d-XosOp2s is resolved // TODO: ATH flow now supports Java 8 only, it needs to be reworked (INFRA-1690) +/* builds.ath = { node("docker&&highmem") { // Just to be safe @@ -94,7 +97,7 @@ builds.ath = { runATH jenkins: fileUri, metadataFile: metadataPath } } -} +}*/ builds.failFast = failFast parallel builds diff --git a/README.md b/README.md index 1cc7c70e4e5c75d1499a6d4dbde9711e0bddf578..ee4ed648cbcbe3526a3e8c6870de015b5d2f9f60 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ [![Docker Pulls](https://img.shields.io/docker/pulls/jenkins/jenkins.svg)](https://hub.docker.com/r/jenkins/jenkins/) In a nutshell, Jenkins is the leading open-source automation server. -Built with Java, it provides over 1000 plugins to support automating virtually anything, +Built with Java, it provides over 1600 [plugins](https://plugins.jenkins.io/) to support automating virtually anything, so that humans can actually spend their time doing things machines cannot. # What to Use Jenkins for and When to Use It @@ -34,32 +34,11 @@ Follow the [contributing](CONTRIBUTING.md) file. All information about Jenkins can be found on our [website]. Follow us on Twitter [@jenkinsci]. # License -Jenkins is **licensed** under the **[MIT License]**. The terms of the license are as follows: +Jenkins is **licensed** under the **[MIT License]**. - The MIT License (MIT) - - Copyright (c) 2004 Kohsuke Kawaguchi, Sun Microsystems Inc., and a number of other contributors. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. [ButlerImage]: https://jenkins.io/sites/default/files/jenkins_logo.png -[MIT License]: https://github.com/jenkinsci/jenkins/raw/master/LICENSE.txt +[MIT License]: https://github.com/jenkinsci/jenkins/blob/master/LICENSE.txt [Mirrors]: http://mirrors.jenkins-ci.org [GitHub]: https://github.com/jenkinsci/jenkins [website]: https://jenkins.io/ diff --git a/core/src/main/java/hudson/ExtensionComponent.java b/core/src/main/java/hudson/ExtensionComponent.java index 98e03969f3cc631ad458b9f5b276b9979d108728..d274e11204de3847f381d56c7672b1344bfd8199 100644 --- a/core/src/main/java/hudson/ExtensionComponent.java +++ b/core/src/main/java/hudson/ExtensionComponent.java @@ -88,8 +88,8 @@ public class ExtensionComponent implements Comparable> public int compareTo(ExtensionComponent that) { double a = this.ordinal(); double b = that.ordinal(); - if (a>b) return -1; - if (a 0) return -1; + if (Double.compare(a, b) < 0) return 1; // make the order bit more deterministic among extensions of the same ordinal if (this.instance instanceof Descriptor && that.instance instanceof Descriptor) { diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index 003c5e9ddb08cf48fcf7b22623a6f4a9f2ffdcd8..5dba97e6bbe9ff2bebf8f67389942dd7c5910ffe 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -1664,7 +1664,7 @@ public class Functions { for( int i=0; i=0) buf.append(ch); diff --git a/core/src/main/java/hudson/PluginManager.java b/core/src/main/java/hudson/PluginManager.java index 75e0873c4380fe057088bdd01a4376776251d0b0..56065582aeece6814ecd20aa07cdf67a2762c620 100644 --- a/core/src/main/java/hudson/PluginManager.java +++ b/core/src/main/java/hudson/PluginManager.java @@ -1114,7 +1114,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas try(final JarFile jarFile = jarURLConnection.getJarFile()) { final JarEntry entry = (entryName != null && jarFile != null) ? jarFile.getJarEntry(entryName) : null; - if (entry != null && jarFile != null) { + if (entry != null) { try(InputStream i = jarFile.getInputStream(entry)) { byte[] manifestBytes = IOUtils.toByteArray(i); in = new ByteArrayInputStream(manifestBytes); diff --git a/core/src/main/java/hudson/TcpSlaveAgentListener.java b/core/src/main/java/hudson/TcpSlaveAgentListener.java index 307d321e69a89e0acc4c46a719612e552b16ceaf..f7918d6bd8d49807a1bb6f38b7a98543070101e2 100644 --- a/core/src/main/java/hudson/TcpSlaveAgentListener.java +++ b/core/src/main/java/hudson/TcpSlaveAgentListener.java @@ -27,7 +27,6 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.io.ByteArrayInputStream; import java.io.SequenceInputStream; import java.io.Writer; -import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.security.interfaces.RSAPublicKey; import javax.annotation.Nullable; @@ -140,7 +139,7 @@ public final class TcpSlaveAgentListener extends Thread { @Nullable public String getIdentityPublicKey() { RSAPublicKey key = InstanceIdentityProvider.RSA.getPublicKey(); - return key == null ? null : new String(Base64.encodeBase64(key.getEncoded()), Charset.forName("UTF-8")); + return key == null ? null : new String(Base64.encodeBase64(key.getEncoded()), StandardCharsets.UTF_8); } /** diff --git a/core/src/main/java/hudson/Util.java b/core/src/main/java/hudson/Util.java index 73c3f03a9a703059a2c09ca8e6ff941714135407..76611efbd97a5416ead4aab03bab5a239102d40b 100644 --- a/core/src/main/java/hudson/Util.java +++ b/core/src/main/java/hudson/Util.java @@ -866,29 +866,50 @@ public class Util { CharBuffer buf = null; char c; for (int i = 0, m = s.length(); i < m; i++) { - c = s.charAt(i); - if (c > 122 || uriMap[c]) { + int codePoint = Character.codePointAt(s, i); + if((codePoint&0xffffff80)==0) { // 1 byte + c = s.charAt(i); + if (c > 122 || uriMap[c]) { + if (!escaped) { + out = new StringBuilder(i + (m - i) * 3); + out.append(s, 0, i); + enc = StandardCharsets.UTF_8.newEncoder(); + buf = CharBuffer.allocate(1); + escaped = true; + } + // 1 char -> UTF8 + buf.put(0, c); + buf.rewind(); + try { + ByteBuffer bytes = enc.encode(buf); + while (bytes.hasRemaining()) { + byte b = bytes.get(); + out.append('%'); + out.append(toDigit((b >> 4) & 0xF)); + out.append(toDigit(b & 0xF)); + } + } catch (CharacterCodingException ex) { + } + } else if (escaped) { + out.append(c); + } + } else { if (!escaped) { out = new StringBuilder(i + (m - i) * 3); out.append(s, 0, i); - enc = StandardCharsets.UTF_8.newEncoder(); - buf = CharBuffer.allocate(1); escaped = true; } - // 1 char -> UTF8 - buf.put(0,c); - buf.rewind(); - try { - ByteBuffer bytes = enc.encode(buf); - while (bytes.hasRemaining()) { - byte b = bytes.get(); - out.append('%'); - out.append(toDigit((b >> 4) & 0xF)); - out.append(toDigit(b & 0xF)); - } - } catch (CharacterCodingException ex) { } - } else if (escaped) { - out.append(c); + + byte[] bytes = new String(new int[] { codePoint }, 0, 1).getBytes(StandardCharsets.UTF_8); + for(int j=0;j> 4) & 0xF)); + out.append(toDigit(bytes[j] & 0xF)); + } + + if(Character.charCount(codePoint) > 1) { + i++; // we processed two characters + } } } return escaped ? out.toString() : s; diff --git a/core/src/main/java/hudson/cli/SetBuildDescriptionCommand.java b/core/src/main/java/hudson/cli/SetBuildDescriptionCommand.java index 332292912535905fa727f7e00e7d74eeb10528f0..a689a6e2e5f4040a33ff992bc82795e646a163db 100644 --- a/core/src/main/java/hudson/cli/SetBuildDescriptionCommand.java +++ b/core/src/main/java/hudson/cli/SetBuildDescriptionCommand.java @@ -1,5 +1,6 @@ package hudson.cli; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import hudson.Extension; import hudson.model.Job; import hudson.model.Run; @@ -9,6 +10,9 @@ import java.io.Serializable; import org.apache.commons.io.IOUtils; import org.kohsuke.args4j.Argument; + +// TODO: Remove Serializable +@SuppressFBWarnings(value = "SE_NO_SERIALVERSIONID", justification = "The Serializable should be removed.") @Extension public class SetBuildDescriptionCommand extends CLICommand implements Serializable { diff --git a/core/src/main/java/hudson/model/AbstractItem.java b/core/src/main/java/hudson/model/AbstractItem.java index 4a7524d1be3f80b445a91f84042636710481ed8d..eae1e64e4014a60906e50ade8b52bd67b931de7d 100644 --- a/core/src/main/java/hudson/model/AbstractItem.java +++ b/core/src/main/java/hudson/model/AbstractItem.java @@ -275,6 +275,11 @@ public abstract class AbstractItem extends Actionable implements Item, HttpDelet */ @Restricted(NoExternalUse.class) public @Nonnull FormValidation doCheckNewName(@QueryParameter String newName) { + + if (!isNameEditable()) { + return FormValidation.error("Trying to rename an item that does not support this operation."); + } + // TODO: Create an Item.RENAME permission to use here, see JENKINS-18649. if (!hasPermission(Item.CONFIGURE)) { if (parent instanceof AccessControlled) { @@ -351,6 +356,11 @@ public abstract class AbstractItem extends Actionable implements Item, HttpDelet * you can use this method. */ protected void renameTo(final String newName) throws IOException { + + if (!isNameEditable()) { + throw new IOException("Trying to rename an item that does not support this operation."); + } + // always synchronize from bigger objects first final ItemGroup parent = getParent(); String oldName = this.name; diff --git a/core/src/main/java/hudson/model/FileParameterValue.java b/core/src/main/java/hudson/model/FileParameterValue.java index 33336cd6b2f36ad009ec0fe8abd1337b5eff6aa1..4e059196e61c6f7ad2abdef12c4e51feb5d2ea03 100644 --- a/core/src/main/java/hudson/model/FileParameterValue.java +++ b/core/src/main/java/hudson/model/FileParameterValue.java @@ -67,6 +67,7 @@ import org.kohsuke.stapler.StaplerResponse; public class FileParameterValue extends ParameterValue { private static final String FOLDER_NAME = "fileParameters"; private static final Pattern PROHIBITED_DOUBLE_DOT = Pattern.compile(".*[\\\\/]\\.\\.[\\\\/].*"); + private static final long serialVersionUID = -143427023159076073L; /** * Escape hatch for SECURITY-1074, fileParameter used to escape their expected folder. diff --git a/core/src/main/java/hudson/model/HealthReport.java b/core/src/main/java/hudson/model/HealthReport.java index 7b675382723c64ae5051bd016bbcb9706f78cde5..6f82347b371fd0ac00ba2d4848c23fe0a1ab0321 100644 --- a/core/src/main/java/hudson/model/HealthReport.java +++ b/core/src/main/java/hudson/model/HealthReport.java @@ -63,6 +63,8 @@ public class HealthReport implements Serializable, Comparable { private static final String HEALTH_UNKNOWN_IMG = "empty.png"; private static final Map iconIMGToClassMap = new HashMap<>(); + private static final long serialVersionUID = 7451361788415642230L; + static { iconIMGToClassMap.put(HEALTH_OVER_80_IMG, HEALTH_OVER_80); iconIMGToClassMap.put(HEALTH_61_TO_80_IMG, HEALTH_61_TO_80); diff --git a/core/src/main/java/hudson/model/JDK.java b/core/src/main/java/hudson/model/JDK.java index 2aaf9463d55334cf8259f9838dc5e35675fe6d96..9a243cb2ba1a977c4e541ede7b9055ef2c65341f 100644 --- a/core/src/main/java/hudson/model/JDK.java +++ b/core/src/main/java/hudson/model/JDK.java @@ -64,6 +64,7 @@ public final class JDK extends ToolInstallation implements NodeSpecific, En * @since 1.577 */ public static final String DEFAULT_NAME = "(System)"; + private static final long serialVersionUID = -3318291200160313357L; @Restricted(NoExternalUse.class) public static boolean isDefaultName(String name) { diff --git a/core/src/main/java/hudson/model/StringParameterDefinition.java b/core/src/main/java/hudson/model/StringParameterDefinition.java index 3573199a01e4bd596d6a8d2e32569cdc361540b2..c9925665588ff2f878b7257d524089dee5817292 100644 --- a/core/src/main/java/hudson/model/StringParameterDefinition.java +++ b/core/src/main/java/hudson/model/StringParameterDefinition.java @@ -132,7 +132,7 @@ public class StringParameterDefinition extends SimpleParameterDefinition { public ParameterValue createValue(String str) { StringParameterValue value = new StringParameterValue(getName(), str, getDescription()); - if (isTrim() && value!=null) { + if (isTrim()) { value.doTrim(); } return value; diff --git a/core/src/main/java/hudson/model/User.java b/core/src/main/java/hudson/model/User.java index 9c09bb94d0c9e05f3ce126a6f8beaa3875eb3af0..6c6658ed5390e5f5541241f7100ea33921752d64 100644 --- a/core/src/main/java/hudson/model/User.java +++ b/core/src/main/java/hudson/model/User.java @@ -262,13 +262,11 @@ public class User extends AbstractModelObject implements AccessControlled, Descr return id; } - public @Nonnull - String getUrl() { + public @Nonnull String getUrl() { return "user/" + Util.rawEncode(idStrategy().keyFor(id)); } - public @Nonnull - String getSearchUrl() { + public @Nonnull String getSearchUrl() { return "/user/" + Util.rawEncode(idStrategy().keyFor(id)); } @@ -276,8 +274,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr * The URL of the user page. */ @Exported(visibility = 999) - public @Nonnull - String getAbsoluteUrl() { + public @Nonnull String getAbsoluteUrl() { return Jenkins.get().getRootUrl() + getUrl(); } @@ -286,8 +283,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr * This is configurable by the user. */ @Exported(visibility = 999) - public @Nonnull - String getFullName() { + public @Nonnull String getFullName() { return fullName; } @@ -301,8 +297,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr } @Exported - public @CheckForNull - String getDescription() { + public @CheckForNull String getDescription() { return description; } @@ -370,8 +365,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr * @throws UsernameNotFoundException If this user is not a valid user in the backend {@link SecurityRealm}. * @since 1.419 */ - public @Nonnull - Authentication impersonate() throws UsernameNotFoundException { + public @Nonnull Authentication impersonate() throws UsernameNotFoundException { return this.impersonate(this.getUserDetailsForImpersonation()); } @@ -384,8 +378,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr * @return userDetails for the user, in case he's not found but seems legitimate, we provide a userDetails with minimum access * @throws UsernameNotFoundException If this user is not a valid user in the backend {@link SecurityRealm}. */ - public @Nonnull - UserDetails getUserDetailsForImpersonation() throws UsernameNotFoundException { + public @Nonnull UserDetails getUserDetailsForImpersonation() throws UsernameNotFoundException { ImpersonatingUserDetailsService userDetailsService = new ImpersonatingUserDetailsService( Jenkins.get().getSecurityRealm().getSecurityComponents().userDetails ); @@ -431,8 +424,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr * @see #getUserDetailsForImpersonation() */ @Restricted(NoExternalUse.class) - public @Nonnull - Authentication impersonate(@Nonnull UserDetails userDetails) { + public @Nonnull Authentication impersonate(@Nonnull UserDetails userDetails) { return new UsernamePasswordAuthenticationToken(userDetails.getUsername(), "", userDetails.getAuthorities()); } @@ -470,8 +462,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr * @deprecated use {@link User#get(String, boolean, java.util.Map)} */ @Deprecated - public static @Nullable - User get(String idOrFullName, boolean create) { + public static @Nullable User get(String idOrFullName, boolean create) { return get(idOrFullName, create, Collections.emptyMap()); } @@ -491,8 +482,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr * @return An existing or created user. May be {@code null} if a user does not exist and * {@code create} is false. */ - public static @Nullable - User get(String idOrFullName, boolean create, @Nonnull Map context) { + public static @Nullable User get(String idOrFullName, boolean create, @Nonnull Map context) { if (idOrFullName == null) { return null; } @@ -512,8 +502,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr * @return An existing or created user. May be {@code null} if a user does not exist and * {@code create} is false. */ - private static @Nullable - User getOrCreateById(@Nonnull String id, @Nonnull String fullName, boolean create) { + private static @Nullable User getOrCreateById(@Nonnull String id, @Nonnull String fullName, boolean create) { User u = AllUsers.get(id); if (u == null && (create || UserIdMapper.getInstance().isMapped(id))) { u = new User(id, fullName); @@ -546,8 +535,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr * Otherwise use {@link #getOrCreateByIdOrFullName(String)} or {@link #get(String, boolean, Map)}. */ @Deprecated - public static @Nonnull - User get(String idOrFullName) { + public static @Nonnull User get(String idOrFullName) { return getOrCreateByIdOrFullName(idOrFullName); } @@ -577,8 +565,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr * * @since 1.172 */ - public static @CheckForNull - User current() { + public static @CheckForNull User current() { return get(Jenkins.getAuthentication()); } @@ -590,8 +577,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr * @return a {@link User} object for the supplied {@link Authentication} or {@code null} * @since 1.609 */ - public static @CheckForNull - User get(@CheckForNull Authentication a) { + public static @CheckForNull User get(@CheckForNull Authentication a) { if (a == null || a instanceof AnonymousAuthenticationToken) return null; @@ -610,16 +596,14 @@ public class User extends AbstractModelObject implements AccessControlled, Descr * and the user does not exist. * @since 1.651.2 / 2.3 */ - public static @Nullable - User getById(String id, boolean create) { + public static @Nullable User getById(String id, boolean create) { return getOrCreateById(id, id, create); } /** * Gets all the users. */ - public static @Nonnull - Collection getAll() { + public static @Nonnull Collection getAll() { final IdStrategy strategy = idStrategy(); ArrayList users = new ArrayList<>(AllUsers.values()); users.sort((o1, o2) -> strategy.compare(o1.getId(), o2.getId())); @@ -657,8 +641,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr /** * Returns the user name. */ - public @Nonnull - String getDisplayName() { + public @Nonnull String getDisplayName() { return getFullName(); } @@ -686,8 +669,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr */ @SuppressWarnings("unchecked") @WithBridgeMethods(List.class) - public @Nonnull - RunList getBuilds() { + public @Nonnull RunList getBuilds() { return RunList.fromJobs((Iterable) Jenkins.get(). allItems(Job.class)).filter((Predicate>) r -> r instanceof AbstractBuild && relatedTo((AbstractBuild) r)); } @@ -697,8 +679,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr * * @since 1.191 */ - public @Nonnull - Set> getProjects() { + public @Nonnull Set> getProjects() { Set> r = new HashSet<>(); for (AbstractProject p : Jenkins.get().allItems(AbstractProject.class)) if (p.hasParticipant(this)) @@ -706,8 +687,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr return r; } - public @Override - String toString() { + public @Override String toString() { return fullName; } @@ -945,8 +925,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr * @return a possibly empty list * @since 1.498 */ - public @Nonnull - List getAuthorities() { + public @Nonnull List getAuthorities() { if (!Jenkins.get().hasPermission(Jenkins.ADMINISTER)) { return Collections.emptyList(); } @@ -1136,8 +1115,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr * extract user ID from idOrFullName with help from contextual infos. * can return null if no user ID matched the input */ - public abstract @CheckForNull - String resolveCanonicalId(String idOrFullName, Map context); + public abstract @CheckForNull String resolveCanonicalId(String idOrFullName, Map context); /** * Gets priority of the resolver. diff --git a/core/src/main/java/jenkins/util/WindowsUtil.java b/core/src/main/java/hudson/os/WindowsUtil.java similarity index 100% rename from core/src/main/java/jenkins/util/WindowsUtil.java rename to core/src/main/java/hudson/os/WindowsUtil.java diff --git a/core/src/main/java/hudson/security/HudsonAuthenticationEntryPoint.java b/core/src/main/java/hudson/security/HudsonAuthenticationEntryPoint.java index b590dce40842558b814c84d65a179261b08374f7..4b86333f62d22f51980b043f11dc53e021fee445 100644 --- a/core/src/main/java/hudson/security/HudsonAuthenticationEntryPoint.java +++ b/core/src/main/java/hudson/security/HudsonAuthenticationEntryPoint.java @@ -105,16 +105,16 @@ public class HudsonAuthenticationEntryPoint extends AuthenticationProcessingFilt "" + "" + "" + - "\n" + - "\n\n"+ - "Authentication required\n"+ - "\n\n"+ + "-->%n%n"+ ""); // Turn Off "Show Friendly HTTP Error Messages" Feature on the Server Side. // See http://support.microsoft.com/kb/294807 diff --git a/core/src/main/java/hudson/security/csrf/DefaultCrumbIssuer.java b/core/src/main/java/hudson/security/csrf/DefaultCrumbIssuer.java index 91b3e968b85fc411084b6f0f858abf8dfdd091d4..fa3ca73543779a8ae6c44fb6f6be31c5a9ccef8f 100644 --- a/core/src/main/java/hudson/security/csrf/DefaultCrumbIssuer.java +++ b/core/src/main/java/hudson/security/csrf/DefaultCrumbIssuer.java @@ -5,7 +5,7 @@ */ package hudson.security.csrf; -import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.logging.Level; @@ -49,14 +49,8 @@ public class DefaultCrumbIssuer extends CrumbIssuer { @DataBoundConstructor public DefaultCrumbIssuer(boolean excludeClientIPFromCrumb) { - try { - this.md = MessageDigest.getInstance("MD5"); - this.excludeClientIPFromCrumb = excludeClientIPFromCrumb; - } catch (NoSuchAlgorithmException e) { - this.md = null; - this.excludeClientIPFromCrumb = false; - LOGGER.log(Level.SEVERE, "Can't find MD5", e); - } + this.excludeClientIPFromCrumb = excludeClientIPFromCrumb; + initializeMessageDigest(); } public boolean isExcludeClientIPFromCrumb() { @@ -64,14 +58,17 @@ public class DefaultCrumbIssuer extends CrumbIssuer { } private Object readResolve() { + initializeMessageDigest(); + return this; + } + + private void initializeMessageDigest() { try { - this.md = MessageDigest.getInstance("MD5"); + md = MessageDigest.getInstance("SHA-256"); } catch (NoSuchAlgorithmException e) { - this.md = null; - LOGGER.log(Level.SEVERE, "Can't find MD5", e); + md = null; + LOGGER.log(Level.SEVERE, e, () -> "Cannot find SHA-256 MessageDigest implementation."); } - - return this; } /** @@ -110,8 +107,8 @@ public class DefaultCrumbIssuer extends CrumbIssuer { String newCrumb = issueCrumb(request, salt); if ((newCrumb != null) && (crumb != null)) { // String.equals() is not constant-time, but this is - return MessageDigest.isEqual(newCrumb.getBytes(Charset.forName("US-ASCII")), - crumb.getBytes(Charset.forName("US-ASCII"))); + return MessageDigest.isEqual(newCrumb.getBytes(StandardCharsets.US_ASCII), + crumb.getBytes(StandardCharsets.US_ASCII)); } } return false; diff --git a/core/src/main/java/hudson/slaves/SlaveComputer.java b/core/src/main/java/hudson/slaves/SlaveComputer.java index c77d5aed30d9aba423b16736cea5a9ac8978a136..79d168d1a532839a77d63367e777799af5c475c3 100644 --- a/core/src/main/java/hudson/slaves/SlaveComputer.java +++ b/core/src/main/java/hudson/slaves/SlaveComputer.java @@ -26,6 +26,7 @@ package hudson.slaves; import hudson.AbortException; import hudson.FilePath; import hudson.Functions; +import hudson.Main; import hudson.RestrictedSince; import hudson.Util; import hudson.console.ConsoleLogFilter; @@ -87,6 +88,8 @@ import java.security.Security; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.Map; +import java.util.TreeMap; import java.util.concurrent.Future; import java.util.logging.Handler; import java.util.logging.Level; @@ -902,6 +905,32 @@ public class SlaveComputer extends Computer { return channel.call(new DetectOS()) ? "Unix" : "Windows"; } + /** + * Expose real full env vars map from agent for UI presentation + */ + public Map getEnvVarsFull() throws IOException, InterruptedException { + if(getChannel() == null) { + Map env = new TreeMap<> (); + env.put("N/A","N/A"); + return env; + } else { + return getChannel().call(new ListFullEnvironment()); + } + } + + private static class ListFullEnvironment extends MasterToSlaveCallable,IOException> { + public Map call() throws IOException { + Map env = new TreeMap<>(System.getenv()); + if(Main.isUnitTest || Main.isDevelopmentMode) { + // if unit test is launched with maven debug switch, + // we need to prevent forked Maven processes from seeing it, or else + // they'll hang + env.remove("MAVEN_OPTS"); + } + return env; + } + } + private static final Logger logger = Logger.getLogger(SlaveComputer.class.getName()); private static final class SlaveVersion extends MasterToSlaveCallable { diff --git a/core/src/main/java/hudson/util/ArgumentListBuilder.java b/core/src/main/java/hudson/util/ArgumentListBuilder.java index 936a30a9c066b7e4379c83f6c947bcfcb09635ff..d95a628b5af973b086bb61181b18845aad871520 100644 --- a/core/src/main/java/hudson/util/ArgumentListBuilder.java +++ b/core/src/main/java/hudson/util/ArgumentListBuilder.java @@ -353,7 +353,13 @@ public class ArgumentListBuilder implements Serializable, Cloneable { percent = (c == '%'); if (quoted) quotedArgs.append(c); } - if(i == 0 && quoted) quotedArgs.insert(0, '"'); else if (i == 0 && !quoted) quotedArgs.append('"'); + if (i == 0) { + if (quoted) { + quotedArgs.insert(0, '"'); + } else { + quotedArgs.append('"'); + } + } if (quoted) quotedArgs.append('"'); else quotedArgs.append(arg); windowsCommand.add(quotedArgs, mask.get(i)); diff --git a/core/src/main/java/hudson/util/HttpResponses.java b/core/src/main/java/hudson/util/HttpResponses.java index 206db06530f7b75f4c8641dbf110ea5a96bcafcf..975a0941440958d77219e4501b34d0599348d3cc 100644 --- a/core/src/main/java/hudson/util/HttpResponses.java +++ b/core/src/main/java/hudson/util/HttpResponses.java @@ -33,7 +33,7 @@ import javax.annotation.Nonnull; import javax.servlet.ServletException; import java.io.File; import java.io.IOException; -import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.util.Map; /** @@ -142,8 +142,6 @@ public class HttpResponses extends org.kohsuke.stapler.HttpResponses { */ static class JSONObjectResponse implements HttpResponse { - private static final Charset UTF8 = Charset.forName("UTF-8"); - private final JSONObject jsonObject; /** @@ -210,7 +208,7 @@ public class HttpResponses extends org.kohsuke.stapler.HttpResponses { */ @Override public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException { - byte[] bytes = jsonObject.toString().getBytes(UTF8); + byte[] bytes = jsonObject.toString().getBytes(StandardCharsets.UTF_8); rsp.setContentType("application/json; charset=UTF-8"); rsp.setContentLength(bytes.length); rsp.getOutputStream().write(bytes); diff --git a/core/src/main/java/hudson/util/SecretRewriter.java b/core/src/main/java/hudson/util/SecretRewriter.java index 5a11e418471b6c6ede372d2ca5dc1f9dc112ce78..7970f6cd7067fbf877a76bcefc96d25df443fbb5 100644 --- a/core/src/main/java/hudson/util/SecretRewriter.java +++ b/core/src/main/java/hudson/util/SecretRewriter.java @@ -197,7 +197,7 @@ public class SecretRewriter { } private static boolean isBase64(char ch) { - return 0<=ch && ch<128 && IS_BASE64[ch]; + return ch<128 && IS_BASE64[ch]; } private static boolean isBase64(String s) { diff --git a/core/src/main/java/hudson/util/WriterOutputStream.java b/core/src/main/java/hudson/util/WriterOutputStream.java index d3e25b4c048800b88d59fbe12d7abc2e107c5d74..387d4088fef1d419c12d4eafac73472cec464a02 100644 --- a/core/src/main/java/hudson/util/WriterOutputStream.java +++ b/core/src/main/java/hudson/util/WriterOutputStream.java @@ -30,6 +30,7 @@ import java.nio.charset.CharsetDecoder; import java.nio.charset.CodingErrorAction; import java.nio.charset.CoderResult; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.nio.charset.UnsupportedCharsetException; import java.nio.*; @@ -127,7 +128,7 @@ public class WriterOutputStream extends OutputStream { String encoding = System.getProperty("file.encoding"); return Charset.forName(encoding); } catch (UnsupportedCharsetException e) { - return Charset.forName("UTF-8"); + return StandardCharsets.UTF_8; } } } diff --git a/core/src/main/java/hudson/util/XStream2.java b/core/src/main/java/hudson/util/XStream2.java index 5a37dbed711cc5eb9d22d593f9823fb77b6acf94..40d9552c71a8a9912f8fcd42efd4e08f5d89ffb1 100644 --- a/core/src/main/java/hudson/util/XStream2.java +++ b/core/src/main/java/hudson/util/XStream2.java @@ -70,7 +70,7 @@ import java.io.Writer; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; -import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.util.HashSet; import java.util.Map; import java.util.Set; @@ -308,7 +308,7 @@ public class XStream2 extends XStream { * @since 1.504 */ public void toXMLUTF8(Object obj, OutputStream out) throws IOException { - Writer w = new OutputStreamWriter(out, Charset.forName("UTF-8")); + Writer w = new OutputStreamWriter(out, StandardCharsets.UTF_8); w.write("\n"); toXML(obj, w); } diff --git a/core/src/main/java/jenkins/model/AssetManager.java b/core/src/main/java/jenkins/model/AssetManager.java index ed148aac50b52b96a6e84de859ee24bddc9e4d77..4a7513c8b22a2e5e9d341022c79a38092b57f072 100644 --- a/core/src/main/java/jenkins/model/AssetManager.java +++ b/core/src/main/java/jenkins/model/AssetManager.java @@ -3,10 +3,14 @@ package jenkins.model; import hudson.Extension; import hudson.model.UnprotectedRootAction; import java.util.concurrent.TimeUnit; + +import org.apache.commons.lang.StringUtils; import org.jenkinsci.Symbol; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.StaplerResponse; +import javax.annotation.CheckForNull; +import javax.annotation.Nonnull; import javax.servlet.ServletException; import javax.servlet.http.HttpServletResponse; import java.io.IOException; @@ -74,7 +78,11 @@ public class AssetManager implements UnprotectedRootAction { * look for child classloader first. But to support plugins that get split, if the child classloader * doesn't find it, fall back to the parent classloader. */ - private URL findResource(String path) throws IOException { + private @CheckForNull URL findResource(@Nonnull String path) throws IOException { + if (StringUtils.isBlank(path)) { + return null; + } + try { if (path.contains("..")) // crude avoidance of directory traversal attack throw new IllegalArgumentException(path); diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index 458440fd96a2a5321f63eb34e68e1814a393e97e..e7caf609fc35283f8ed892add0577432931028fe 100644 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -3836,10 +3836,10 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve } @RequirePOST - public synchronized HttpRedirect doQuietDown() throws IOException { + public synchronized HttpRedirect doQuietDown() { try { return doQuietDown(false,0); - } catch (InterruptedException e) { + } catch (IOException | InterruptedException e) { throw new AssertionError(); // impossible } } diff --git a/core/src/main/java/jenkins/widgets/HistoryPageFilter.java b/core/src/main/java/jenkins/widgets/HistoryPageFilter.java index f152e6b05e232d09043d583e023f4e3c99101142..6026d11d5697f896c99f2e18cbdbd90666e70680 100644 --- a/core/src/main/java/jenkins/widgets/HistoryPageFilter.java +++ b/core/src/main/java/jenkins/widgets/HistoryPageFilter.java @@ -210,7 +210,7 @@ public class HistoryPageFilter { } } } - } else if (olderThan != null) { + } else { Iterator iter = items.iterator(); while (iter.hasNext()) { Object item = iter.next(); diff --git a/core/src/main/resources/hudson/Messages_pl.properties b/core/src/main/resources/hudson/Messages_pl.properties index fca6881a879818dd85ac263a0ece0ae7e0444b7b..0a48ca1491a30ffa537984a35e2d416ae2700074 100644 --- a/core/src/main/resources/hudson/Messages_pl.properties +++ b/core/src/main/resources/hudson/Messages_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2016-2017, Damian Szczepanik +# Copyright (c) 2016-2019, Damian Szczepanik # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -33,3 +33,4 @@ AboutJenkins.DisplayName=Informacje o Jenkinsie AboutJenkins.Description=Sprawd\u017A wersj\u0119 i licencj\u0119 # {0} v{1} is missing. To fix, install v{1} or later. PluginWrapper.missing=Brakuje wtyczki {0} w wersji {1}. Aby rozwi\u0105za\u0107 problem, zainstaluj wersj\u0119 {1} lub wy\u017Csz\u0105. +PluginWrapper.failed_to_load_dependency=Nie uda\u0142o si\u0119 za\u0142adowa\u0107 wtyczki {0} o wersji {1}. Rozwi\u0105\u017C ten problem w pierwszej kolejno\u015Bci. \ No newline at end of file diff --git a/core/src/main/resources/hudson/PluginManager/index_pl.properties b/core/src/main/resources/hudson/PluginManager/index_pl.properties index 28218ebbaf9db8d575d211c8c0f0f54824eec2be..88b2e384cc002d31003a5ef77aaf88a0da957925 100644 --- a/core/src/main/resources/hudson/PluginManager/index_pl.properties +++ b/core/src/main/resources/hudson/PluginManager/index_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2010, Sun Microsystems, Inc. +# Copyright (c) 2004-2019, Sun Microsystems, Inc., Damian Szczepanik # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -21,7 +21,8 @@ # THE SOFTWARE. All=Wszystkie -None=\u017Badnej +None=\u017Badne Select=Zaznacz UpdatePageDescription=Ta strona zawiera aktualizacje wtyczek, kt\u00F3rych aktualnie u\u017Cywasz UpdatePageLegend=Nieaktywne wiersze oznaczaj\u0105 ju\u017C wykonane aktualizacje, czekaj\u0105ce na restart. Zacieniowane ale aktywne wiersze s\u0105 w trakcie aktualizacji lub zako\u0144czy\u0142y si\u0119 b\u0142\u0119dnie. +Compatible=Kompatybilne diff --git a/core/src/main/resources/hudson/PluginManager/table_pl.properties b/core/src/main/resources/hudson/PluginManager/table_pl.properties index 475890ea442175696f62afb2c774a4913f55cce2..17d4e1905551f69ce671a2dec68134635ca9fcf0 100644 --- a/core/src/main/resources/hudson/PluginManager/table_pl.properties +++ b/core/src/main/resources/hudson/PluginManager/table_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2017, Sun Microsystems, Inc., Damian Szczepanik +# Copyright (c) 2004-2019, Sun Microsystems, Inc., Damian Szczepanik # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -32,4 +32,6 @@ Name=Nazwa No\ updates=Brak dost\u0119pnych aktualizacji Version=Wersja coreWarning=UWAGA: Ten dodatek jest przygotowany dla Jenkinsa w wersji {0} lub nowszej. Mo\u017Ce nie dzia\u0142a\u0107 poprawnie z Twoj\u0105 wersj\u0105 Jenkinsa. -Update\ Center=Centrum aktualizacji \ No newline at end of file +Update\ Center=Centrum aktualizacji +securityWarning= \ +Ostrze\u017Cenie: Ta wtyczka mo\u017Ce nie by\u0107 bezpieczna. Sprawd\u017A nast\u0119puj\u0105ce ostrze\u017Cenia dotycz\u0105ce bezpiecze\u0144stwa: diff --git a/core/src/main/resources/hudson/PluginWrapper/PluginWrapperAdministrativeMonitor/message_pl.properties b/core/src/main/resources/hudson/PluginWrapper/PluginWrapperAdministrativeMonitor/message_pl.properties index 3d164add4dc87e3378b815804556207b8951a9c9..fb0aba242547074c214b2b5508256e8c1fa6559c 100644 --- a/core/src/main/resources/hudson/PluginWrapper/PluginWrapperAdministrativeMonitor/message_pl.properties +++ b/core/src/main/resources/hudson/PluginWrapper/PluginWrapperAdministrativeMonitor/message_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2016, Damian Szczepanik +# Copyright (c) 2016-2019, Damian Szczepanik # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -21,3 +21,5 @@ # THE SOFTWARE. Correct=Napraw Dependency\ errors=Wyst\u0105pi\u0142y b\u0142\u0119dy podczas \u0142adowania niekt\u00F3rych wtyczek +blurbOriginal=Niekt\u00F3re wtyczki nie mog\u0142y zosta\u0107 za\u0142adowane z powodu niewystarczaj\u0105cych zale\u017Cno\u015Bci. Rozwi\u0105\u017C te problemy i uruchom ponownie Jenkinsa, aby korzysta\u0107 z funkcjonalno\u015Bci oferowanych przez te wtyczki. +blurbDerived=Nast\u0119puj\u0105ce wtyczki nie mog\u0142y zosta\u0107 za\u0142adowane z powodu problem\u00F3w wymienionych wy\u017Cej. Rozwi\u0105\u017C je, a wtyczki zostan\u0105 za\u0142adowane ponownie. diff --git a/core/src/main/resources/hudson/atom.jelly b/core/src/main/resources/hudson/atom.jelly index 6a7200641fd83a2ffe445fc6a609935ba94242de..ab5dd11906cd8adc37916b71ecbb0bd14b7172be 100644 --- a/core/src/main/resources/hudson/atom.jelly +++ b/core/src/main/resources/hudson/atom.jelly @@ -23,38 +23,39 @@ THE SOFTWARE. --> -<?xml version="1.0" encoding="UTF-8"?> - - - - ${title} - - - - - 2001-01-01T00:00:00Z - - - ${h.xsDate(adapter.getEntryTimestamp(entries[0]))} - - - - Jenkins Server - - urn:uuid:903deee0-7bfa-11db-9fe1-0800200c9a66 - - - - ${adapter.getEntryTitle(e)} - - ${adapter.getEntryID(e)} - ${h.xsDate(adapter.getEntryTimestamp(e))} - ${h.xsDate(adapter.getEntryTimestamp(e))} - - - ${desc} - - - - + + <?xml version="1.0" encoding="UTF-8"?> + + + ${title} + + + + + 2001-01-01T00:00:00Z + + + ${h.xsDate(adapter.getEntryTimestamp(entries[0]))} + + + + Jenkins Server + + urn:uuid:903deee0-7bfa-11db-9fe1-0800200c9a66 + + + + ${adapter.getEntryTitle(e)} + + ${adapter.getEntryID(e)} + ${h.xsDate(adapter.getEntryTimestamp(e))} + ${h.xsDate(adapter.getEntryTimestamp(e))} + + + ${desc} + + + + + diff --git a/core/src/main/resources/hudson/diagnosis/Messages_pl.properties b/core/src/main/resources/hudson/diagnosis/Messages_pl.properties index d06325b6aebedeee28d04fb132302d2b10fbaa86..ef9b80b04ff66aee42565ee0ce062e18e02daed0 100644 --- a/core/src/main/resources/hudson/diagnosis/Messages_pl.properties +++ b/core/src/main/resources/hudson/diagnosis/Messages_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2016 Damian Szczepanik +# Copyright (c) 2016-2019 Damian Szczepanik # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -21,3 +21,5 @@ # THE SOFTWARE. OldDataMonitor.DisplayName=Zarz\u0105dzanie starymi danymi OldDataMonitor.Description=Usuwanie danych po nieu\u017Cywanych lub starszych wersjach wtyczek. +HudsonHomeDiskUsageMonitor.DisplayName=Monitoring zu\u017Cycia dysku +TooManyJobsButNoView.DisplayName=Zbyt wiele projekt\u00F3w jest nie przypisanych do widok\u00F3w diff --git a/core/src/main/resources/hudson/model/AbstractItem/confirm-rename_pl.properties b/core/src/main/resources/hudson/model/AbstractItem/confirm-rename_pl.properties new file mode 100644 index 0000000000000000000000000000000000000000..d0cc0858d1676774fe951c41503495bccf0e4e95 --- /dev/null +++ b/core/src/main/resources/hudson/model/AbstractItem/confirm-rename_pl.properties @@ -0,0 +1,25 @@ +# The MIT License +# +# Copyright (c) 2019, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +Rename=Zmie\u0144 nazw\u0119 +DescribeRename=Zmie\u0144 nazw\u0119 {0} +NewName=Nowa nazwa diff --git a/core/src/main/resources/hudson/model/Messages_pl.properties b/core/src/main/resources/hudson/model/Messages_pl.properties index 988d71ab09eb8e0a545cbc2d4d5bbd61217cb357..dc0d3a26c53b7e4ede09e4c90c37fc2b4ee2342f 100644 --- a/core/src/main/resources/hudson/model/Messages_pl.properties +++ b/core/src/main/resources/hudson/model/Messages_pl.properties @@ -80,3 +80,5 @@ Hudson.ViewName=Wszystkie RunParameterDefinition.DisplayName=Parametr uruchomienia# SCM check out aborted Hudson.JobAlreadyExists=Projekt o nazwie \u2018{0}\u2019 ju\u017C istnieje AbstractProject.CustomWorkspaceEmpty=Nie wprowadzono dedykowanego katalogu projektu. +AbstractItem.NewNameUnchanged=Nowa nazwa jest taka sama, jak aktualna. +Hudson.NoName=Nazwa nie zosta\u0142a podana diff --git a/core/src/main/resources/hudson/model/UpdateCenter/CompleteBatchJob/Pending/status_pl.properties b/core/src/main/resources/hudson/model/UpdateCenter/CompleteBatchJob/Pending/status_pl.properties new file mode 100644 index 0000000000000000000000000000000000000000..736b5d2172245eb31465d9d8b6c576c74a1a70a7 --- /dev/null +++ b/core/src/main/resources/hudson/model/UpdateCenter/CompleteBatchJob/Pending/status_pl.properties @@ -0,0 +1,23 @@ +# The MIT License +# +# Copyright (c) 2019, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +Pending=W trakcie diff --git a/core/src/main/resources/hudson/model/UpdateCenter/CompleteBatchJob/Success/status_pl.properties b/core/src/main/resources/hudson/model/UpdateCenter/CompleteBatchJob/Success/status_pl.properties new file mode 100644 index 0000000000000000000000000000000000000000..9d55cf00dcd797740c81e535946d3c5f5370d0df --- /dev/null +++ b/core/src/main/resources/hudson/model/UpdateCenter/CompleteBatchJob/Success/status_pl.properties @@ -0,0 +1,23 @@ +# The MIT License +# +# Copyright (c) 2019, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +Success=Sukces diff --git a/core/src/main/resources/hudson/model/UpdateCenter/CompleteBatchJob/row_pl.properties b/core/src/main/resources/hudson/model/UpdateCenter/CompleteBatchJob/row_pl.properties new file mode 100644 index 0000000000000000000000000000000000000000..ea99c2da3af4b2f32af8a4040bd972b590961f7e --- /dev/null +++ b/core/src/main/resources/hudson/model/UpdateCenter/CompleteBatchJob/row_pl.properties @@ -0,0 +1,23 @@ +# The MIT License +# +# Copyright (c) 2019, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +Loading\ plugin\ extensions=\u0141adowanie wtyczki diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/index_pl.properties b/core/src/main/resources/hudson/model/View/AsynchPeople/index_pl.properties index 253a5acf3e58e86ae50792a8f2668f4df1259d5b..72113ae5fb7ffc33b189c225a446eefc7a46b789 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/index_pl.properties +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/index_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2016, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors +# Copyright (c) 2004-2019, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -23,7 +23,6 @@ Name=Nazwa On=Na People=U\u017Cytkownicy -User\ Id=Identyfikator u\u017Cytkownika +User\ ID=Identyfikator u\u017Cytkownika Last\ Commit\ Activity=Ostatnia zmiana blurb=Prezentuje wszystkich uwierzytelnionych u\u017Cytkownik\u00F3w w\u0142\u0105cznie z identyfikatorem oraz osoby wymienione w opisach zarejestrowanych zmian. - diff --git a/core/src/main/resources/hudson/rss20.jelly b/core/src/main/resources/hudson/rss20.jelly index 9919b177fcdf970d4b167a21628aa44e939047bf..8db8633bcb265009d3de8aca518f1247e43ff45c 100644 --- a/core/src/main/resources/hudson/rss20.jelly +++ b/core/src/main/resources/hudson/rss20.jelly @@ -23,28 +23,29 @@ THE SOFTWARE. --> -<?xml version="1.0" encoding="UTF-8"?> + + <?xml version="1.0" encoding="UTF-8"?> + + + + ${title} + ${rootURL}${url} + ${title} - - - - ${title} - ${rootURL}${url} - ${title} - - - - ${adapter.getEntryTitle(e)} - ${rootURL}${h.encode(adapter.getEntryUrl(e))} - ${adapter.getEntryID(e)} - ${h.rfc822Date(adapter.getEntryTimestamp(e))} - - - - ${desc} - - - - - + + + ${adapter.getEntryTitle(e)} + ${rootURL}${h.encode(adapter.getEntryUrl(e))} + ${adapter.getEntryID(e)} + ${h.rfc822Date(adapter.getEntryTimestamp(e))} + + + + ${desc} + + + + + + diff --git a/core/src/main/resources/hudson/slaves/Messages_de.properties b/core/src/main/resources/hudson/slaves/Messages_de.properties index 0509d510ffd9ba7c44e20d5d4d5f53792989c31c..a98fcd4020116214c21269f437b3c306d3097f68 100644 --- a/core/src/main/resources/hudson/slaves/Messages_de.properties +++ b/core/src/main/resources/hudson/slaves/Messages_de.properties @@ -29,7 +29,7 @@ ComputerLauncher.UnknownJavaVersion=Konnte Java-Version von {0} nicht bestimmen. ConnectionActivityMonitor.OfflineCause=Ping-Versuche scheiterten wiederholt DumbSlave.displayName=Statischer Agent EnvironmentVariablesNodeProperty.displayName=Umgebungsvariablen -JNLPLauncher.displayName=Agent via Java Web Start starten +JNLPLauncher.displayName=Agent \u00FCber eine Verbindung zum Master-Knoten starten NodeDescriptor.CheckName.Mandatory=Name ist ein Pflichtfeld. NodeProvisioner.EmptyString= OfflineCause.connection_was_broken_=Verbindung wurde unterbrochen: {0} diff --git a/core/src/main/resources/jenkins/install/platform-plugins.json b/core/src/main/resources/jenkins/install/platform-plugins.json index 48af4a400737c204d6a1523cd0e6cb4bafcefd88..43c0c79cb9aa85b6c63f0c6692bf614ef7aa7102 100644 --- a/core/src/main/resources/jenkins/install/platform-plugins.json +++ b/core/src/main/resources/jenkins/install/platform-plugins.json @@ -49,7 +49,6 @@ { "name": "github-branch-source", "suggested": true, "added": "2.0" }, { "name": "pipeline-github-lib", "suggested": true, "added": "2.0" }, { "name": "pipeline-stage-view", "suggested": true, "added": "2.0" }, - { "name": "build-pipeline-plugin" }, { "name": "conditional-buildstep" }, { "name": "jenkins-multijob-plugin" }, { "name": "parameterized-trigger" }, diff --git a/core/src/main/resources/jenkins/model/Jenkins/EnforceSlaveAgentPortAdministrativeMonitor/message_de.properties b/core/src/main/resources/jenkins/model/Jenkins/EnforceSlaveAgentPortAdministrativeMonitor/message_de.properties index 8df926efe946f01efa9abaad342df0f10e4f7fed..213275c7dec43e7d22aac761085b491c74c9bc19 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/EnforceSlaveAgentPortAdministrativeMonitor/message_de.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/EnforceSlaveAgentPortAdministrativeMonitor/message_de.properties @@ -20,5 +20,5 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -description=Der JNLP-Agent-Port wurde ver\u00E4ndert, obwohl er durch die System-Eigenschaft {0} beim Start festgelegt wurde. Der Wert wird beim Neustart auf {1,number,#} zur\u00FCckgesetzt. +description=Der TCP-Agent-Port wurde ver\u00E4ndert, obwohl er durch die System-Eigenschaft {0} beim Start festgelegt wurde. Der Wert wird beim Neustart auf {1,number,#} zur\u00FCckgesetzt. reset=Auf {0,number,#} zur\u00FCcksetzen diff --git a/core/src/main/resources/jenkins/model/RenameAction/action_pl.properties b/core/src/main/resources/jenkins/model/RenameAction/action_pl.properties new file mode 100644 index 0000000000000000000000000000000000000000..50641f4479ba6208a822d3d329c78399cdb594b5 --- /dev/null +++ b/core/src/main/resources/jenkins/model/RenameAction/action_pl.properties @@ -0,0 +1,23 @@ +# The MIT License +# +# Copyright (c) 2019 Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +Rename=Zmie\u0144 nazw\u0119 diff --git a/core/src/main/resources/jenkins/security/ApiTokenProperty/config_pl.properties b/core/src/main/resources/jenkins/security/ApiTokenProperty/config_pl.properties new file mode 100644 index 0000000000000000000000000000000000000000..14b2752cda5e0007643f907953744772edf622e1 --- /dev/null +++ b/core/src/main/resources/jenkins/security/ApiTokenProperty/config_pl.properties @@ -0,0 +1,25 @@ +# The MIT License +# +# Copyright (c) 2019 Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +NoTokenYet=Nie ma zarejestrowanych token\u00F3w dla tego u\u017Cytkownika +CurrentTokens=Aktualny token +AddNewToken=Dodaj nowy token diff --git a/core/src/main/resources/jenkins/security/seed/UserSeedProperty/config_pl.properties b/core/src/main/resources/jenkins/security/seed/UserSeedProperty/config_pl.properties new file mode 100644 index 0000000000000000000000000000000000000000..4374a9b0d84ea969af1cc6d916c4350c2eaaa6bf --- /dev/null +++ b/core/src/main/resources/jenkins/security/seed/UserSeedProperty/config_pl.properties @@ -0,0 +1,27 @@ +# The MIT License +# +# Copyright (c) 2019, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +resetSeed.button=Zako\u0144cz wszystkie sesje +resetSeed.result=Operacja zako\u0144czona pomy\u015Blnie. Wszystkie sesje zako\u0144czone. +resetSeed.confirmation=Wszystkie aktywne sesje zostan\u0105 zako\u0144czone. \n\ +B\u0119dzie wymagane ponowne zalogowanie si\u0119. \n\ +Czy kontynuowa\u0107? diff --git a/core/src/main/resources/jenkins/slaves/systemInfo/EnvVarsSlaveInfo/systemInfo.jelly b/core/src/main/resources/jenkins/slaves/systemInfo/EnvVarsSlaveInfo/systemInfo.jelly index 37af3c7c7531a9e32354e9f4924788fa8651924f..9525653a7b59cf8ab9a2492dd7fede38c1aaddf5 100644 --- a/core/src/main/resources/jenkins/slaves/systemInfo/EnvVarsSlaveInfo/systemInfo.jelly +++ b/core/src/main/resources/jenkins/slaves/systemInfo/EnvVarsSlaveInfo/systemInfo.jelly @@ -29,5 +29,5 @@ THE SOFTWARE. --> - + \ No newline at end of file diff --git a/core/src/main/resources/lib/form/breadcrumb-config-outline_pl.properties b/core/src/main/resources/lib/form/breadcrumb-config-outline_pl.properties index f28de3a5587173549d71600384d4243bc5a4123b..80087ba0398d9ebe635a367148e6fa1b1e2d8069 100644 --- a/core/src/main/resources/lib/form/breadcrumb-config-outline_pl.properties +++ b/core/src/main/resources/lib/form/breadcrumb-config-outline_pl.properties @@ -1,3 +1,3 @@ # This file is under the MIT License by authors -configuration=konfiguracja +configuration=Konfiguracja diff --git a/core/src/main/resources/lib/layout/breadcrumbs.css b/core/src/main/resources/lib/layout/breadcrumbs.css index 5dcc7624ebcdebd9b703db8de25beca507b8d2fe..26c4683a8a12334d5129ba94b0e7fc5800c86b69 100644 --- a/core/src/main/resources/lib/layout/breadcrumbs.css +++ b/core/src/main/resources/lib/layout/breadcrumbs.css @@ -24,6 +24,7 @@ margin: 0; height: 2em; border-bottom: 1px solid #d3d7cf; + display:block; } #breadcrumbs LI { @@ -31,6 +32,7 @@ line-height:2em; height: 2em; color:#555753; + display:inline-block; } #breadcrumbs LI A { @@ -46,6 +48,12 @@ #breadcrumbs LI A:link, #breadcrumbs LI A:visited { text-decoration:none; color:#555753; + display: block; + max-width: 1330px; + float: left; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; } #breadcrumbs LI A:hover, #crumbs LI A:focus { diff --git a/core/src/main/resources/lib/layout/layout_es_AR.properties b/core/src/main/resources/lib/layout/layout_es_AR.properties index 8dfcaffc2fcaa589f291480c519db9329647ef8a..6acf234ba1a319cd87cacf86296b8b25ac4d4e3b 100644 --- a/core/src/main/resources/lib/layout/layout_es_AR.properties +++ b/core/src/main/resources/lib/layout/layout_es_AR.properties @@ -21,5 +21,5 @@ # THE SOFTWARE. Page\ generated=P\u00E1gina generada -logout=Volver al proyecto +logout=Desconectar search=Buscar diff --git a/core/src/test/java/hudson/UtilTest.java b/core/src/test/java/hudson/UtilTest.java index 0e8632e4f10a3389a964ff22d7e02a2de2e6b230..a346f889cf7c70fc7f25db854e779b649ccb56f4 100644 --- a/core/src/test/java/hudson/UtilTest.java +++ b/core/src/test/java/hudson/UtilTest.java @@ -158,6 +158,7 @@ public class UtilTest { " \"#%/:;<>?", "%20%22%23%25%2F%3A%3B%3C%3E%3F", "[\\]^`{|}~", "%5B%5C%5D%5E%60%7B%7C%7D%7E", "d\u00E9velopp\u00E9s", "d%C3%A9velopp%C3%A9s", + "Foo \uD800\uDF98 Foo", "Foo%20%F0%90%8E%98%20Foo" }; for (int i = 0; i < data.length; i += 2) { assertEquals("test " + i, data[i + 1], Util.rawEncode(data[i])); diff --git a/core/src/test/java/hudson/model/AbstractItemTest.java b/core/src/test/java/hudson/model/AbstractItemTest.java index 79507b4335a0e31c74c4b9f7b264bb3bc0eb8790..b71a64e0d64ece7f84d47ed457aa43e6319618cc 100644 --- a/core/src/test/java/hudson/model/AbstractItemTest.java +++ b/core/src/test/java/hudson/model/AbstractItemTest.java @@ -5,10 +5,13 @@ package hudson.model; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; +import static org.junit.Assert.fail; +import java.io.IOException; import java.util.Collection; import org.junit.Test; +import org.jvnet.hudson.test.Issue; /** * @author kingfai @@ -91,4 +94,60 @@ public class AbstractItemTest { assertEquals(displayName, i.getDisplayNameOrNull()); assertEquals(displayName, i.getDisplayName()); } + + private class NameNotEditableItem extends AbstractItem { + + protected NameNotEditableItem(ItemGroup parent, String name){ + super(parent, name); + } + + @Override + public Collection getAllJobs() { + return null; + } + + @Override + public boolean isNameEditable() { + return false; //so far it's the default value, but it's good to be explicit for test. + } + } + + @Test + @Issue("JENKINS-58571") + public void renameMethodShouldThrowExceptionWhenNotIsNameEditable() { + + //GIVEN + NameNotEditableItem item = new NameNotEditableItem(null,"NameNotEditableItem"); + + //WHEN + try { + item.renameTo("NewName"); + fail("An item with isNameEditable false must throw exception when trying to rename it."); + } catch (IOException e) { + + //THEN + assertEquals(e.getMessage(),"Trying to rename an item that does not support this operation."); + assertEquals("NameNotEditableItem",item.getName()); + } + } + + @Test + @Issue("JENKINS-58571") + public void doConfirmRenameMustThrowFormFailureWhenNotIsNameEditable() throws IOException { + + //GIVEN + NameNotEditableItem item = new NameNotEditableItem(null,"NameNotEditableItem"); + + //WHEN + try { + item.doConfirmRename("MyNewName"); + fail("An item with isNameEditable false must throw exception when trying to call doConfirmRename."); + } catch (Failure f) { + + //THEN + assertEquals(f.getMessage(),"Trying to rename an item that does not support this operation."); + assertEquals("NameNotEditableItem",item.getName()); + } + } + } diff --git a/core/src/test/java/hudson/model/TaskActionTest.java b/core/src/test/java/hudson/model/TaskActionTest.java index bfcf679cad252dc7064535afab115656c5dd7a94..0860e7cb49ac74e4dcd6a16e35ea4139d21adcbb 100644 --- a/core/src/test/java/hudson/model/TaskActionTest.java +++ b/core/src/test/java/hudson/model/TaskActionTest.java @@ -1,5 +1,6 @@ package hudson.model; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.io.ByteArrayOutputStream; @@ -58,7 +59,9 @@ public class TaskActionTest { Thread.sleep(10); } ByteArrayOutputStream os = new ByteArrayOutputStream(); - annotatedText.writeLogTo(0, os); + final long length = annotatedText.writeLogTo(0, os); + // Windows based systems will be 220, linux base 219 + assertTrue("length should be longer or even 219", length >= 219); assertTrue(os.toString("UTF-8").startsWith("a linkCompleted")); } } diff --git a/core/src/test/java/hudson/util/AtomicFileWriterTest.java b/core/src/test/java/hudson/util/AtomicFileWriterTest.java index 5280c35646ce83c4f3a89be124546b0245c8849e..f331a8f5d4d5f9d2ece28035c7112fd51d7687ec 100644 --- a/core/src/test/java/hudson/util/AtomicFileWriterTest.java +++ b/core/src/test/java/hudson/util/AtomicFileWriterTest.java @@ -83,7 +83,7 @@ public class AtomicFileWriterTest { final Path childFileInSymlinkToDir = Paths.get(zeSymlink.toString(), "childFileInSymlinkToDir"); - new AtomicFileWriter(childFileInSymlinkToDir, Charset.forName("UTF-8")); + new AtomicFileWriter(childFileInSymlinkToDir, StandardCharsets.UTF_8); } @Test @@ -154,7 +154,7 @@ public class AtomicFileWriterTest { assertFalse(parentExistsAndIsAFile.exists()); try { - new AtomicFileWriter(parentExistsAndIsAFile.toPath(), Charset.forName("UTF-8")); + new AtomicFileWriter(parentExistsAndIsAFile.toPath(), StandardCharsets.UTF_8); fail("Expected a failure"); } catch (IOException e) { assertThat(e.getMessage(), diff --git a/pom.xml b/pom.xml index f5b1d423ecfb362ee69ef38067d3509c719d35b3..5e975fcff75a1f2d450518b8ad29172f5c3217bd 100755 --- a/pom.xml +++ b/pom.xml @@ -76,7 +76,7 @@ THE SOFTWARE. - 2.190 + 2.192 -SNAPSHOT - 3.33 + 3.34 3.4 @@ -159,7 +159,7 @@ THE SOFTWARE. org.mockito mockito-core - 2.22.0 + 3.0.0 diff --git a/test-pom/pom.xml b/test-pom/pom.xml index e082082283ff8c4b3899020da7db646ecc43fbb4..c0cfecf61f40e45bd00fedf074fe74f92ff66cc8 100644 --- a/test-pom/pom.xml +++ b/test-pom/pom.xml @@ -64,7 +64,7 @@ THE SOFTWARE. ${project.groupId} jenkins-test-harness - 2.54 + 2.55 test diff --git a/test/src/test/java/hudson/model/UsageStatisticsTest.java b/test/src/test/java/hudson/model/UsageStatisticsTest.java index 69af37073069e1d6602eb739664cd3075e0b32f6..272698240adf6bdc8da2d7fe628af83a54404c0e 100644 --- a/test/src/test/java/hudson/model/UsageStatisticsTest.java +++ b/test/src/test/java/hudson/model/UsageStatisticsTest.java @@ -42,7 +42,6 @@ import org.jvnet.hudson.test.JenkinsRule; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStreamReader; -import java.nio.charset.Charset; import java.security.KeyFactory; import java.security.interfaces.RSAPrivateKey; import java.security.spec.PKCS8EncodedKeySpec; @@ -172,7 +171,7 @@ public class UsageStatisticsTest { private void compareWithFile(String fileName, Object object) throws IOException { Class clazz = this.getClass(); - String fileContent = Resources.toString(clazz.getResource(clazz.getSimpleName() + "/" + fileName), Charset.forName("UTF-8")); + String fileContent = Resources.toString(clazz.getResource(clazz.getSimpleName() + "/" + fileName), StandardCharsets.UTF_8); fileContent = fileContent.replace("JVMVENDOR", System.getProperty("java.vendor")); fileContent = fileContent.replace("JVMNAME", System.getProperty("java.vm.name")); fileContent = fileContent.replace("JVMVERSION", System.getProperty("java.version")); diff --git a/test/src/test/java/jenkins/model/AssetManagerTest.java b/test/src/test/java/jenkins/model/AssetManagerTest.java new file mode 100644 index 0000000000000000000000000000000000000000..c9ad69752b3d4439a2fc8d5a31f924fc31454ab9 --- /dev/null +++ b/test/src/test/java/jenkins/model/AssetManagerTest.java @@ -0,0 +1,58 @@ +/* + * The MIT License + * + * Copyright (c) 2019 CloudBees, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package jenkins.model; + +import org.junit.Rule; +import org.junit.Test; +import org.jvnet.hudson.test.Issue; +import org.jvnet.hudson.test.JenkinsRule; + +import java.net.HttpURLConnection; +import java.net.URL; + +import static org.junit.Assert.assertEquals; + +public class AssetManagerTest { + + @Rule + public JenkinsRule j = new JenkinsRule(); + + @Test + @Issue("JENKINS-58736") + public void emptyAssetDoesNotThrowError() throws Exception { + URL url = new URL(j.getURL() + "assets"); + HttpURLConnection httpCon = (HttpURLConnection) url.openConnection(); + assertEquals(HttpURLConnection.HTTP_NOT_FOUND, httpCon.getResponseCode()); + } + + @Test + @Issue("JENKINS-9598") + public void jqueryLoad() throws Exception { + // webclient does not work because it tries to parse the jquery2.js and there is a missing comma + URL url = new URL(j.getURL() + "assets/jquery-detached/jsmodules/jquery2.js"); + HttpURLConnection httpCon = (HttpURLConnection) url.openConnection(); + assertEquals(HttpURLConnection.HTTP_OK, httpCon.getResponseCode()); + } +} diff --git a/war/src/main/webapp/css/layout-common.css b/war/src/main/webapp/css/layout-common.css index 7bd3415c3b539193c9d45bc6316b8f1b3fce2c20..2f6d41c2a6e9e0c7540793d0bed16ff140a6cd88 100644 --- a/war/src/main/webapp/css/layout-common.css +++ b/war/src/main/webapp/css/layout-common.css @@ -93,6 +93,7 @@ body { body.two-column #main-panel { margin-left: 320px; + display:block; } body.full-screen { @@ -112,6 +113,7 @@ body.full-screen #main-panel { body.two-column #main-panel { margin-left: 0; + display:block; } } @@ -122,6 +124,7 @@ body.full-screen #main-panel { body.two-column #main-panel { margin-left: 360px; + display:block; } } diff --git a/war/src/main/webapp/css/responsive-grid.css b/war/src/main/webapp/css/responsive-grid.css index f4a890db4970c4ba8463556a39c39df1c2d65e98..1e1309ea496da9c701e31252ade507466356ad8f 100644 --- a/war/src/main/webapp/css/responsive-grid.css +++ b/war/src/main/webapp/css/responsive-grid.css @@ -13,6 +13,12 @@ -moz-box-sizing: border-box; box-sizing: border-box; } +h1.build-caption.page-headline { + max-width: 1200px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} *:before, *:after { -webkit-box-sizing: border-box; diff --git a/war/src/main/webapp/css/style.css b/war/src/main/webapp/css/style.css index 2040688c26d7ce5c283eda21131cc3c9af83aa6e..c07251a62d6bfd8bcb601d34fe587d149a7da308 100644 --- a/war/src/main/webapp/css/style.css +++ b/war/src/main/webapp/css/style.css @@ -26,12 +26,16 @@ #tasks { margin-bottom: 20px; + display: inline-block; } #tasks .task { margin-bottom: 4px; font-size: 14px; + max-width: 325px; + overflow: hidden; white-space: nowrap; + text-overflow: ellipsis; } /* buildQueue */