Skip to content

Keep instance passwords out of pytest tracebacks - #163

Merged
aldro61 merged 1 commit into
mainfrom
fix/no-passwords-in-ci-logs
Sep 24, 2026
Merged

aldro61 merged 1 commit into
mainfrom
fix/no-passwords-in-ci-logs

Conversation

@aldro61

@aldro61 aldro61 commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator

Pytest prints a failing test's arguments in its traceback. When test_cheat[...workarenapublic26...-CreateChangeRequestTask] failed in run 35916033360, it printed snow_instance_entry, instance 26's admin password included, into the public Actions log. That was the only leak in the run's full log.

The pool entries in test_task_general.py, test_snow_instance.py and test_instance_preconditions.py are now a RedactedInstanceEntry (a dict subclass in tests/utils.py) whose repr shows the URL and '<redacted>'. Lookups are unchanged.

Not handled here: the password already in that run's log. It should be rotated, and the run's logs deleted.

Testing

  • Throwaway failing test with a fake password: a plain dict prints it in the traceback; RedactedInstanceEntry prints '<redacted>'.
  • test_snow_instance.py: 12 passed. Pool health: 87 passed. test_task_general.py collects (99 tests). Fast PR suite: 30 passed. black==24.2.0 --check is clean.

🤖 Generated with Claude Code

Pytest prints test arguments in failure tracebacks, so a failing L1 test
printed its snow_instance_entry, admin password included, into the public
Actions log (run 35916033360). Pool entries in the tests are now a dict
subclass whose repr redacts the password.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@aldro61 aldro61 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

LGTM

@aldro61
aldro61 merged commit 3eccaa4 into main Sep 24, 2026
6 checks passed
@aldro61
aldro61 deleted the fix/no-passwords-in-ci-logs branch September 24, 2026 14:17
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.

1 participant