Skip to content

fix: include app name in FileArtifactService storage paths#5619

Open
Nant361 wants to merge 1 commit intogoogle:mainfrom
Nant361:fix/file-artifact-app-namespace
Open

fix: include app name in FileArtifactService storage paths#5619
Nant361 wants to merge 1 commit intogoogle:mainfrom
Nant361:fix/file-artifact-app-namespace

Conversation

@Nant361
Copy link
Copy Markdown

@Nant361 Nant361 commented May 7, 2026

Link to Issue or Description of Change

1. Link to an existing issue (if applicable):

Problem:

FileArtifactService accepted app_name in its public artifact APIs, but stored file artifacts under root/users/{user_id}/.... This meant the file backend did not isolate artifacts by app name.

Solution:

Add a validated app_name segment to the file storage layout: root/apps/{app_name}/users/{user_id}/....

This change passes app_name through the file path helpers, keeps session-scoped and user-scoped artifact behavior intact, and updates metadata path expectations.

Testing Plan

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.

Passed locally:

  • uv run --extra test pytest tests/unittests/artifacts/test_artifact_service.py -q
  • Result: 71 passed in 0.92s

Added coverage:

  • Cross-app isolation for session-scoped artifacts.
  • Cross-app isolation for user-scoped artifacts.
  • Rejection of traversal and invalid values in app_name.

Manual End-to-End (E2E) Tests:

N/A. This change is covered by file artifact service unit tests.

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end. N/A for this unit-level file backend change.
  • Any dependent changes have been merged and published in downstream modules. N/A.

Additional context

This keeps the file artifact backend aligned with the artifact service API boundary and the other artifact backends.

@google-cla
Copy link
Copy Markdown

google-cla Bot commented May 7, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@adk-bot adk-bot added the services [Component] This issue is related to runtime services, e.g. sessions, memory, artifacts, etc label May 7, 2026
@adk-bot
Copy link
Copy Markdown
Collaborator

adk-bot commented May 7, 2026

Response from ADK Triaging Agent

Hello @Nant361, thank you for your contribution!

It appears that the Contributor License Agreement (CLA) check has failed. As the google-cla bot mentioned, you will need to sign the CLA before we can proceed with reviewing and merging this pull request.

You can find more information and sign the CLA at https://cla.developers.google.com/.

Thank you

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

Labels

services [Component] This issue is related to runtime services, e.g. sessions, memory, artifacts, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FileArtifactService stores artifacts outside the app namespace

2 participants