Skip to content

7.1.x FIX: Rank URL mapping specificity by literal token count before wildcard captures#15645

Open
codeconsole wants to merge 1 commit into
apache:7.1.xfrom
codeconsole:7.1.x-url-mapping-specificity
Open

7.1.x FIX: Rank URL mapping specificity by literal token count before wildcard captures#15645
codeconsole wants to merge 1 commit into
apache:7.1.xfrom
codeconsole:7.1.x-url-mapping-specificity

Conversation

@codeconsole
Copy link
Copy Markdown
Contributor

When wildcard validation is enabled, AbstractGrailsControllerUrlMappings now sorts validated wildcard matches first by literal URL-token count (more literals = more specific) and only then by non-routing capture count. Previously a generic pattern like /$id/$action/$imageId could win over a more specific route such as /list/$stage/$sort because both had the same wildcard-capture status, causing the wrong controller/action to be resolved regardless of declaration order. Adds two WildcardActionValidationSpec cases covering both declaration orders.

@testlens-app
Copy link
Copy Markdown

testlens-app Bot commented May 8, 2026

🚨 TestLens detected 2 failed tests 🚨

Here is what you can do:

  1. Inspect the test failures carefully.
  2. If you are convinced that some of the tests are flaky, you can mute them below.
  3. Finally, trigger a rerun by checking the rerun checkbox.

Test Summary

Check Project/Task Test Runs
CI - Groovy Joint Validation Build / build_grails :grails-test-suite-web:test DoubleWildcardUrlMappingTests > testDoubleWildcardWithMatchingController ❌ 🚫
CI - Groovy Joint Validation Build / build_grails :grails-data-hibernate5-dbmigration:test GroovyChangeLogSpec > outputs a warning message by calling the warn method ❌ ❌
CI - Groovy Joint Validation Build / build_grails :grails-data-hibernate5-dbmigration:test GroovyChangeLogSpec > updates a database with Groovy Change ❌ ❌
CI / Build Grails-Core (macos-latest, 21) :grails-test-suite-web:test DoubleWildcardUrlMappingTests > testDoubleWildcardWithMatchingController ❌ ❌ 🚫 🚫
CI / Build Grails-Core (ubuntu-latest, 17) :grails-test-suite-web:test DoubleWildcardUrlMappingTests > testDoubleWildcardWithMatchingController 🚫 ❌ 🚫 🚫
CI / Build Grails-Core (ubuntu-latest, 21) :grails-test-suite-web:test DoubleWildcardUrlMappingTests > testDoubleWildcardWithMatchingController 🚫 ❌ 🚫 🚫
CI / Build Grails-Core (ubuntu-latest, 25) :grails-test-suite-web:test DoubleWildcardUrlMappingTests > testDoubleWildcardWithMatchingController 🚫 ❌ 🚫 🚫
CI / Build Grails-Core (windows-latest, 25) :grails-test-suite-web:test DoubleWildcardUrlMappingTests > testDoubleWildcardWithMatchingController ❌ 🚫 🚫 🚫
CI / Build Grails-Core Rerunning all Tasks (ubuntu-latest, 17) :grails-test-suite-web:test DoubleWildcardUrlMappingTests > testDoubleWildcardWithMatchingController 🚫 ❌ 🚫 🚫

🏷️ Commit: af941f4
▶️ Tests: 5250 executed
⚪️ Checks: 37/37 completed

Test Failures

GroovyChangeLogSpec > outputs a warning message by calling the warn method (:grails-data-hibernate5-dbmigration:test in CI - Groovy Joint Validation Build / build_grails)
Condition not satisfied:

output.toString().contains('warn message')
|      |          |
|      |          false
|      Running Changeset: changelog.groovy::2::John Smith
|       
|      UPDATE SUMMARY
|      Run:                          1
|      Previously run:               0
|      Filtered out:                 0
|      -------------------------------
|      Total change sets:            1
|       
|      Liquibase: Update has been successful. Rows affected: 1
Running Changeset: changelog.groovy::2::John Smith
 
UPDATE SUMMARY
Run:                          1
Previously run:               0
Filtered out:                 0
-------------------------------
Total change sets:            1
 
Liquibase: Update has been successful. Rows affected: 1

	at org.grails.plugins.databasemigration.liquibase.GroovyChangeLogSpec.outputs a warning message by calling the warn method(GroovyChangeLogSpec.groovy:87)
GroovyChangeLogSpec > updates a database with Groovy Change (:grails-data-hibernate5-dbmigration:test in CI - Groovy Joint Validation Build / build_grails)
Condition not satisfied:

output.toString().contains('confirmation message')
|      |          |
|      |          false
|      Running Changeset: changelog.groovy::1::John Smith
|       
|      UPDATE SUMMARY
|      Run:                          1
|      Previously run:               0
|      Filtered out:                 0
|      -------------------------------
|      Total change sets:            1
|       
|      Liquibase: Update has been successful. Rows affected: 1
Running Changeset: changelog.groovy::1::John Smith
 
UPDATE SUMMARY
Run:                          1
Previously run:               0
Filtered out:                 0
-------------------------------
Total change sets:            1
 
Liquibase: Update has been successful. Rows affected: 1

	at org.grails.plugins.databasemigration.liquibase.GroovyChangeLogSpec.updates a database with Groovy Change(GroovyChangeLogSpec.groovy:61)

Muted Tests

Select tests to mute in this pull request:

  • DoubleWildcardUrlMappingTests > testDoubleWildcardWithMatchingController
  • GroovyChangeLogSpec > outputs a warning message by calling the warn method
  • GroovyChangeLogSpec > updates a database with Groovy Change

Reuse successful test results:

  • ♻️ Only rerun the tests that failed or were muted before

Click the checkbox to trigger a rerun:

  • Rerun jobs

Learn more about TestLens at testlens.app.

@jdaugherty
Copy link
Copy Markdown
Contributor

@codeconsole looks like this broke some tests. if you can fix them, I'm happy to follow-up with a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants