Skip to content

Allow nested PRR file queries - #1197

Merged
liamfallon merged 1 commit into
kptdev:mainfrom
nokia:nested-prr-file-query
Sep 22, 2026
Merged

liamfallon merged 1 commit into
kptdev:mainfrom
nokia:nested-prr-file-query

Conversation

@dgyorgy-nokia

Copy link
Copy Markdown
Contributor

[Allow nested PRR file queries]


Description

  • What changed: Nested paths are encoded in the file query by using : for /, with : and \ for a literal colon or backslash. ParsePRRGet now decodes those values before matching.
  • Why it’s needed: PackageRevisionResources GET queries can select files with ?file=…, but Kubernetes object names cannot contain /, so nested paths such as deployments/nginx.yaml could not be requested. Clients were limited to top-level files even though packages commonly store resources in subdirectories.
  • How it works:

Related Issue(s)

  • Closes/Fixes #

Type of Change

  • Bug fix
  • New feature
  • Enhancement
  • Refactor
  • Documentation
  • Tests
  • Other: ________

Checklist

  • Code follows project style guidelines
  • Self-reviewed changes
  • Tests added/updated
  • Documentation added/updated
  • All tests and gating checks pass

AI Disclosure

  • I have used AI in the creation of this PR.

If so, please describe how:
Cursor's grok 4.6 was used to review the changes.

Signed-off-by: Daniel Gyorgy <daniel.gyorgy@nokia.com>
@dgyorgy-nokia
dgyorgy-nokia requested review from a team and a lite review from Copilot September 21, 2026 16:04
@netlify

netlify Bot commented Sep 21, 2026

Copy link
Copy Markdown

Deploy Preview for kpt-porch ready!

Name Link
🔨 Latest commit 216a27e
🔍 Latest deploy log https://app.netlify.com/projects/kpt-porch/deploys/6ab1557b60a5bf0008553699
😎 Deploy Preview https://deploy-preview-1197--kpt-porch.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 file query selectors in ParsePRRGet so nested paths can be requested (e.g., manifests:configmap.yamlmanifests/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.

@sonarqubecloud

Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

much needed addition especially for sub-package's

@liamfallon
liamfallon merged commit 64e0d5b into kptdev:main Sep 22, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants