Repository navigation
Autocomplete the scope full name in the permission window request form - #159
Merged
Merged
Conversation
…#8) Adds the acceptance sentence for autocompleting the item of a permission window request, written by the maintainer ahead of the implementation from jenkinsci#104. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The item field of the permission window request form now suggests full names as the requester types. Suggestions come from GET batch-control/grants/autoCompleteScopeFullName, which requires the permission to request a window and offers only jobs and folders the caller may read (Item/Read) and that a window can name, so it neither discloses an invisible item nor offers a name the item check would refuse. Names that start with the typed text come first, matching is case-insensitive, and at most 20 names are offered. Adds matrix rows T-08-262..265. Fixes #8 (cherry picked from commit 6674904)
doAutoCompleteScopeFullName is a read-only GET that core's autocomplete calls, so it cannot take @RequirePOST. It checks REQUEST_GRANT first and offers only items the caller can read. Suppress the Jenkins Security Scan alert the same way HistorySection#doSummary does. Refs #8 (cherry picked from commit b39338c)
The SPEC 8 sentence for #8 has clauses that T-08-262..265 do not reach. ItemScopeUiTest now also checks them: - T-08-299: names that start with the typed text come before names that only contain it, ignoring case. Typing x with x-job, XL-report, batch-x and pipe-x is a case that alphabetical order gets wrong. - T-08-300: the limit of 20 keeps a name that starts with the text ahead of 25 names that only contain it. - T-08-301: a job or folder the requester may only discover (Item/Discover without Item/Read) is not offered. - T-08-302: the configurations of a multi-configuration project are not offered, although the requester may read them. - T-08-303: the suggestion request changes nothing under $JENKINS_HOME/batch-control/ and writes no record, with change control on and off, for permitted and refused callers. Guards show the comparison can see a real change. All 18 tests of the class pass on the jenkinsci#104 implementation. Matrix rows T-08-299..303 and note 373, which maps each clause to its rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The implementation sorts both groups case-insensitively, and T-08-262 and T-08-263 from jenkinsci#104 rely on that order. The spec now says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SPEC 8 now fixes the order inside each group (b2e4fd0). T-08-299 adds Max-x and asserts the whole list, an order that a case-sensitive sort gets wrong in both groups and creation order gets wrong in the second. T-08-300 asserts a-zz-01 .. a-zz-19 in order. Note 373 records the maintainer's decision; T-08-262 and T-08-263 are now within the spec. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
The item field of the permission window request form now suggests full names while the requester types, so nobody has to know the exact full name of a job or folder by heart. It offers only jobs and folders the requester may read: names that start with the typed text first, then names that contain it, each group in alphabetical order, at most 20.
This finishes #104 by @SunilKumarPradhan, who wrote the feature. Their two commits are here unchanged and keep their authorship (cherry-picked with
-x): f244d06 and ef32ff4. I closed #104 only because the branch had fallen behindmain. On top of their commits, this PR adds the SPEC sentence and tests for the clauses #104 did not pin yet.Anchor
Testing done
mvn -q test -Dtest=ItemScopeUiTest: 18 tests, 0 failures, 0 errors.GrantsSectionran; the other two are covered by the unit tests.Checks
mainbranch of my fork.buildande2eworkflows passed on the fork before this pull request was opened.mvn clean verifypassed locally. OnlyItemScopeUiTestran locally; the fork and this PR run the full suite.docs/SPEC.mdsays so (346ff8c, b2e4fd0).docs/TEST-MATRIX.mdand the row IDs are in the test names. T-08-299..303 were written after the feature commits; each fails onmainat its first suggestion request (404), which I checked by reading, not by running.src/main/resources/**? The form change was exercised in a real browser by the e2e run on Autocomplete the scope full name in the permission window request form #104.Suggested label:
enhancement.🤖 Generated with Claude Code