Commit Graph
8627 Commits
Author SHA1 Message Date
Jesse Glick 90292ed28a Null safety.
Observed in a test against 1.480:
… hudson.model.Executor run
SEVERE: Unexpected executor death
java.lang.NullPointerException
	at hudson.model.Computer.getNode(Computer.java:473)
	at hudson.slaves.SlaveComputer.getNode(SlaveComputer.java:177)
	at hudson.slaves.SlaveComputer.getRetentionStrategy(SlaveComputer.java:609)
	at hudson.slaves.SlaveComputer.taskCompleted(SlaveComputer.java:285)
	at hudson.model.queue.WorkUnitContext.synchronizeEnd(WorkUnitContext.java:140)
	at hudson.model.Executor.run(Executor.java:253)
2014-10-21 11:42:11 -04:00
Oleg Nenashev 6819a620c0 Noting #1411
Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>
2014-10-19 23:47:35 +04:00
Oleg Nenashev e80fa118aa Merge pull request #1411 from synopsys-arc-oss/JENKINS-19017
[FIXED JENKINS-19017] - FileParameter - Handle non-null file parameters as different values
2014-10-19 23:28:14 +04:00
Stephen Connolly 4d987accef Clarify when to use SlaveComputer#setAcceptingTasks over RetentionStrategy#isAcceptingTasks(T) 2014-10-17 12:36:01 +01:00
Stephen Connolly 7acbba330c Typo 2014-10-17 12:21:12 +01:00
Stephen Connolly 10ac2b3ccd add @since tags 2014-10-17 12:20:07 +01:00
Stephen Connolly f07fb85352 Allow Node and RetentionStrategy to contribute to Computer#isAcceptingTasks 2014-10-17 09:38:32 +01:00
Kohsuke Kawaguchi 582128b9ac [FIXED JENKINS-25019]
A truly conforming servlet 3.0 container does not allow us to set "secure cookie" flag beyond ServletContextListener.onInitialized().
If we see that, don't scare the users.
2014-10-16 19:23:23 -07:00
Jesse Glick d2a0a6c2ae Merge pull request #1424 from synopsys-arc-oss/refactoring_User_class
Annotated hudson.model.User methods
2014-10-16 08:58:57 -04:00
Oleg Nenashev 6e5520a7d5 Merge pull request #1416 from dominiquebrice/javadoc_update
Updating javadoc after struggling to add action to nodes
2014-10-16 15:21:40 +04:00
Stephen Connolly f423174d0b Additional safety as an addendum to 34b4bf52ad 2014-10-16 10:26:27 +01:00
Stephen Connolly 34b4bf52ad Do not fail certificate validation because some files in Jenkins Home are not actually certificates
- If there are any files in `$JENKINS_HOME/update-center-rootCAs` that are not ending in `.txt` and are
  not valid certificates, do not blow up the entire certificate checking (and hence the ability to see updates
  or tool installers) but rather ignore those files and warn the user that the file should not be there.
  The correct thing to do is only use as trusted certificates those certificates that parse.

- Also fix resource leak
2014-10-16 10:21:48 +01:00
Dominique 52941e3381 Updating javadoc after struggling to add action to nodes 2014-10-15 22:05:04 -04:00
Oleg Nenashev 04b8ef8a05 Annotated hudson.model.User methods.
The fix also includes comments in #1424 regarding Nonnull usage

Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>
2014-10-16 02:00:47 +04:00
Daniel Beck d5d47edae4 Merge branch 'master' of https://github.com/jenkinsci/jenkins into JENKINS-3539
Conflicts:
	test/src/test/java/hudson/model/ParametersTest.java
2014-10-15 01:13:45 +02:00
Daniel Beck 190f0b6faf [FIXED JENKINS-3539] Prevent empty file creation if left empty 2014-10-15 00:33:49 +02:00
Jesse Glick 95c73c313f NPE in form validation when configured on a non-AbstractProject, like a workflow job. 2014-10-14 08:32:44 -04:00
Kohsuke Kawaguchi e219d19613 Added a method to read a file from the middle 2014-10-13 17:31:08 -07:00
Kohsuke Kawaguchi fad538f9ce read access to log file useful for plugins like support-core 2014-10-13 17:31:08 -07:00
Oleg Nenashev 55f15519ce Noting #1374
Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>
2014-10-11 14:31:09 +04:00
Oleg Nenashev a7cc2a1b3a Merge pull request #1374 from synopsys-arc-oss/JENKINS-24340
[FIXED JENKINS-24340] - Do not disable jobs if supportsMakeDisabled() returns false
2014-10-11 14:20:59 +04:00
Jesse Glick ef6c042447 Merge branch 'JENKINS-24763' of github.com:recampbell/jenkins 2014-10-10 15:28:58 -04:00
Oleg Nenashev d045618e0a Merge pull request #1421 from daniel-beck/JENKINS-24914
[FIXED JENKINS-24914] Don't block indefinitely every other month
2014-10-10 19:24:55 +04:00
Oleg Nenashev d158334f3b Merge pull request #1420 from daniel-beck/JENKINS-16184
[JENKINS-16184] Also escape greater-than character
2014-10-10 09:04:36 +04:00
Jesse Glick aac8c23972 [FIXED JENKINS-25081] Memory leak in BoundObjectTable when ProgressiveRendering is used. 2014-10-09 17:58:39 -04:00
Oleg Nenashev a78f1d3246 [FIXED JENKINS-24340] - Do not disable jobs if supportsMakeDisabled() returns false
This changes prevents the improper usage of method without the preliminary supportsMakeDisabled() check.
As an example, Subversion plugin behaves in such way (JENKINS-24341)

Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>
2014-10-09 17:01:58 +04:00
Daniel Beck adf8305f8b [FIXED JENKINS-24914] Don't block indefinitely every other month 2014-10-09 00:46:11 +02:00
Daniel Beck daacb02057 [JENKINS-16184] Also escape greater-than character 2014-10-09 00:38:22 +02:00
Jesse Glick c8b6f12784 Merge pull request #1414 from mattmoor/master
Convert AbstractProject to better utilize structure form submission.
2014-10-08 00:32:57 -04:00
Jesse Glick bbb60e51ed Adding Option.toString; should make ListBoxModel.toString more useful for tests or debugging. 2014-10-07 14:06:49 -04:00
Jesse Glick f8146742ed Better robustness when action loading fails.
For example, the following should not cause Run.onLoad itself to fail:
java.lang.NullPointerException
	at org.jenkinsci.plugins.workflow.steps.input.InputAction.onLoad(InputAction.java:29)
	at hudson.model.Run.onLoad(Run.java:342)
	at org.jenkinsci.plugins.workflow.job.WorkflowRun.onLoad(WorkflowRun.java:332)
2014-10-06 12:54:24 -04:00
Jesse Glick 6825121f06 [JENKINS-21224] Defend against exceptions in listeners, for now just for ItemListener.
java.lang.RuntimeException: Unable to copy /…/jobs/…/config.xml
	at hudson.plugins.jobConfigHistory.FileHistoryDao.createNewHistoryEntryAndCopyConfig(FileHistoryDao.java:252)
	at hudson.plugins.jobConfigHistory.FileHistoryDao.createNewItem(FileHistoryDao.java:238)
	at hudson.plugins.jobConfigHistory.JobConfigHistoryJobListener.onCreated(JobConfigHistoryJobListener.java:31)
	at hudson.model.listeners.ItemListener.fireOnCreated(ItemListener.java:161)
	at jenkins.model.Jenkins.putItem(Jenkins.java:2483)
	at …
Caused by: java.io.FileNotFoundException: /…/jobs/…/config.xml (No such file or directory)
	at java.io.FileInputStream.open(Native Method)
	at java.io.FileInputStream.<init>(FileInputStream.java:120)
	at hudson.plugins.jobConfigHistory.FileHistoryDao.copyConfigFile(FileHistoryDao.java:178)
	at hudson.plugins.jobConfigHistory.FileHistoryDao.createNewHistoryEntryAndCopyConfig(FileHistoryDao.java:250)
	... 108 more
2014-10-06 10:18:16 -04:00
Daniel Beck fda84f456f Merge pull request #1306 from bkmeneguello/post-cancel-shutdown
[FIXED JENKINS-23020 JENKINS-23942] Convert the queue's cancel shutdown to POST
2014-10-03 22:02:30 +02:00
Jesse Glick c3d7e940d6 NPE during shutdown.
java.lang.NullPointerException
	at hudson.model.User.idStrategy(User.java:140)
	at hudson.model.User.getOrCreate(User.java:373)
	at hudson.model.User.get(User.java:366)
	at hudson.model.User.get(User.java:331)
	at hudson.model.User.get(User.java:441)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.getAuthentication(CpsFlowExecution.java:614)
	at org.jenkinsci.plugins.workflow.cps.CpsVmThread.run(CpsVmThread.java:20)
2014-10-02 16:47:44 -07:00
Kohsuke Kawaguchi 926e5f10bc merged back the RC branch 2014-10-01 12:54:13 -07:00
Kohsuke Kawaguchi a0fe61a098 Merge remote-tracking branch 'security/security' into rc
Conflicts:
	.idea/encodings.xml
	core/pom.xml
	pom.xml
	test/src/test/java/hudson/tasks/junit/CaseResultTest.java
2014-10-01 10:09:42 -07:00
Kohsuke Kawaguchi be195b0e19 [FIXED SECURITY-150]
Integrated the change
2014-10-01 08:21:06 -07:00
Matt Moore eec43983a3 This change converts several optionalBlock's wrapping a single field to inline="true".
By converting several optionalBlock entries to use inline="true", we convert the submitted JSON from:
   "hasPropertyFoo": {
     "propertyFoo": "value"
   },

which is a somewhat unnatural naming scheme, to:
   "hasPropertyFoo": true,
   "propertyFoo": "value",

This enables us to use the pattern:
   if(json.optBoolean("hasPropertyFoo", json.has("propertyFoo"))) {
     ...
   }

To permit either of the following as JSON blobs, for specifying a value for "propertyFoo":
1) "hasPropertyFoo": true,            # What comes through from jelly
   "propertyFoo": "value",

2) "propertyFoo": "value",

It also allows any of the following as JSON blobs, for NOT specifying a value for "propertyFoo":
3) "hasPropertyFoo": false,           # What comes through from jelly
   "propertyFoo": "value",

4) "hasPropertyFoo": false,

5) (nothing specified)

NOTE: The main interest in flexibility in what JSON comes through is in support of: https://wiki.jenkins-ci.org/display/JENKINS/YAML+Project+Plugin, this is also the purpose of the couple renames that are mixed in with this.
2014-09-29 09:36:19 -07:00
Matt Moore 86c911e8b9 Switch to using inline optionalBlock for several AbstractProject checkboxes so that we are passed a boolean, instead of either null or {}.
NOTE: The discrepancy between inline-optionalBlock and f:entry/f:checkbox is the text alignment, which optionalBlock keeps consistent with other elements (and what is done for these today).
2014-09-28 21:10:40 -07:00
Matt Moore 873de8cd22 Switch the source of a number of AbstractProject config options from StaplerRequest to JSONObject.
This change shifts the way a number of form elements are accessed when handling AbstractProject's doConfigSubmit from using "req.getParameter(...)" style access to using JSON-style (structured form submission) access through "reg.getSubmittedForm()".
2014-09-28 19:33:47 -07:00
Oleg Nenashev 7c4f6b7ef4 [FIXED JENKINS-19017] - FileParameter - Handle non-null file parameters as different values
The change prevents the issue when Jenkins merges builds with different files coming from one source (It may happen!).

Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>
2014-09-28 18:11:57 +04:00
Craig Rodrigues 1c1a4b7544 Add getFieldOrder() methods.
Add getFieldOrder() methods to classes which extend com.sun.jna.Structure,
for compatibility with newer versions of JNA.  [JENKINS-24521]
2014-09-27 17:22:54 -07:00
Kohsuke Kawaguchi 28d997704f [FIXED SECURITY-159]
Bumping up dependencies to 1.3.1, with extra precaution to make
DiskFileItem non-serializable
2014-09-27 15:51:47 -07:00
Jesse Glick c1e8b150b3 Simplifying JSONException handling in doConfigSubmit to use standard (?) error reporting.
Also sending the exception to the log, which is where plugin developers expect to see it.
(This is also necessary for the exception to be visible say from configRoundtrip in a functional test.
Otherwise you just see a FailingHttpStatusCodeException due to the 400 error code, with no details.)
Might actually suffice to just throw a ServletException wrapping the exception up the chain,
letting Stapler or the container handle it, but this change is more conservative.
2014-09-25 14:10:44 -04:00
Jesse Glick 2751bf4ac5 sendError(Exception…) should set the exception attribute on the response, since error.jelly handles this nicely. 2014-09-25 14:06:51 -04:00
Nicolas De Loof d54bc061b1 Merge branch 'JENKINS-24825' 2014-09-24 23:21:04 +02:00
Jesse Glick b2bb58895f Trying to improve a useless log warning when starting Docker slaves.
… hudson.tasks.Shell$DescriptorImpl getShellOrDefault
WARNING: Remote call on …@docker failed
2014-09-24 13:58:12 -04:00
Jesse Glick 511af1cea0 Noting that CloudSlaveRetentionStrategy appears to be a poor reimplementation of CloudRetentionStrategy. 2014-09-24 12:59:45 -04:00
Jesse Glick c04cdcd9f7 [FIXED JENKINS-22769] ItemListener callbacks should run as SYSTEM since they sometimes do ACL-checked calls. 2014-09-24 11:06:00 -04:00
Jesse Glick 253943e13e [JENKINS-5756] Removing workarounds for HotSpot bug.
https://bugs.openjdk.java.net/browse/JDK-6933067 claims to be fixed as of Java 6, our baseline.
2014-09-24 09:32:50 -04:00