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.
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).
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()".
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>
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.
When we are allowing all callables through, we want to enable remote class loading
(just in case someone is using it legitimately), but continue logging callable issues.
Currently there is no remoting flag to allow remote class loading while logging it.
If we ever decide to develop a compatibility thunk library for these changes to help promote deployment in plugins,
then these classes being a nested type is problematic as they'll fail to load under onld Jenkins
The result of a misunderstanding.
BYPASS_LOG can be deleted by the time we release, and for its temporary purpose, runtime modification is not necessary.
It would just provide so much flexibility that would come in handy for operators.
- One can control this feature from $JENKINS_HOME/groovy.init.d/*.groovy. When these are managed by Chef/puppet,
this make it very clean to apply this as a patch.
- The log file is getting too big and wants to rotate? No problem with quick groovy script from the console
(or from CLI if you need to do the same with 12 masters)
- Shipping the log over to network instead of local file? No problem!
I thought your primary concern of field being unreachable from outside is already addressed via @Restricted(NoExternalUse).
Assertions are only for cases where you believe the failure of the condition is impossible.
For cases where external code might mistakenly make an incorrect call, throw an exception.