Skip to content

[small ops safety] Improve operator safety for generated .env files#5427

Open
failuresmith wants to merge 2 commits intogoogle:mainfrom
failuresmith:codex/gitignore-env-on-create
Open

[small ops safety] Improve operator safety for generated .env files#5427
failuresmith wants to merge 2 commits intogoogle:mainfrom
failuresmith:codex/gitignore-env-on-create

Conversation

@failuresmith
Copy link
Copy Markdown

@failuresmith failuresmith commented Apr 21, 2026

Summary

  • adk create always writes a .env file.
  • The scaffold now also creates or updates .gitignore with .env.
  • Existing .gitignore entries are preserved, and .env is not duplicated.

Why

If ADK creates .env by default, it should also ignore that file by default. This avoids relying on operator accuracy for a predictable secret-handling risk.

Testing

  • PYTHONPATH=src pytest tests/unittests/cli/utils/test_cli_create.py
  • PYTHONPATH=src pytest tests/unittests/cli/utils/test_cli_tools_click.py::test_cli_create_cmd_invokes_run_cmd tests/unittests/cli/test_cli_tools_click_option_mismatch.py::test_adk_create
  • Manual smoke test: adk create l1 generated .gitignore containing .env

Notes

  • git diff --check passed.
  • pyink and isort were not available in the current uv environment, so formatter checks could not be run locally.

@google-cla
Copy link
Copy Markdown

google-cla Bot commented Apr 21, 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 tools [Component] This issue is related to tools label Apr 21, 2026
@adk-bot
Copy link
Copy Markdown
Collaborator

adk-bot commented Apr 21, 2026

Hello @failuresmith, thank you for your contribution!

Before we can merge this PR, could you please sign the Contributor License Agreement (CLA)? You can find more information at https://cla.developers.google.com/.

Also, for new features and fixes, we require an associated GitHub issue. Could you please create an issue for this change and link it to this PR?

Thanks for your help!

Response from ADK Triaging Agent

@failuresmith failuresmith changed the title [codex] Ignore generated dotenv files from adk create [small change to prevent operator error] Ignore generated dotenv files from adk create Apr 21, 2026
@failuresmith failuresmith changed the title [small change to prevent operator error] Ignore generated dotenv files from adk create [ops safety] Ignore generated dotenv files from adk create Apr 21, 2026
@failuresmith failuresmith changed the title [ops safety] Ignore generated dotenv files from adk create [codex] Improve operator safety for generated .env files Apr 21, 2026
@failuresmith failuresmith changed the title [codex] Improve operator safety for generated .env files [ops safety] Improve operator safety for generated .env files Apr 21, 2026
@failuresmith failuresmith changed the title [ops safety] Improve operator safety for generated .env files [small ops safety] Improve operator safety for generated .env files Apr 21, 2026
@failuresmith failuresmith marked this pull request as ready for review April 21, 2026 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tools [Component] This issue is related to tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants