Repository navigation
fix: redact home paths in profile runner logs - #262
Open
chen2021673 wants to merge 1 commit into
Open
chen2021673 wants to merge 1 commit into
chen2021673 wants to merge 1 commit into
Conversation
Filter home-directory prefixes from console output, command metadata, and streamed command logs. Route command stdout/stderr through the redaction filter and wait for it to flush before reporting failures so trailing output is not lost. Record the metadata file location relative to each tag log directory and keep manual next-step hints relative. Detect GNU sed unbuffered-mode support so the redaction filter also works with BSD/macOS sed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
为
run_models_and_profile.bash增加日志路径脱敏,避免在控制台输出和上传的运行日志中输出本机用户目录;同时保证脱敏过滤在命令失败时也能完整落盘,并兼容 macOS 的 sed 实现。Changes
redact_log_paths过滤函数,统一处理/home/<user>、/Users/<user>、/root、~/等常见用户路径前缀,替换为<home>;/root仅在独立路径边界生效,不会误伤/rootdir、/root_foo等目录名。run_metadata.log与各用例日志改用相对路径记录(../run_metadata.log),metadata 中仅记录 config 文件名和logs/profile_logs,不再写入绝对路径。-u,BSD/macOS sed 回退到默认缓冲(调用方已有 wait/flush 兜底),不再依赖 GNU-only 的sed -u与realpath --relative-to。