Skip to content

Commit

Permalink
Merge branch 'master' into new-plugin-manager-1
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Jul 7, 2022
2 parents db677f3 + 22dcefc commit 0f2ef2f
Show file tree
Hide file tree
Showing 43 changed files with 456 additions and 231 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/label-conflicting-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Label conflicting PRs"
on:
push:
pull_request_target:
types: [synchronize]

permissions:
pull-requests: write

jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Label conflicting PRs
uses: eps1lon/actions-label-merge-conflict@b8bf8341285ec9a4567d4318ba474fee998a6919 # v2.0.1
with:
dirtyLabel: "unresolved-merge-conflict"
repoToken: "${{ secrets.GITHUB_TOKEN }}"
commentOnDirty: "Please take a moment and address the merge conflicts of your pull request. Thanks!"
continueOnMissingPermissions: true
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/WebAppMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public void contextInitialized(ServletContextEvent event) {
Formatter formatter = (Formatter) Class.forName("io.jenkins.lib.support_log_formatter.SupportLogFormatter").getDeclaredConstructor().newInstance();
for (Handler h : Logger.getLogger("").getHandlers()) {
if (h instanceof ConsoleHandler) {
((ConsoleHandler) h).setFormatter(formatter);
h.setFormatter(formatter);
}
}
} catch (ClassNotFoundException x) {
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/AbstractProject.java
Original file line number Diff line number Diff line change
Expand Up @@ -1746,7 +1746,7 @@ protected void submit(StaplerRequest req, StaplerResponse rsp) throws IOExceptio
super.submit(req, rsp);
JSONObject json = req.getSubmittedForm();

makeDisabled(json.optBoolean("disable"));
makeDisabled(!json.optBoolean("enable"));

jdk = json.optString("jdk", null);

Expand Down
6 changes: 1 addition & 5 deletions core/src/main/java/hudson/model/UpdateSite.java
Original file line number Diff line number Diff line change
Expand Up @@ -1025,11 +1025,7 @@ public boolean isRelevant() {
switch (this.type) {
case CORE:
VersionNumber current = Jenkins.getVersion();

if (!isRelevantToVersion(current)) {
return false;
}
return true;
return isRelevantToVersion(current);
case PLUGIN:

// check whether plugin is installed
Expand Down
4 changes: 1 addition & 3 deletions core/src/main/java/hudson/model/View.java
Original file line number Diff line number Diff line change
Expand Up @@ -516,9 +516,7 @@ private boolean filterQueueItemTest(Queue.Item item, Collection<TopLevelItem> vi
// Check root project for sub-job projects (e.g. matrix jobs).
if (item.task instanceof AbstractProject<?, ?>) {
AbstractProject<?, ?> project = (AbstractProject<?, ?>) item.task;
if (viewItems.contains(project.getRootProject())) {
return true;
}
return viewItems.contains(project.getRootProject());
}
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/jenkins/util/VirtualFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ public int zip(OutputStream outputStream, String includes, String excludes, bool

@Override public InputStream open(boolean noFollowLinks) throws IOException {
try {
return f.read(root == null ? null : root, noFollowLinks);
return f.read(root, noFollowLinks);
} catch (InterruptedException x) {
throw new IOException(x);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:p="/lib/hudson/project" xmlns:this="this">
<p:config-disableBuild/>
<p:config-concurrentBuild />

<j:set var="jdks" value="${app.JDKs}" />
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/resources/hudson/model/AllView/noJob.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package hudson.model.AllView

import hudson.model.Computer
import hudson.model.Item
import hudson.model.Job
import jenkins.model.Jenkins

def l = namespace(lib.LayoutTagLib)
Expand All @@ -11,7 +12,7 @@ def canSetUpDistributedBuilds = Jenkins.get().hasPermission(Computer.CREATE) &&
Jenkins.get().clouds.isEmpty() &&
Jenkins.get().getNodes().isEmpty();
def hasAdministerJenkinsPermission = Jenkins.get().hasPermission(Jenkins.ADMINISTER);
def hasItemCreatePermission = my.owner.hasPermission(Item.CREATE);
def hasItemCreatePermission = my.owner.itemGroup.hasPermission(Item.CREATE);

div {

Expand Down
84 changes: 50 additions & 34 deletions core/src/main/resources/hudson/model/Job/configure.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -26,50 +26,66 @@ THE SOFTWARE.
Config page. derived class specific entries should go to configure-entries.jsp
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:l="/lib/layout" xmlns:f="/lib/form">

<l:layout type="one-column" permission="${it.EXTENDED_READ}" title="${%Config(it.displayName)}">
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:l="/lib/layout" xmlns:f="/lib/form" xmlns:p="/lib/hudson/project">
<l:layout permission="${it.EXTENDED_READ}" title="${%Config(it.displayName)}">
<j:set var="readOnlyMode" value="${!it.hasPermission(it.CONFIGURE)}" />

<l:js src="jsbundles/config-scrollspy.js" />
<l:css src="jsbundles/config-scrollspy.css" />
<l:header>
<script src="${resURL}/jsbundles/section-to-sidebar-items.js" type="text/javascript" defer="true" />
</l:header>

<l:side-panel>
<div id="tasks">
<div class="jenkins-app-bar">
<div class="jenkins-app-bar__content">
<h1>${%Configuration}</h1>
</div>
</div>
</div>
</l:side-panel>

<l:main-panel>
<div class="container">
<div class="row">
<div class="jenkins-config-container">
<div class="behavior-loading"><l:spinner text="${%LOADING}"/></div>

<div class="behavior-loading"><l:spinner text="${%LOADING}"/></div>
<f:form method="post" class="jenkins-form" action="configSubmit" name="config" tableClass="config-table">
<div class="jenkins-app-bar">
<div class="jenkins-app-bar__content">
<h2>
<div class="jenkins-hidden">
<l:icon src="symbol-settings" />
</div>
<span>${%General}</span>
</h2>
</div>
<div class="jenkins-app-bar__controls">
<p:config-disableBuild />
</div>
</div>

<f:form method="post" action="configSubmit" name="config" tableClass="config-table scrollspy">
<j:set var="descriptor" value="${it.descriptor}" />
<j:set var="instance" value="${it}" />
<j:set var="descriptor" value="${it.descriptor}" />
<j:set var="instance" value="${it}" />

<div class="jenkins-section">
<f:entry title="${%Description}" help="${app.markupFormatter.helpUrl}">
<f:textarea name="description" value="${it.description}" codemirror-mode="${app.markupFormatter.codeMirrorMode}" codemirror-config="${app.markupFormatter.codeMirrorConfig}" previewEndpoint="/markupFormatter/previewDescription"/>
</f:entry>
</div>
<div class="jenkins-section jenkins-section--no-border jenkins-!-margin-top-6">
<f:entry title="${%Description}" help="${app.markupFormatter.helpUrl}">
<f:textarea name="description" value="${it.description}" codemirror-mode="${app.markupFormatter.codeMirrorMode}" codemirror-config="${app.markupFormatter.codeMirrorConfig}" previewEndpoint="/markupFormatter/previewDescription"/>
</f:entry>
</div>

<f:descriptorList field="properties" descriptors="${h.getJobPropertyDescriptors(it)}" forceRowSet="true"/>
<f:descriptorList field="properties" descriptors="${h.getJobPropertyDescriptors(it)}" forceRowSet="true"/>

<!-- additional entries from derived classes -->
<st:include page="configure-entries.jelly" />
<!-- additional entries from derived classes -->
<st:include page="configure-entries.jelly" />

<j:if test="${h.hasPermission(it,it.CONFIGURE)}">
<f:bottomButtonBar>
<!--<input type="button" name="StructureTest" value="Test" onclick="buildFormTree(this.form)" />-->
<f:submit value="${%Save}" large="true"/>
<f:apply value="${%Apply}" large="true" />
</f:bottomButtonBar>
</j:if>
</f:form>
<j:if test="${h.hasPermission(it,it.CONFIGURE)}">
<st:adjunct includes="lib.form.confirm" />
</j:if>
</div>
</div>
</div>
<j:if test="${h.hasPermission(it,it.CONFIGURE)}">
<f:bottomButtonBar>
<f:submit value="${%Save}" />
<f:apply value="${%Apply}" />
</f:bottomButtonBar>
</j:if>
</f:form>
<j:if test="${h.hasPermission(it,it.CONFIGURE)}">
<st:adjunct includes="lib.form.confirm" />
</j:if>
</l:main-panel>
</l:layout>
</j:jelly>
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ THE SOFTWARE.
<p:config-buildWrappers />
<p:config-builders />
<p:config-publishers2 />
</j:jelly>
</j:jelly>
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form" xmlns:st="jelly:stapler" xmlns:t="/hudson/tools">
<t:label />
<f:entry title="${%Command}" field="command">
<f:textarea checkMethod="post"/>
</f:entry>
<f:entry title="${%Tool Home}" field="toolHome">
<f:textbox/>
</f:entry>
<t:label />
</j:jelly>
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form" xmlns:st="jelly:stapler" xmlns:t="/hudson/tools">
<t:label />
<f:entry title="${%Download URL for binary archive}" field="url">
<f:textbox checkMethod="post"/>
</f:entry>
<f:entry title="${%Subdirectory of extracted archive}" field="subdir">
<f:textbox/>
</f:entry>
<f:advanced>
<t:label />
</f:advanced>
</j:jelly>
6 changes: 5 additions & 1 deletion core/src/main/resources/lib/form/descriptorList.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ THE SOFTWARE.
<st:attribute name="title">
Human readable title of the section to be rendered in HTML.
</st:attribute>
<st:attribute name="icon">
Sets the icon on the sidebar item for the section anchor link
The icon isn't visible in the section itself
</st:attribute>
<st:attribute name="descriptors" use="required">
hudson.model.Descriptor collection whose configuration page is rendered.
</st:attribute>
Expand Down Expand Up @@ -65,7 +69,7 @@ THE SOFTWARE.
<j:set var="instances" value="${attrs.instances ?: instance[field] ?: descriptor['default'+h.capitalize(field)]}"/>

<j:if test="${!empty(descriptors) or context['org.apache.commons.jelly.body']!=null}">
<f:section title="${attrs.title}" name="${attrs.field?:attrs.name}">
<f:section title="${attrs.title}" name="${attrs.field?:attrs.name}" icon="${attrs.icon}">
<j:if test="${attrs.field!=null}">
<div class="stapler-class-bag tr">
<div>
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/resources/lib/form/form.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ THE SOFTWARE.
Default: false
</st:attribute>
</st:documentation>
<form id="${id}" class="${class}" action="${action}" method="${method}" enctype="${attrs.enctype}" name="${name}" target="${attrs.target}" autocomplete="${attrs.autocomplete==true?'on':'off'}">
<form id="${id}" class="${attrs.class}" action="${action}" method="${method}" enctype="${attrs.enctype}" name="${name}" target="${attrs.target}" autocomplete="${attrs.autocomplete==true?'on':'off'}">
<div width="100%" class="${attrs.tableClass}">
<d:invokeBody/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/resources/lib/form/rowSet.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ THE SOFTWARE.
</j:when>
<j:otherwise>
<j:if test="${contents.length() != 0}">
<div class="${isFormItem.equals('false') ? '' : 'jenkins-form-item'} ${class}">
<div class="${isFormItem.equals('false') ? '' : 'jenkins-form-item'} ${attrs.class}">
<div ref="${attrs.ref}" class="row-set-start row-group-start tr" style="display:none" name="${attrs.name}"></div>
<j:out value="${contents}" />
<div class="row-set-end row-group-end tr"></div>
Expand Down
10 changes: 8 additions & 2 deletions core/src/main/resources/lib/form/section.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ THE SOFTWARE.
The section header text.
If null is given, the entire &lt;f:section> tag becomes no-op.
</st:attribute>
<st:attribute name="icon">
Optional attribute to set an icon for the section, this is only visible when using section-to-sidebar-items.js
</st:attribute>
<st:attribute name="name">
Optional attribute to create a JSON object from this section.
</st:attribute>
Expand All @@ -42,10 +45,13 @@ THE SOFTWARE.
<div class="${attrs.title!=null ? 'jenkins-section' : ''}">
<j:if test="${attrs.title!=null}">
<div class="jenkins-section__title">
${title}
<div class="jenkins-hidden">
<l:icon src="${attrs.icon ?: 'symbol-settings'}" />
</div>
${attrs.title}
</div>
</j:if>
<d:invokeBody />
</div>
</f:rowSet>
</j:jelly>
</j:jelly>
Loading

0 comments on commit 0f2ef2f

Please sign in to comment.