Commit Graph
694 Commits
Author SHA1 Message Date
Akbashev Alexander 2e8c3bec8e [FIXED JENKINS-39535] - Optimize get log method (#2607)
* Add some tests to  current behaviour of getLog method

* getLog(maxLines) reads only last maxLines lines now

It should speed up and reduce memory consumption for some plugins (i.e.
Email-ext Plugin).
Also now this method could be used to get last lines of build output in efficient manner.

* Fix issues from code review
2016-11-06 11:25:58 +01:00
Stephen Connolly 183fac8a63 [JENKINS-39404] Introduce an addOrReplaceAction method with dirty return type
- We cannot modify `replaceAction` to return the dirty flag, in fact most callers probably don't care... but if you do care, we now provide `addOrReplaceAction`
- Clarify the javadocs to reflect that these methods are not going to affect actions added by transient action factories
2016-11-02 09:16:42 +00:00
Stephen Connolly 65de34f7b9 [JENKINS-39404] Minimize non-changes affecting write to disk requirement 2016-11-01 15:36:33 +00:00
Stephen Connolly f03e6fd1ca [JENKINS-39404] Allow a more generic replaceActions 2016-11-01 13:29:56 +00:00
Stephen Connolly 1990e3d09a [FIXED JENKINS-39404] Restore symmetry by adding removeAction and removeActions methods to Actionable 2016-11-01 13:17:25 +00:00
Stephen Connolly 71cbe0cc7c [JENKINS-36871, JENKINS-37565] JNLP4-connect implementation and Remoting 3 (#2492)
* [JENKINS-36871] Switch to the new JnlpProtocolHandler based implementation

Todo

- [ ] Restore the cookie behaviour (but done right this time)
- [ ] Perhaps investigate issuing clients with TLS certificates (but would require a UI for managing them)

* [JENKINS-36871] License headers and javadocs

* [JENKINS-36871] Restore cookie handling

* [JENKINS-36871] Integrating Agent discovery components

* [JENKINS-36871] Pick up remoting 3.0-SNAPSHOT

* [JENKINS-36871] Pick up newer snapshot

* [JENKINS-36871] Oleg wants to log an exception that cannot happen
2016-10-20 13:01:30 +02:00
Oleg Nenashev 7d886ce9fb [FIXED JENKINS-35967] - Make User#isIdOrFullnameAllowed() more robust against restricted usernames (#2413)
This change hardens username verification in user creation commands. See the issue to get rexamples.

https://issues.jenkins-ci.org/browse/JENKINS-35967
2016-10-15 16:57:02 -07:00
Oliver Gondža 7f6f495f86 Avoid deprecated findbugs annotations (#2144)
* Avoid deprecated findbugs annotations

* One more forgotten annotation
2016-10-15 12:53:56 -07:00
Nicolas De Loof 7b39424495 rely on try-with-resources 2016-10-03 15:12:48 +02:00
Oliver Gondža 11af7d0bc1 [FIXED JENKINS-37616] Make Cloud.PROVISION independent from Jenkins.ADMINISTER (#2521) 2016-08-27 22:23:08 +02:00
dbroady1 f4edf91782 [JENKINS-29956] Test Windows junctions before Java 7 symlink (#1787)
* Test Windows junctions before Java 7 symlink

Apparently Java 7 (and later) do not count Windows junctions as
symlinks.  When you drill down into the BasicFileAttributes structure,
reparse points are only counted under isOther.  So, since we already
have code that properly detects Windows Junctions, let's use that first
and then fallback to the Java 7 code.

* Add comment for change & link bug.

* Add test case

* Switch to Functions.isWindows().

* Use non-deprecated APIs for tmp file/dir mgmt

* Add better debugging.

* Allow spaces in junction name & dir name.

To do that, it was easier to use ProcessBuilder vs building up the correct
string in code to send to cmd.exe.

Also, I'll note that according to http://ss64.com/nt/syntax-internal.html,
mklink is in internal cmd.exe command.  So, it must be invoked through
"cmd.exe /c" for it to work.

* Remove comment mentioning bug number.

* Remove debugging output, per Baptiste's request

* Add newline at end of file.

* Make sure that the junction was removed.

* Use assertEquals to show retcode of Process.waitFor.

* Fix compilation errors by importing functions
2016-08-22 15:21:33 +02:00
Oleg Nenashev 96c97860b0 [FIXED JENKINS-37332] - Prevent File descriptor leaks when reading manifests from JARs (#2516)
* [JENKINS-37332] - Improve diagnostics of non-closed streams during reading of the manifests in PluginManager

* [JENKINS-37332] - Leakless processing of JarUrlConnection during Manifest parsing

* [JENKINS-37332] - Also implement leak-safe method for retrieving file modification date

* [JENKINS-37332] - Add spotcheck methods for manifest file access + Javadoc

* [JENKINS-37332] - Also test multi-line and empty attributes in the test
2016-08-21 00:00:41 +02:00
Stephen Connolly 136aeb86a4 [JENKINS-37189] Refactor to make more testable
- A pure unit tests will suffice
2016-08-09 11:07:53 +01:00
DJ Lee 55203ebeed [FIXED JENKINS-31791] Optimize BuildHistoryWidget (#2456)
* [FIXED JENKINS-31791] Optimize BuildHistoryWidget

Refactor HistoryPageFilter to lazily evaluate an iterable of previous
runs, instead of instantiating a super long list of builds.
Instantiating the whole list can be problematic with lots of
historical builds especially if disk IO is slow.
2016-08-02 20:38:58 +02:00
Jesse Glick b6dfdf4c8e Merge branch 'master' into LoggerRule 2016-07-11 11:05:00 -04:00
Jesse Glick 12fd3e47e3 [FIXED JENKINS-27530] Jenkins.reload must also reload the Queue to ensure that every Queue.Item.task corresponds to a live Job, lest nextBuildNumber be bogus. 2016-07-07 20:50:54 -04:00
Jesse Glick c69a0cd762 Use LoggerRule. 2016-07-07 20:20:47 -04:00
Alvaro Lobato 5fdf33ba9b [JENKINS-20187] - Handle growing files when creating a tar file. (#2419)
* [JENKINS-20187] - Handle growing files when creating a tar file.

* - Introduce try-with-resources
- Remove exception login
- Throw new exception with filename and addSuppresed

* Address jglick comments
2016-07-02 18:21:58 +02:00
Stephen Connolly 5a0d7ece6a Merge pull request #2427 from stephenc/jenkins-36280
[FIXED JENKINS-36280] Enable DescriptorVisibilityFilter for Slave's C…
2016-07-01 17:06:45 +01:00
Thomas Pilot 6d29dd4554 [FIXED JENKINS-36232] NPE during SCM polling (#2425)
* [FIXED JENKINS-36232] NPE during SCM polling

* add test to trigger the "no veto" code path that has the NPE

* incorporate remark on using @Issue reference
2016-06-30 12:18:17 +02:00
Michal Slusarczyk fa1c03b0d8 [JENKINS-21486] Fixing optional dependency version resolution. (#2421)
Without it version of optional dependencies is set to "X.Y;resolution:=optional" which causes problems when using hudson.util.VersionNumber comparison methods.
2016-06-29 20:02:28 +02:00
Stephen Connolly 53adb022e4 [FIXED JENKINS-36280] Enable DescriptorVisibilityFilter for Slave's ComputerLauncher, RetentionStrategy and NodeProperty 2016-06-28 17:07:00 +01:00
Oleg Nenashev 200a0beb74 [JENKINS-33600] - User#isIdOrFullnameAllowed() should be tolerant against null parameters (#2406)
* [JENKINS-33600] - User#isIdOrFullnameAllowed() should be tolerant against null parameters

* [JENKINS-33600] - Add the follow-up TODO
2016-06-16 13:21:04 +02:00
peppelan 15ce24ae4d [JENKINS-35198] - DelegatingComputerLauncher should accept child classes in its hooks (#2384)
* JENKINS-35198 Add failing test for clear identification of the issue and future regression test

* JENKINS-35198 Fix DelegatingComputerLauncher logic for filtering out subclasses as possible delegates

this logic is by default, and subclasses can still allow the selection of other DelegatingComputerLauncher instances as delegates.
2016-05-29 14:38:32 +04:00
Vincent Latombe 0c16c8576b [JENKINS-23507] Make FilePath.installIfNecessaryFrom follow redirects (#2331) 2016-05-13 12:36:45 +02:00
Jesse Glick c2d0a5778e Merge commit '97a0fa0d036b9d3873c9b269123020a42e7ee3e9' into security-master 2016-05-11 12:07:25 -04:00
Daniel Beck 240405dfc3 Merge pull request #2026 from pjdarton/fix_jenkins_15331
[FIX JENKINS-15331] Windows file locking workaround
2016-05-04 01:32:27 +02:00
Jesse Glick 888ca85784 Merge branch 'security-stable-1.651' into security-master 2016-04-28 17:38:40 -04:00
Jesse Glick c08e0bf79d Merge branch 'security-stable-1.642' into security-stable-1.651 2016-04-28 17:38:13 -04:00
Jesse Glick 11120802c1 Merge branch 'security-stable-1.625' into security-stable-1.642 2016-04-28 17:37:52 -04:00
Jesse Glick c88268d870 Merge branch 'security-stable-1.609' into security-stable-1.625 2016-04-28 17:36:42 -04:00
Daniel Beck 38f8b43e8d [SECURITY-276] Add more tests for relative URLs 2016-04-28 00:45:43 +02:00
Daniel Beck e6efae7d0d [SECURITY-276] Better method name, add tests 2016-04-27 13:51:10 +02:00
Craig Rodrigues 0a97623834 In testParse_with_XXE(), use more temporary variables
This will help isolate the source of exceptions
thrown in this test.
2016-04-13 11:49:40 -07:00
Daniel Beck 1fe9cf7b7a Merge branch '2.0' of github.com:jenkinsci/jenkins 2016-04-07 11:52:44 +02:00
Craig Rodrigues 0611d0788a Remove use of '<' and '>' which cause javadoc errors
Tested with Java 8 and "mvn javadoc:test-javadoc".  Eliminates errors such as:

    [ERROR] java/hudson/os/DCOMSandbox.java:18: error: bad use of '>'
2016-04-06 15:52:04 -07:00
Craig Rodrigues e0daa5c4e8 Fix href links
Eliminates errors with Java 8 and "mvn javadoc:test-javadoc" such as:

    [ERROR] jenkins/core/src/test/java/hudson/os/DCOMSandbox.java:18: error: bad use of '>'
2016-04-06 15:52:04 -07:00
Daniel Beck d182cdf223 Merge branch 'master' of github.com:jenkinsci/jenkins into 2.0 2016-04-06 19:18:44 +02:00
Baptiste Mathus 2c9adc9965 Merge pull request #2221 from rodrigc/java8_fix1
Do not use '_' as an identifier
2016-04-06 15:39:40 +02:00
Craig Rodrigues 552d8a6b95 Fix href tags
Eliminates errors with Java 8 and "mvn javadoc:test-javadoc" such as:

    [ERROR] jenkins/core/src/test/java/hudson/model/ItemsTest.java:12: error: unknown attribute: hef
    [ERROR] * @author: <a hef="mailto:nicolas.deloof@gmail.com">Nicolas De Loof</a>
2016-04-05 12:35:30 -07:00
Craig Rodrigues 84fa59a87c Do not use '_' as an identifier
Eliminates Java 8 warnings:
  (use of '_' as an identifier might not be supported in releases after Java SE 8)
2016-04-05 11:03:08 -07:00
Emilio Escobar f6db6670a8 [JENKINS-28790] Baptiste comments fixed
(cherry picked from commit 7fb1ac9d9f)
2016-03-30 11:58:21 +02:00
Emilio Escobar 0782aa567b [JENKINS-28790] solved the issue masked parameters not masked in windows system. toWindowsCommand joins all args in one, missing masked.
(cherry picked from commit b9a72bcd96)
2016-03-30 11:58:21 +02:00
Daniel Beck 869f66cc07 Merge branch 'master' of github.com:jenkinsci/jenkins into 2.0
Conflicts:
	changelog.html
	cli/pom.xml
	core/pom.xml
	core/src/main/java/hudson/ProxyConfiguration.java
	core/src/main/java/jenkins/model/Jenkins.java
	core/src/main/java/jenkins/slaves/JnlpSlaveHandshake.java
	core/src/main/resources/hudson/model/Messages_da.properties
	pom.xml
	test/pom.xml
	war/pom.xml
2016-03-16 19:00:40 +01:00
Oliver Gondža 8ba59197e4 Merge pull request #2049 from pjanouse/JENKINS-33037
[FIXED JENKINS-33037] Fixed malformed ranges in RangeSet.fromString()
2016-03-16 13:26:17 +01:00
Ing. Pavel Janousek c1621a2bd0 [JENKINS-33037] Fixed malformed ranges in RangeSet.fromString()
Fix for rejecting malformed ranges in
hudson.model.Fingerprint.RangeSet.fromString(...)
2016-03-10 16:35:58 +01:00
Stephen Connolly f68f5fb24f [FIXED JENKINS-33414] Added an API to allow identification of the Jenkins JVM
- Fix the ProxyConfiguration code to not require Jenkins class to be loaded in remote JVMs
2016-03-08 23:05:00 +00:00
Daniel Beck 074890c093 Merge pull request #2015 from escoem/JENKINS-28790
[FIX JENKINS-28790] Masked parameters are now hidden on Windows
2016-03-08 16:28:17 +01:00
Sam Van Oort e136952d2a Remove remainder of ConcurrentHashMap testcase 2016-03-02 10:53:03 -05:00
Jesse Glick 383a5aec51 [FIXED JENKINS-22767] Make sure only one thread actually loads a given build.
(cherry picked from commit d5167025a2)
2016-03-02 08:55:48 +01:00