Skip to content

Commit 4cf0070

Browse files
xuanyang15copybara-github
authored andcommitted
chore: re-structure adk_documentation folder so that agents in it can share the common files
PiperOrigin-RevId: 806348410
1 parent a7f4e02 commit 4cf0070

File tree

7 files changed

+53
-29
lines changed

7 files changed

+53
-29
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.

contributing/samples/adk_documentation/adk_release_analyzer/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
15+
from . import agent

contributing/samples/adk_documentation/adk_release_analyzer/agent.py

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,28 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from adk_release_analyzer.settings import CODE_OWNER
16-
from adk_release_analyzer.settings import CODE_REPO
17-
from adk_release_analyzer.settings import DOC_OWNER
18-
from adk_release_analyzer.settings import DOC_REPO
19-
from adk_release_analyzer.settings import IS_INTERACTIVE
20-
from adk_release_analyzer.settings import LOCAL_REPOS_DIR_PATH
21-
from adk_release_analyzer.tools import clone_or_pull_repo
22-
from adk_release_analyzer.tools import create_issue
23-
from adk_release_analyzer.tools import get_changed_files_between_releases
24-
from adk_release_analyzer.tools import list_directory_contents
25-
from adk_release_analyzer.tools import list_releases
26-
from adk_release_analyzer.tools import read_local_git_repo_file_content
27-
from adk_release_analyzer.tools import search_local_git_repo
15+
import os
16+
import sys
17+
18+
SAMPLES_DIR = os.path.abspath(
19+
os.path.join(os.path.dirname(__file__), "..", "..")
20+
)
21+
if SAMPLES_DIR not in sys.path:
22+
sys.path.append(SAMPLES_DIR)
23+
24+
from adk_documentation.settings import CODE_OWNER
25+
from adk_documentation.settings import CODE_REPO
26+
from adk_documentation.settings import DOC_OWNER
27+
from adk_documentation.settings import DOC_REPO
28+
from adk_documentation.settings import IS_INTERACTIVE
29+
from adk_documentation.settings import LOCAL_REPOS_DIR_PATH
30+
from adk_documentation.tools import clone_or_pull_repo
31+
from adk_documentation.tools import create_issue
32+
from adk_documentation.tools import get_changed_files_between_releases
33+
from adk_documentation.tools import list_directory_contents
34+
from adk_documentation.tools import list_releases
35+
from adk_documentation.tools import read_local_git_repo_file_content
36+
from adk_documentation.tools import search_local_git_repo
2837
from google.adk import Agent
2938

3039
if IS_INTERACTIVE:

contributing/samples/adk_documentation/adk_release_analyzer/main.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
import logging
1717
import time
1818

19-
from adk_release_analyzer import agent
20-
from adk_release_analyzer.settings import CODE_OWNER
21-
from adk_release_analyzer.settings import CODE_REPO
22-
from adk_release_analyzer.settings import DOC_OWNER
23-
from adk_release_analyzer.settings import DOC_REPO
24-
from adk_release_analyzer.utils import call_agent_async
19+
from adk_documentation.adk_release_analyzer import agent
20+
from adk_documentation.settings import CODE_OWNER
21+
from adk_documentation.settings import CODE_REPO
22+
from adk_documentation.settings import DOC_OWNER
23+
from adk_documentation.settings import DOC_REPO
24+
from adk_documentation.utils import call_agent_async
2525
from google.adk.cli.utils import logs
2626
from google.adk.runners import InMemoryRunner
2727

contributing/samples/adk_documentation/adk_release_analyzer/settings.py renamed to contributing/samples/adk_documentation/settings.py

File renamed without changes.

contributing/samples/adk_documentation/adk_release_analyzer/tools.py renamed to contributing/samples/adk_documentation/tools.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
from typing import List
2020
from typing import Optional
2121

22-
from adk_release_analyzer.settings import GITHUB_BASE_URL
23-
from adk_release_analyzer.utils import error_response
24-
from adk_release_analyzer.utils import get_paginated_request
25-
from adk_release_analyzer.utils import get_request
26-
from adk_release_analyzer.utils import patch_request
27-
from adk_release_analyzer.utils import post_request
22+
from adk_documentation.settings import GITHUB_BASE_URL
23+
from adk_documentation.utils import error_response
24+
from adk_documentation.utils import get_paginated_request
25+
from adk_documentation.utils import get_request
26+
from adk_documentation.utils import patch_request
27+
from adk_documentation.utils import post_request
2828
import requests
2929

3030

@@ -133,7 +133,7 @@ def clone_or_pull_repo(
133133
A dictionary indicating the status of the operation, output message, and
134134
the head commit hash.
135135
"""
136-
repo_url = f"https://github.com/{repo_owner}/{repo_name}.git"
136+
repo_url = f"git@github.com:{repo_owner}/{repo_name}.git"
137137

138138
try:
139139
# Check local path and decide to clone or pull
@@ -246,8 +246,8 @@ def list_directory_contents(directory_path: str) -> Dict[str, Any]:
246246
def search_local_git_repo(
247247
directory_path: str,
248248
pattern: str,
249-
extensions: Optional[List[str]],
250-
ignored_dirs: Optional[List[str]],
249+
extensions: Optional[List[str]] = None,
250+
ignored_dirs: Optional[List[str]] = None,
251251
) -> Dict[str, Any]:
252252
"""Searches a local Git repository for a pattern.
253253

contributing/samples/adk_documentation/adk_release_analyzer/utils.py renamed to contributing/samples/adk_documentation/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from typing import Dict
1717
from typing import List
1818

19-
from adk_release_analyzer.settings import GITHUB_TOKEN
19+
from adk_documentation.settings import GITHUB_TOKEN
2020
from google.adk.agents.run_config import RunConfig
2121
from google.adk.runners import Runner
2222
from google.genai import types

0 commit comments

Comments
 (0)