Repository navigation
docs(upgrade-skill): add the open 7.0.x changes to the Grails 7.0.18 part - #17082
borinquenkid wants to merge 6 commits into
Conversation
Collects the upgrade notes of the open 7.0.x Hibernate 5, GORM and Spring Security fixes (query arguments, bulk write guard, sorts and empty in lists, dynamic finder trailing text, enum maxSize, query cache and lock, remember-me redirect) into the grails-upgrade skill. Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL
|
FYI: I was waiting to do this until 18 actually goes out - we had to cancel the release so 18 is the correct one for now. Let's look at this PR again once the vote passes? |
jamesfredley
left a comment
There was a problem hiding this comment.
Requested changes. The note tells a caller to drop an empty not-in list, which returns every row instead of none.
…ty list Dropping the criterion returns every row, so the advice for keeping the earlier result of a negated empty in list is to return an empty list before the query when the input list is empty. Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL
|
@jamesfredley: the entry for an empty |
jamesfredley
left a comment
There was a problem hiding this comment.
The items this review found have been addressed. An empty not-in list is kept by returning an empty list.
… has not been staged again Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL
|
@matrei: the entries are in the |
sanjana2505006
left a comment
There was a problem hiding this comment.
Thanks, this is a useful consolidation. A few notes:
- The title and description still say 7.0.19; could they be updated to match the move into the 7.0.18 part?
- The branch conflicts with 7.0.x now that the "GSP tag attributes" section landed in the 7.0.18 part (1e69f3a); it needs a rebase, and the new sections' position relative to it should be checked.
- The new headings use Title Case, but the rest of the skill uses sentence case (e.g. "Interceptor URI matching"). Could they match?
- Empty
inlists: "Removing the criterion would return every row, not none" reads as redundant, since every row is already the new result. Maybe: "To keep the earlier result (no rows), return an empty list before running the query when the input list is empty; dropping the criterion would return every row." Also, was the behavior on H2 and other databases already "every row"? If so, saying so would help readers on those databases. - The enum
maxSizeand remember-me sections don't say what to search for, unlike the other entries. Suggested: enum properties withmaxSizeorinListconstraints, and subclasses ofGrailsRememberMeAuthenticationFilteror calls tosetAuthenticationSuccessHandler.
Since every entry depends on an open PR (#17078, #17051, #17052, #17054, #17058, #17059, #17014, #16986, #16971), would it make sense to mark this as a draft until they merge, so an entry doesn't ship for a fix that misses 7.0.18?
… search for, and reword the empty in list entry Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL
|
@sanjana2505006: thank you, all five are in. (1) The title and description say 7.0.18; the branch name still says 7.0.19, and I left it so the pull request keeps its head. (2) 7.0.x is merged in; the GSP tag attributes section comes first and the new entries follow it. (3) The headings are in sentence case. (4) The empty On marking it a draft: the description says it merges after the pull requests it describes, and I leave the draft flag to the maintainers. If you want it a draft, say so and I will. |
|
@sbglasius: this edits the |
jamesfredley
left a comment
There was a problem hiding this comment.
Requested changes. The note tells a caller to return an empty list when an empty negated list is only one side of an or.
| ## GORM for Hibernate 5: sorts, empty in lists and paged totals | ||
|
|
||
| - A map as the `sort` argument, `list(sort: [a: 'asc', b: 'desc'])`, orders by every property in the order listed; the static `list(sort: map)` kept only the last one. Sorting by a property of a composite id works. A sort no longer joins an association that the query's own block already joined. Review code that relied on the old order. | ||
| - An empty list given to `inList`, or to `in`, is an explicit false, so its negation matches every row: `not { inList('year', []) }` and `findAllByYearNotInList([])` matched nothing on PostgreSQL, MySQL and MariaDB, where Hibernate writes an empty list as `in (null)`. On H2, which accepts an empty `IN` list, they already matched every row. To keep the earlier result on those three databases, return an empty list before running the query when the input list is empty; dropping the criterion would return every row. |
There was a problem hiding this comment.
An empty year list is inside a not, and that not is one side of an or with year equal to 2024. The old query still returned the rows from 2024. Following this note returns no rows. Return an empty list only when the negated list is required for every match.
|
|
||
| 1. Read the application's current Grails version from `grailsVersion` in `gradle.properties`. | ||
| 2. Establish the target version. This skill covers targets up to Grails 7.0.19. | ||
| 2. Establish the target version. This skill covers targets up to Grails 7.0.18. |
There was a problem hiding this comment.
We probably are going to want to support property substitution so we can automate this in the future. Do you have time to automate that?
… it is required for every match Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL
|
@jamesfredley: fixed the note. An empty negated list is returned as an empty list only when the negated list is required for every match. When it is one side of an |
jamesfredley
left a comment
There was a problem hiding this comment.
Requested changes. The note tells a caller to drop an empty negated list from an or that is itself negated.
| ## GORM for Hibernate 5: sorts, empty in lists and paged totals | ||
|
|
||
| - A map as the `sort` argument, `list(sort: [a: 'asc', b: 'desc'])`, orders by every property in the order listed; the static `list(sort: map)` kept only the last one. Sorting by a property of a composite id works. A sort no longer joins an association that the query's own block already joined. Review code that relied on the old order. | ||
| - An empty list given to `inList`, or to `in`, is an explicit false, so its negation matches every row: `not { inList('year', []) }` and `findAllByYearNotInList([])` matched nothing on PostgreSQL, MySQL and MariaDB, where Hibernate writes an empty list as `in (null)`. On H2, which accepts an empty `IN` list, they already matched every row. To keep the earlier result on those three databases, when the negated list is required for every match, return an empty list before running the query when the input list is empty; dropping the criterion would return every row. When the negated list is one side of an `or`, leave that side out when the list is empty: it matched nothing there, so the other sides alone gave the earlier result, and returning an empty list would drop their rows. |
There was a problem hiding this comment.
The or is inside a not: not { or { not { inList('year', []) }; eq('year', 2024) } }. A row with year 2023 was excluded before. Following this note returns it. Limit the advice to an or that is not negated.
Adds the changes of the open 7.0.x PRs that change a result to the
# Grails 7.0.18part of thegrails-upgradeskill: #17078 (query arguments), #17051 (bulk write guard), #17052 (map sorts, emptyinlists), #17054 (grouped paged total), #17058 (finder trailing text), #17059 (enummaxSize), #17014 (query cache), #16986 (lock: false) and #16971 (remember-me redirect). Each entry says what to search for and how to keep the earlier result.7.0.18 has not been staged again, so a change merged now ships in it (matrei, 11-20); if it is staged before these merge, the entries move to a 7.0.19 part. The branch name still says 7.0.19.
Docs only, no code. The entries describe behavior that ships with those PRs, so this one should merge after them, or alongside the last of them. Notes of later 7.0.x PRs are added to this part by their own PR.
https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL