Skip to content

Commit

Permalink
Merge branch 'master' into new-manage-jenkins-layout-2
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Jan 30, 2025
2 parents d67ba10 + 5aca30a commit efefafc
Show file tree
Hide file tree
Showing 44 changed files with 152 additions and 190 deletions.
2 changes: 1 addition & 1 deletion bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ THE SOFTWARE.
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.17.2</version>
<version>1.18.0</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
Expand Down
3 changes: 3 additions & 0 deletions cli/src/main/java/hudson/cli/CLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -343,17 +343,20 @@ public void onOpen(Session session, EndpointConfig config) {}

class Authenticator extends ClientEndpointConfig.Configurator {
HandshakeResponse hr;

@Override
public void beforeRequest(Map<String, List<String>> headers) {
if (factory.authorization != null) {
headers.put("Authorization", List.of(factory.authorization));
}
}

@Override
public void afterResponse(HandshakeResponse hr) {
this.hr = hr;
}
}

var authenticator = new Authenticator();

ClientManager client = ClientManager.createClient(JdkClientContainer.class.getName()); // ~ ContainerProvider.getWebSocketContainer()
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/ClassicPluginStrategy.java
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ protected ClassLoader createClassLoader(List<File> paths, ClassLoader parent) th
/**
* @deprecated since 2.459 use {@link #createClassLoader(String, List, ClassLoader, Attributes)}
*/
@Deprecated(since="2.459")
@Deprecated(since = "2.459")
protected ClassLoader createClassLoader(List<File> paths, ClassLoader parent, Attributes atts) throws IOException {
// generate a legacy id so at least we can track to something
return createClassLoader("unidentified-" + UUID.randomUUID(), paths, parent, atts);
Expand Down
16 changes: 15 additions & 1 deletion core/src/main/java/hudson/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,21 @@ public Proc launch(ProcStarter ps) throws IOException {
final String workDir = psPwd == null ? null : psPwd.getRemote();

try {
RemoteLaunchCallable remote = new RemoteLaunchCallable(ps.commands, ps.masks, ps.envs, in, ps.reverseStdin, out, ps.reverseStdout, err, ps.reverseStderr, ps.quiet, workDir, listener, ps.stdoutListener, envVarsFilterRuleWrapper);
RemoteLaunchCallable remote = new RemoteLaunchCallable(
ps.commands,
ps.masks,
ps.envs,
in,
ps.reverseStdin,
out,
ps.reverseStdout,
err,
ps.reverseStderr,
ps.quiet,
workDir,
listener,
ps.stdoutListener,
envVarsFilterRuleWrapper);
// reset the rules to prevent build step without rules configuration to re-use those
envVarsFilterRuleWrapper = null;
return new ProcImpl(getChannel().call(remote));
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/ComputerSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ public static List<NodeMonitor> get_monitors() {
}

/**
* @deprecated Use {@link #getComputers()} instead.
* @return All {@link Computer} instances managed by this set.
* @deprecated Use {@link #getComputers()} instead.
*/
@Deprecated(since = "2.480")
public Computer[] get_all() {
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/java/hudson/model/Job.java
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,12 @@ public interface BuildNumberAssigner extends ExtensionPoint {
* Implementation of {@link Job#assignBuildNumber}.
*/
int assignBuildNumber(Job<?, ?> job, SaveNextBuildNumber saveNextBuildNumber) throws IOException;

/**
* Provides an externally accessible alias for {@link Job#saveNextBuildNumber}, which is {@code protected}.
* ({@link #getNextBuildNumber} and {@link #fastUpdateNextBuildNumber} are already accessible.)
*/

interface SaveNextBuildNumber {
void call() throws IOException;
}
Expand Down
4 changes: 1 addition & 3 deletions core/src/main/java/hudson/model/UserPropertyDescriptor.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,9 @@ public boolean isEnabled() {
* Method proposed to prevent plugins to rely on too recent core version
* while keeping the possibility to use the categories.
*
* @deprecated This should only be used when the core requirement is below the version this method was added
*
* @return String name corresponding to the symbol of {@link #getUserPropertyCategory()}
*
* @since 2.468
* @deprecated This should only be used when the core requirement is below the version this method was added
*/
@Deprecated
protected @CheckForNull String getUserPropertyCategoryAsString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package hudson.model.userproperty;

import edu.umd.cs.findbugs.annotations.NonNull;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package hudson.model.userproperty;

import edu.umd.cs.findbugs.annotations.NonNull;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package hudson.model.userproperty;

import edu.umd.cs.findbugs.annotations.NonNull;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package hudson.model.userproperty;

import edu.umd.cs.findbugs.annotations.NonNull;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package hudson.model.userproperty;

import edu.umd.cs.findbugs.annotations.NonNull;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package hudson.model.userproperty;

package hudson.model.userproperty;

import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,14 @@ protected Object unmarshalField(final UnmarshallingContext context, final Object
return context.convertAnother(result, type, converter);
}

private void writeValueToImplicitCollection(HierarchicalStreamReader reader, UnmarshallingContext context, Object value, Map<String, Collection<Object>> implicitCollections, Map<String, Class<?>> implicitCollectionElementTypes, Object result, String itemFieldName) {
private void writeValueToImplicitCollection(
HierarchicalStreamReader reader,
UnmarshallingContext context,
Object value,
Map<String, Collection<Object>> implicitCollections,
Map<String, Class<?>> implicitCollectionElementTypes,
Object result,
String itemFieldName) {
String fieldName = mapper.getFieldNameForItemTypeAndName(context.getRequiredType(), value.getClass(), itemFieldName);
if (fieldName != null) {
Collection collection = implicitCollections.get(fieldName);
Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/jenkins/agents/IOfflineCause.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package jenkins.agents;

import edu.umd.cs.findbugs.annotations.NonNull;
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/java/jenkins/model/IComputer.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ default String getIconClassName() {
* Returns the number of {@link IExecutor}s that are doing some work right now.
*/
int countBusy();

/**
* Returns the current size of the executor pool for this computer.
*/
Expand All @@ -194,6 +195,7 @@ default String getIconClassName() {
* @return true if the computer is online.
*/
boolean isOnline();

/**
* @return the number of {@link IExecutor}s that are idle right now.
*/
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/jenkins/model/Nodes.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public List<Node> getNodes() {
* @throws IOException if the new list of nodes could not be persisted.
*/
public void setNodes(final @NonNull Collection<? extends Node> nodes) throws IOException {
Map<String,Node> toRemove = new HashMap<>();
Map<String, Node> toRemove = new HashMap<>();
Queue.withLock(() -> {
toRemove.putAll(Nodes.this.nodes);
for (var node : nodes) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public void validate(URL url) throws IOException {
LOGGER.log(Level.FINE, () -> "Allowing URL: " + url);
}
}

@SuppressFBWarnings(
value = "DMI_COLLECTION_OF_URLS",
justification = "All URLs point to local files, so no DNS lookup.")
Expand Down
2 changes: 0 additions & 2 deletions core/src/main/resources/hudson/lifecycle/Messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

WindowsInstallerLink.DisplayName=Install as Windows Service
WindowsInstallerLink.Description=Installs Jenkins as a Windows service to this system, so that Jenkins starts automatically when the machine boots.
WindowsSlaveInstaller.ConfirmInstallation=This will install an agent as a Windows service, so that a Jenkins agent starts automatically when the machine boots.
WindowsSlaveInstaller.DotNetRequired=.NET Framework 4.0 or later is required for this feature
WindowsSlaveInstaller.InstallationSuccessful=Installation was successful. Would you like to start the service now?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

WindowsInstallerLink.DisplayName=\
Инсталиране като услуга на Windows
WindowsInstallerLink.Description=\
Инсталиране на Jenkins като услуга на инсталирания на тази система Windows, за\
да може той да се стартира заедно с машината.
WindowsSlaveInstaller.DotNetRequired=\
За това се изисква .NET Framework, версия 4.0 или по-висока
WindowsSlaveInstaller.InstallationSuccessful=\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,5 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

WindowsInstallerLink.DisplayName=Installer som Windows service
WindowsSlaveInstaller.DotNetRequired=Denne feature kræver .NET framework 4.0 eller nyere
WindowsSlaveInstaller.InstallationSuccessful=Installationen lykkedes. Vil du gerne starte service''en nu ?
WindowsInstallerLink.Description=Installerer Jenkins som en Windows service på denne computer, så Jenkins starter automatisk når computeren starter op.
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

WindowsInstallerLink.DisplayName=Als Windows-Dienst installieren
WindowsInstallerLink.Description=\
Installiert Jenkins als Windows-Dienst: Dadurch wird Jenkins \
automatisch nach einem Neustart des Rechners gestartet.
WindowsSlaveInstaller.DotNetRequired=.NET Framework 4.0 oder höher ist für diesen Vorgang erforderlich.
WindowsSlaveInstaller.InstallationSuccessful=Installation erfolgreich. Möchten Sie den Dienst jetzt starten?
WindowsSlaveInstaller.ConfirmInstallation=Dies wird den Agenten als Windows-Dienst installieren, so dass er automatisch gestartet wird, wenn das System startet.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

WindowsInstallerLink.DisplayName=Instalar como un servicio de Windows
WindowsInstallerLink.Description=Instalar Jenkins como un servicio de Windows en este sistema, de manera que Jenkins se inicie cuando el sistema arranque.
WindowsSlaveInstaller.ConfirmInstallation=Esto instalará el agente como un servicio de Windows.
WindowsSlaveInstaller.DotNetRequired=Es necesario tener instalado: .NET Framework 4.0 o posterior, para que esta característica funcione.
WindowsSlaveInstaller.InstallationSuccessful=La instalación ha sido correcta. ¿Quieres arrancar el servicio ahora?
Expand Down
24 changes: 0 additions & 24 deletions core/src/main/resources/hudson/lifecycle/Messages_fr.properties

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

WindowsInstallerLink.Description=Installa Jenkins su questo sistema come \
servizio Windows in modo che possa avviarsi automaticamente all''avvio del \
sistema.
WindowsInstallerLink.DisplayName=Installa come servizio Windows
WindowsSlaveInstaller.ConfirmInstallation=Quest''opzione installerà un agente \
come servizio Windows in modo da far avviare automaticamente un agente \
Jenkins all''avvio del sistema.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

WindowsInstallerLink.DisplayName=Windowsのサービスとしてインストール
WindowsInstallerLink.Description=マシンがブートしたときにJenkinsが自動的に開始するように、WindowsのサービスとしてJenkinsをインストールします。
WindowsSlaveInstaller.DotNetRequired=.NET Framework 4.0 以降が必要です。
WindowsSlaveInstaller.InstallationSuccessful=インストールが成功しました。今すぐサービスを開始しますか?
WindowsSlaveInstaller.RootFsDoesntExist=エージェントのルートディレクトリ ''{0}'' が存在しません。
23 changes: 0 additions & 23 deletions core/src/main/resources/hudson/lifecycle/Messages_nl.properties

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,5 @@
# 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.
WindowsInstallerLink.DisplayName=Zainstaluj jako usługę systemową
WindowsSlaveInstaller.DotNetRequired=.NET Framework 4.0 lub nowszy jest wymagany dla tej funkcjonalności
WindowsSlaveInstaller.InstallationSuccessful=Instalacja zakończona pomyślnie. Chcesz uruchomić usługę teraz?
WindowsInstallerLink.Description=Zainstaluj Jenkinsa jako usługę systemową, aby uruchomić Jenkinsa automatycznie po uruchomieniu systemu.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

WindowsInstallerLink.DisplayName=Instalar como um serviço do Windows
WindowsSlaveInstaller.DotNetRequired=Framework .NET 4.0 ou superior é necessário
WindowsSlaveInstaller.InstallationSuccessful=Instalação efetuada com sucesso. Gostaria de iniciar o serviço agora?
WindowsInstallerLink.Description=Instala o Jenkins como um serviço do Windows, então será iniciado junto com o sistema operacional
WindowsSlaveInstaller.RootFsDoesntExist=O diretório raiz do agente '{0}' não existe
WindowsSlaveInstaller.ConfirmInstallation=Isto irá instalar o agente como um serviço do Windows de forma que o agente do Jenkins iniciará automaticamente quando a máquina iniciar.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# This file is under the MIT License by authors

WindowsInstallerLink.DisplayName=Инсталирај као Windows сервис
WindowsInstallerLink.Description=Инсталира Jenkins као Windows сервис који се аутоматско покрене када почне машина.
WindowsSlaveInstaller.ConfirmInstallation=Операција ће инсталирати агент који се аутоматско покрене када почне машина.
WindowsSlaveInstaller.InstallationSuccessful=Успешна инсталација. Да се желите да сада покренете сервис?
WindowsSlaveInstaller.DotNetRequired=За то није потребно .NET Framework 4.0 или новије
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

WindowsInstallerLink.DisplayName=Installera som Windows-tjänst
WindowsInstallerLink.Description=Installerar Jenkins som en Windows-tjänst på detta system, så att Jenkins startar automatiskt när datorn startar.
WindowsSlaveInstaller.ConfirmInstallation=Detta kommer att installera en agent som en Windows-tjänst, så att en Jenkins-agent startar automatiskt när datorn startar.
WindowsSlaveInstaller.DotNetRequired=.NET Framework 4.0 eller senare krävs för den här funktionen
WindowsSlaveInstaller.InstallationSuccessful=Installationen lyckades. Vill du starta tjänsten nu?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,5 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

WindowsInstallerLink.DisplayName=安裝成 Windows 服務
WindowsInstallerLink.Description=將 Jenkins 安裝成 Windows 服務,開機後 Jenkins 就會自動啟動。
WindowsSlaveInstaller.DotNetRequired=本功能需要 .NET Framework 4.0 或是更新的版本
WindowsSlaveInstaller.InstallationSuccessful=安裝完成。您要馬上啟動服務嗎?
1 change: 0 additions & 1 deletion core/src/spotbugs/excludesFilter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,6 @@
<Class name="hudson.Launcher$RemoteChannelLaunchCallable"/>
<Class name="hudson.Launcher$RemoteLaunchCallable"/>
<Class name="hudson.lifecycle.Lifecycle"/>
<Class name="hudson.lifecycle.WindowsInstallerLink"/>
<Class name="hudson.lifecycle.WindowsServiceLifecycle"/>
<Class name="hudson.LocalPluginManager"/>
<Class name="hudson.logging.LogRecorder"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ private static String s(String fullString, boolean simplify) {
* name, and expected value for each of the resource files used by
* the test.
*
* @param simplifyExpectedValue if true, then the expected value
* @param simplify if true, then the expected value
* is simplified by replacing ' ' with '-', by replacing '/' with
* '-', and by removing '(' and ')'.
* @return arguments for ParameterizedTest, resource file name,
Expand Down
Loading

0 comments on commit efefafc

Please sign in to comment.