Allow nested PRR file queries - #1197
Conversation
Signed-off-by: Daniel Gyorgy <daniel.gyorgy@nokia.com>
✅ Deploy Preview for kpt-porch ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The decoding logic is straightforward, integrates at the correct parsing boundary, and is covered by both unit and e2e tests for the newly supported nested-file query behavior.
Review effort: Lite
Findings: None
What changed in this PR
This PR enables selecting nested package files in PackageRevisionResources GET requests by introducing an encoding for / in the file= selector (using :) and decoding those selectors server-side before matching resources.
Changes:
- Decode
filequery selectors inParsePRRGetso nested paths can be requested (e.g.,manifests:configmap.yaml→manifests/configmap.yaml). - Add unit tests for the decoding rules and an e2e test validating retrieval of a nested file via the selector.
| File | Description |
|---|---|
| test/e2e/api/advanced_test.go | Adds an e2e regression test proving nested file selection works via the file selector encoding. |
| pkg/util/selector/prr_selector.go | Implements decoding for file selector values (supporting : → / and escapes for : and \). |
| pkg/util/selector/prr_selector_test.go | Adds focused unit tests for the new decoding behavior and error cases. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Catalin-Stratulat-Ericsson
left a comment
There was a problem hiding this comment.
much needed addition especially for sub-package's



[Allow nested PRR file queries]
Description
Related Issue(s)
Type of Change
Checklist
AI Disclosure
If so, please describe how:
Cursor's grok 4.6 was used to review the changes.