Repository navigation
Adopting Spring Boot Multipart Configuration for File Uploads - #16040
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 8.0.x #16040 +/- ##
==================================================
+ Coverage 56.1289% 56.1306% +0.0017%
- Complexity 21610 21611 +1
==================================================
Files 2122 2123 +1
Lines 102881 102885 +4
Branches 18395 18396 +1
==================================================
+ Hits 57746 57750 +4
+ Misses 36889 36888 -1
- Partials 8246 8247 +1
🚀 New features to boost your workflow:
|
|
@martei I've added a paragraph in the upgrade guide here as well |
jdaugherty
left a comment
There was a problem hiding this comment.
This is a breaking change. I am ok with this but I would like to know if @jamesfredley is ok with this
…ith Grails config
…ith Grails config
…se-spring-upload-config
…ith Grails config
…se-spring-upload-config
c973b31 to
90dacd3
Compare
@jdaugherty No, it is still needed. #16149 changed how an oversized upload fails, not where the limits come from. On It does need a rebase though. Two files conflict, and a few things #16149 added now reference the old properties and have to move over with it:
@gsartori are you able to rebase, or would you like me to push the rebase onto your branch? |
|
This still needs a rebase onto current Once rebased, please also move the leftover
I approve this after that rebase and cleanup are done. Please squash on merge. |
Resolves the conflicts with apache#16149 and moves what that PR added over to the Spring Boot multipart properties: - ControllersAutoConfiguration: keep the Environment-aware dispatcherServlet bean from apache#16149, drop the Grails MultipartConfigElement bean. - Upgrade guide §53.1 and its Undertow note now name spring.servlet.multipart.* and Boot's 1MB / 10MB defaults, and link to the new §4.2 migration section. - THREAT_MODEL.md keeps the P10 XXE property next to the reworded P9. - The oversized-upload specs in the app1, app4, jetty and undertow example apps relied on the old 128000-byte default. Those apps now configure spring.servlet.multipart limits so the 200000-byte payload still trips the limit, and the spec labels say so. Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
I have merged
Verified locally: |
There was a problem hiding this comment.
I am not a fan of introducing a GrailsControllersEnvironmentPostProcessor just to maintain a legacy configuration.
This is 8.0.x, let's just get rid of legacy configuration OR deprecate the temporary post processor for removal in 9.0.x. Having the post processor prohibits converting the ControllerAutoConfiguration to pure bean dsl.
The startup check that rejects grails.controllers.upload properties is a migration aid for applications upgrading from Grails 7, not a permanent part of the controllers plugin. Mark it for removal and say so in the upgrade guide.
🚨 All tests passed but jobs failed 🚨Failed Jobs without Test Failures❌ CI / Build Grails-Core (macOS JDK 21) 🏷️ Commit: 71737d4 Learn more about TestLens at testlens.app/docs. |
|
@codeconsole Thanks for the review. One clarification first: I would prefer not to drop it outright, for two reasons:
So I took your second option: the class is now On the bean DSL conversion: the post processor is registered on its own in |
|
@codeconsole The post processor won't do anything if you use the correct settings. As Mattias stated this is only a bridge for 8.0. |
That's why I wanted the deprecation tag so we don't forget to remove it. |
Apache Grails published 8.0.0-RC1 on 2026-09-23. Like M6 before it, the artifacts are in the ASF staging group only while the release vote runs, so the TEMP staging-repository entries in build.gradle stay for now and the comments are retargeted at RC1. Spring Boot stays at 4.1.1 (RC1's BOM manages the same version); Groovy follows the BOM to 5.1.3 and the cloud.wondrify asset-pipeline plugin to its 5.2.0-RC1 release, which is already on Maven Central. The RC1 Grails Gradle plugin is built against Gradle 9.7 (apache/grails-core#16114): on the 9.6.0 wrapper `gradlew assemble` dies with NoSuchMethodError on GroovyCompileOptions.getConfigurationScriptFile() returning a RegularFileProperty. Move the wrapper to 9.7.1, the current release. RC1 hands multipart handling to Spring Boot's auto-configuration (apache/grails-core#16040): the grails.controllers.upload.maxFileSize / maxRequestSize keys are gone, and an application that still sets them aborts at startup with a migration message. Move bbb-web's limits to spring.servlet.multipart.max-file-size / max-request-size with the same values. Without an explicit setting, Boot's defaults (1 MB per file, 10 MB per request) would silently cap presentation and caption uploads; BigBlueButton's own per-presentation cap (maxFileSizeUpload, enforced by ParamsProcessorUtil) is unchanged. Also in RC1 (apache/grails-core#16149) the _method override moved from a servlet filter into the dispatcher and is off by default, so the disabled hiddenHttpMethodFilter registration in resources.groovy is now redundant. It still compiles and stays inert, so it is left alone here. Verified with a package build in the grails-8 build image, deployed to a 4.0 dev container: startup in 4.4 s without warnings, checksummed create/getMeetingInfo/end round-trip, a 5.3 MB presentation upload through the client (above Boot's default per-file limit), and the api, learningdashboard, presentation and parameters Playwright suites. Every remaining failure in those suites reproduces with the same signature on the pre-upgrade Grails 7.0.12 package (screenshot drift, the @flaky external-video tests, a test needing maskTagThreshold > 0, and the predefined breakout groups tests).
Description
Fixes #15644.
This change delegates multipart upload configuration to Spring Boot instead of creating and configuring a Grails-specific
MultipartConfigElement.Applications should now use the standard
spring.servlet.multipartproperties:The previous
grails.controllers.uploadconfiguration namespace is no longer supported. If legacy properties are detected, application startup fails with migration instructions instead of silently ignoring them.The change also:
grails.config.Settings.MultipartConfigElement.GrailsHibernatePersistentEntityis not changed by these commits.Contributor Checklist
Issue and Scope
8.0.xmajor release branch, where breaking configuration changes are permitted.Code Quality
./gradlew build --rerun-tasks../gradlew codeStyleand resolved any violations.Licensing and Attribution
Documentation
grails.controllers.uploadtospring.servlet.multipart.