Commit Graph
14229 Commits
Author SHA1 Message Date
Yaroslav Afenkin 1b9f1ccdbb [SECURITY-3188] 2023-07-13 07:24:44 +00:00
1ec59c737a [JENKINS-71438] Replace browser confirm with modal dialogs (#7938)
Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com>
Co-authored-by: Tim Jacomb <timjacomb1@gmail.com>
2023-07-12 08:13:18 +01:00
Jesse Glick 8de949bb31 LazyBuildMixIn.getEstimatedDurationCandidates duplication (#8233) 2023-07-11 17:34:49 +02:00
df4972fb70 [JENKINS-70059] Improve Safe Restart interface and user information (#7355)
Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com>
Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com>
Co-authored-by: Alexander Brandes <mc.cache@web.de>
Co-authored-by: Tim Jacomb <timjacomb1@gmail.com>
2023-07-07 08:34:40 +01:00
Mark Waite 211f67a464 Read end of life data file less often (#8220)
Remember the lines that were read from the file and the last file that was
read so that the next iteration can reuse the data that was already read.
No need to read `/etc/os-release` once for each entry in the JSON file.
The contents of the file won't change from the first entry to the last
entry in the JSON file.

This won't change much, since the read operation is probably already
cached by the operating system with a file as small as `/etc/os-release`.

Cached file content is deleted at the end of the loop over the JSON file.
2023-07-06 19:00:47 -06:00
Vincent Latombe d99bafdebd [JENKINS-71553] Add history widget factory for job not implementing Queue.Task (#8221)
[JENKINS-71553] Add history widget factory for job not implementing Queue.Task

like hudson.model.ExternalJob
2023-07-03 11:02:32 -06:00
Basil CrowandMark Waite 7cbe60fa5e Non-varargs call of varargs method with inexact argument type for last parameter (#8205)
Co-authored-by: Mark Waite <mark.earl.waite@gmail.com>
2023-06-30 17:53:21 +02:00
Alexander Brandes 9e65c05201 Fill in todo annotations (#8209) 2023-06-29 20:39:53 +02:00
cui fliter aa983a734c Fix a typo in DomainValidator's docs (#8163)
fix some typos

Signed-off-by: cui fliter <imcusg@gmail.com>
2023-06-19 13:20:49 +02:00
Basil Crow 8240e0736c Remove usages of org.apache.commons.io.output.NullOutputStream (#8144) 2023-06-16 08:44:01 +01:00
Basil Crow a9cbc1df87 Remove usages of org.apache.commons.io.input.NullInputStream (#8145) 2023-06-16 08:43:55 +01:00
Basil Crow 77f024ae6b Remove usages of org.apache.commons.io.output.ByteArrayOutputStream (#8146) 2023-06-16 08:43:50 +01:00
Basil Crow d3417ebec9 Forward compatibility for Commons IO 2.13.0 in hudson.Util#loadFile (#8142) 2023-06-15 09:57:18 +02:00
Jesse Glick eaf91000cb TransientActionFactory cache simplification (#8048)
* `TransientActionFactory` cache simplification

* Fixing mocks in `HistoryPageFilterTest`
2023-06-14 09:31:28 +02:00
Basil Crow ffd2afe45b Deprecate hudson.util.NullStream (#8128) 2023-06-14 09:31:17 +02:00
Jesse Glick 9be693daae Clean up DoubleLaunchChecker (#8127) 2023-06-14 09:31:09 +02:00
Basil Crow 6b47363c22 Deprecate hudson.util.IOUtils#skip (#8126) 2023-06-14 09:30:58 +02:00
Vincent Latombe 96620b0aa8 Merge pull request #7932 from Vlatombe/pluggable-widgets 2023-06-08 17:47:56 +02:00
Basil Crow 41edd5faf4 Remove usages of IOUtils#toByteArray (#8098) 2023-06-08 16:18:12 +02:00
Basil Crow d54041e24a Move from javax.inject to jakarta.inject (#8065)
* Move from `javax.inject` to `jakarta.inject`

* https://github.com/jenkinsci/jenkins/pull/8065#pullrequestreview-1451239883
2023-06-05 22:49:35 +02:00
Vincent Latombe 5e27528b36 Merge branch 'master' into pluggable-widgets 2023-06-05 17:39:29 +02:00
Michael KepplerandAlexander Brandes 9061e7bc23 [JENKINS-71244] Avoid relative link in update center (#7992)
* convert the relative link to an absolute one, since it might be used
in different contexts (with different depth from the server root
directory)
* update all message bundles to use the new format argument

Co-authored-by: Alexander Brandes <mc.cache@web.de>
2023-05-31 14:57:09 +02:00
Jesse Glick fe52887da2 Lazy-load-friendly Job.getEstimatedDurationCandidates (#7998) 2023-05-29 16:00:42 +01:00
Vincent Latombe cb1d2dc532 Make Cloud#reconfigure public as it is necessary for downstream implementations (#8053) 2023-05-29 16:00:23 +01:00
Vincent Latombe 34893ce42f Fix reviews, give unique symbols 2023-05-26 10:44:46 +02:00
ab06bf517c Warn when operating system end of life is approaching (#7913)
* Ubuntu 18.04 end of life admin monitor

First prototype that includes a user interface and localized messages
with parameters to support the specific operating system.

* Use a base class for common features

Admin monitors are disabled and enabled by a user interface action.
There is not an obvious way to detect that a date has passed so that it
should be enabled again.

* Better comment

* Make the logging clearer

* Split pattern check to separate method

* Add a message to show after end of life

* Suppress most logging

* Minor logging improvements

* Use actual end of life date for Ubuntu 18.04

* Logger not needed

* Add Alpine 3.14 end of life admin monitor

* Add Alpine 3.15 end of life monitor

* Add Alpine 3.16 end of life monitor

* Add Alpine 3.17 end of life monitor

* Spotless cleanup

* Add Fedora 37, 38, and Red Hat 7

* More accurate regex to detect version

* Add Debian 10 end of life admin monitor

* Add a few tests

* Add another test

* Fix checkstyle violations

* Fix spotbugs warning

* Correct the copyright

* Make test viable on non-Linux machines

Do not depend on the existence of /etc/os-release

* Name the setup function more accurately

* Test a file with non-matching content

* Test the Alpine end of life admin monitors

* Add more tests

* Test Fedora 37 admin monitor

* Add RHEL 7 test

* Announce RHEL 7 early end of support immediately

* Use consistent logging calls

* Add Red Hat 8 to RHEL 7 as a test

* Use past date to report RHEL 7 end of life

* Remove Red Hat 8 from RHEL 7 end of life

* Log more information

* Display end of support date

Incorrect to declare end of support as the date when we begin warning
the user about end of life.

* Add descriptions of the admin monitors

* Use a better redirect URL

* Group admin monitors better by display name

* Remove unnused message.properties files

* Add description.jelly file

* Better description of the admin monitors

* Add endOfSupportDate getter

Needed for UI

* Fix minor indentation error

* Each monitor must be independently disabled

* Repurpose identifier for use in disabled property

Don't need the idenitfier anywhere except in the initial constructor
call that is later used to enable and disable the admin monitor.

* Add Red Hat 8 to RHEL 7 as a test

* Add os-release tests and data files

* Remove unused URL arg to constructor

* Reduce duplication in data

Easier to test with symbolic constants that are consistently named across
all the classes.

Includes tests of os-release files from each of the end of life operating systems

* Fix inaccurate comment

* Use constant for documentation URL

* Remove RHEL 8 from RHEL 8 Admin Monitor

* Fedora 36 security support ends 18 May 2023

* Fedora 37 support ends 15 Dec 2023

* Fix spelling error in description

* Read data file with UTF-8 character set

* Do not use extension point name in symbol

* Use single word 'Ignore' in button, not name of monitor

* Use a smaller layout for monitor name

* Include operating system version in RHEL 7 check

Includes a TODO comment to remove the RHEL 8 entry that I use for
testing and development

* Fix regex syntax error

* First prototype using a data file

* Start the conversion to a single monitor

* Latest experiments with end of life data as JSON

* More exploring and evolving

* Remove Alpine admin monitor

* Remove Fedora admin monitor

* Remove Debian admin monitor

* Remove Ubuntu admin monitor

* Throw IOException rather than check for null

IOException should be uncommon and mistakes should be detected by
automated tests

* Stop inheriting from EndOfLifeAdminMonitor

* Simplify initialization logic

Else clauses not required due to break.

* Add isActivated implementation

* Add setDisabled test method

* Minor formatting changes

* Test some additional methods

* Call super in constructor

* Minor updates from study of upstream class

* Format JSON data

* Fix formatting errors

* Fix assertion

* Better variable naming

* Explain the purpose of ignoreEndOfLife flag

* Remove unused import

* Store the pretty name, not the pattern

* Test pretty name with sample os-release data files

* Remove RedHat 7 specific monitor

* Set RHEL 8 end of life early for test

* Ongoing debugging

* Describe the monitor

* Honor start date

* Add pretty name as monitor attribute

* Add end of support date

* Remove earlier implementations

* Move end of life data

* Rename end of support to end of life

End of life is used throughout the monitor

* Improve message with after end of life date status

* Undo .gitignore change

* Rename effective date to end of life date

* Rename pretty name to operating system name

* More rename of prettyName

* Fix logging mistakes

* Add RHEL 8

* Default start date is 6 months before end of life

* Add operating system end of life patterns and dates

* Fix JSON file formatting

* Simplify logging code

* Better logging

* Add Alma and Rocky Linux tests and patterns

* Add methods to help test automation

* Remove unused methods

* Start warning RHEL 7 users immediately

* Suppress spotbugs traversal_in warning - false positive

* Throw IOException on bad data file

Fail tests quickly when a a bad data file is used

* Better exception message

* Correct RHEL 8 end of life date

* Enable isActivated test

* Increase test coverage

* Fix spelling error

Co-authored-by: Alexander Brandes <brandes.alexander@web.de>

* Remove non-breaking spaces from message

Non-breaking spaces are not recommended.

Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com>

* Rename class to match symbol

https://github.com/jenkinsci/jenkins/pull/7913/files#r1199814150

* Sort end of life data alphabetically

* Included OS query parameter and fragment in docs URL

The fragment may be useful in the future for analytics.  Harmless to
send the fragment to www.jenkins.io and www.jenkins.io may be able to
make use of it to direct the reader to information that is specific to
their operating system.

* Scientific Linux 8 does not exist

* Remove fragment, only need query parameter

https://github.com/jenkinsci/jenkins/pull/7913#discussion_r1200991347
is the comment that prompted the improvement.

---------

Co-authored-by: Alexander Brandes <brandes.alexander@web.de>
Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com>
Co-authored-by: Alexander Brandes <mc.cache@web.de>
2023-05-25 11:25:39 -06:00
Vincent Latombe 5e44136ffb Inline WidgetFactory#createWidgetsFor and be a bit more lenient. 2023-05-23 05:26:41 +02:00
Vincent Latombe ad60070ea1 Fix reviews 2023-05-23 05:19:22 +02:00
Vincent Latombe 366dd28b1a Merge branch 'master' into pluggable-widgets 2023-05-23 05:11:51 +02:00
Allan Burdajewicz a45f0601fc [JENKINS-71200] Fix elements property overload in ListView (#7942)
* [JENKINS-71200] Add test for ListView attributes overloads

* [JENKINS-71200] Fix elements property overload in ListView
2023-05-22 20:35:13 +02:00
Alexander Brandes ddadebb7e9 Address javadoc warning and setup quality gates (#8024) 2023-05-21 12:22:46 +02:00
d412838cb6 Unrestrict UserSeedChangeListener (#7997)
* Unrestrict UserSeedChangeListener

Long overdue judging from the TODO

Used in CloudBees product so it makes sense to clarify it.

* Apply suggestions from code review

Co-authored-by: Jesse Glick <jglick@cloudbees.com>

* Update core/src/main/java/jenkins/security/seed/UserSeedChangeListener.java

Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com>

---------

Co-authored-by: Jesse Glick <jglick@cloudbees.com>
Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com>
2023-05-21 12:19:34 +02:00
Jesse Glick 1bc0cd0920 Broken toArray implementations in BuildReferenceMapAdapter (#7999) 2023-05-20 12:48:30 +02:00
Vincent Latombe 955ad0315d AbstractItem#doReload should not be calling SaveableListener#fireOnChange (#7984)
* Abstract#doReload should not be calling SaveableListener#fireOnChange

Was initially added as ce7e6390ee

SaveableListener.fireOnChange is typically called when saving an object,
not when loading it. This call should be removed.

* Verify new behaviour with a test

* Only make the test extension applicable to the reload test case
2023-05-20 12:47:08 +02:00
Jesse Glick b560aa455c Introduced utility HttpServletFilter (#7892)
* Introduced utility `HttpServletFilter`

* Forgot to actually register `ResourceDomainFilter`
2023-05-20 12:46:48 +02:00
Alexander Brandes cb83b3f68d Replace hourglass tango icon with ionicon (#8005)
Replace hourglass with ionicon
2023-05-17 23:29:32 +02:00
Vincent Latombe 0b108ac823 Adapt BuildQueueWidget to use QueueItem 2023-05-16 09:22:57 +02:00
Vincent Latombe 33e777a5b8 Merge branch 'master' into pluggable-widgets 2023-05-16 09:06:03 +02:00
Jesse Glick 1ce978a041 Refinements to AssociatedConverterImpl.cache (#7976)
* Refinements to `AssociatedConverterImpl.cache`

* Maintain a separate static cache just for the class loading
2023-05-16 09:02:05 +02:00
Vincent LatombeandJesse Glick cce017cdec Introduce jenkins.model.queue.QueueItem interface (#7926)
* Introduce jenkins.model.queue.QueueItem interface

This formalizes methods used by <t:queue> taglib to do the rendering of queue items.

* Apply suggestions from code review

Co-authored-by: Jesse Glick <jglick@cloudbees.com>

* Implement default Queue.Task methods to simplify Mock item

* Do the right thing automatically if the Queue.Task implements AccessControlled

---------

Co-authored-by: Jesse Glick <jglick@cloudbees.com>
2023-05-16 09:01:56 +02:00
Jesse Glick 86f0ac8d05 More useful logging in Trigger (#7967) 2023-05-12 17:26:07 +02:00
Vincent Latombe 997bb2dcb7 Revert "Allow CloudSet to have widgets"
This reverts commit c79f96bb68.
2023-05-09 09:52:19 +02:00
Vincent Latombe 1b55b9a9ed JenkinsWidgetFactory is not part of API 2023-05-09 09:50:49 +02:00
Basil CrowandTim Jacomb bc0babac22 Add a user experimental flag to run Jenkins without Prototype.js (#7948)
Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com>
2023-05-08 13:30:22 +01:00
Jesse Glick 8d9e8b901c [JENKINS-71182] Correct Unicode behavior of XML_1_1 (#7924) 2023-05-05 09:27:18 -07:00
Vincent Latombe c79f96bb68 Allow CloudSet to have widgets 2023-05-05 17:32:11 +02:00
Vincent Latombe 95840c1fb7 Fix @Deprecated annotation 2023-05-05 16:55:46 +02:00
Vincent Latombe 65d6007593 Add missing javadoc 2023-05-05 16:52:51 +02:00
Vincent Latombe 4338482db1 Checkstyle 2023-05-05 13:26:25 +02:00
Vincent Latombe 7aceb122c6 Record owner url in the widget so that it exposes url relative to context path. 2023-05-05 11:13:36 +02:00