roykoand opened a new pull request, #73074:
URL: https://github.com/apache/airflow/pull/73074

   `airflow info`'s `uname` line reports `platform.uname()`, whose `node` field 
is the machine hostname. On managed devices this hostname commonly encodes an 
asset tag or device name, but `--anonymize` never masked it, even though it 
already redacts the home directory, OS username, and database credentials 
elsewhere in the report.
   
   This adds a `process_hostname` method to the `Anonymizer` protocol (a no-op 
for `NullAnonymizer`, replaced with the literal placeholder `${HOSTNAME}` for 
`PiiAnonymizer`, consistent with the existing `${HOME}`/`${USER}` placeholders) 
and applies it to `uname().node` in `_system_info` before rendering.
   
   ## Test plan
   - [x] Added `TestPiiAnonymizer::test_should_remove_pii_from_hostname`
   - [x] Added `TestAirflowInfo::test_system_info_anonymizes_uname_hostname` 
(hostname is masked with `--anonymize`)
   - [x] Added 
`TestAirflowInfo::test_system_info_keeps_uname_hostname_without_anonymizer` 
(unchanged without the flag)
   - [x] `breeze run pytest 
airflow-core/tests/unit/cli/commands/test_info_command.py -xvs` — 15 passed
   - [x] `prek run --from-ref main --stage pre-commit` and `prek run 
mypy-airflow-core` — passed
   - [x] `prek run --from-ref main --stage manual` (excluding the 
long-running/opt-in hooks) — passed
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Sonnet 5)
   
   Generated-by: Claude Code (Sonnet 5) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to