| Type |
Bug
|
| Priority |
Normal
|
| Assignee | |
| Affected Versions |
16.0.3, 16.0.4, 16.0.5
|
| Labels |
No labels
|
Issue Votes (0)
| Type |
Bug
|
| Priority |
Normal
|
| Assignee | |
| Affected Versions |
16.0.3, 16.0.4, 16.0.5
|
| Labels |
No labels
|
Summary
TOD 4.1.0 cannot create an issue or change an issue state against OneDev 16.0.3 through 16.0.5 when Issue.addMissingFields() is reached. The server returns HTTP 500:
The regression appears to have been introduced by commit 6d1b0475 (OD-2848).
Environment
1dev/server:16.0.5The container uses the official image, has no custom OneDev plugins, no duplicate server/Wicket jars, and logs no OOM or database errors.
Reproduction
Prompt upon issue open. The affected instance also has valid show conditions/default values depending on another issue field.Actual result
TOD receives HTTP 500. Server stack for issue creation:
State transition fails through the same field path:
Expected result
TOD should create the issue or change its state successfully. Issue default/show-condition evaluation in a Jersey REST request must not require a Wicket page/application context.
Regression analysis
In OneDev 16.0.2, Issue.addMissingFields() called:
and FieldUtils pushed a ComponentContext only when it was non-null.
Commit 6d1b0475 changed this to:
and now unconditionally calls:
newBeanComponentContext() creates a FakeComponent extending MarkupContainer. This works in a Wicket UI request, but TodResource runs in Jersey and has no Wicket application attached to its thread.
The same code is still present in OneDev 16.0.5.
Suggested direction
Please make field default/show-condition evaluation usable in a headless REST context, or avoid constructing a Wicket Component from Issue.addMissingFields() when invoked by TOD/API services. A regression test covering both TodResource.createIssue and TodResource.changeIssueState with prompted/conditional fields would help prevent recurrence.