Repository navigation
fix(e2e): close gaps a review found in the paired harness #1853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Teingi
merged 5 commits into
oceanbase:master
from
Fengzdadi:fix/e2e-paired-review-findings
Oct 7, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a2bd739
fix(e2e): close gaps a review found in the paired harness
Fengzdadi 5944341
fix(e2e): keep agent secrets and Pi failures sound in the paired harness
Fengzdadi 514279f
fix(e2e): split Pi's JSONL records on LF only
Fengzdadi 66430ba
test(e2e): compare host proxy settings before and after the job config
Fengzdadi 35821a6
docs(e2e): say why agent secrets may stay in the harness environment
Fengzdadi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Copyright (c) 2026 OceanBase. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import os | ||
| from collections.abc import Iterator | ||
| from unittest.mock import patch | ||
|
|
||
| import pytest | ||
|
|
||
|
|
||
| @pytest.fixture(autouse=True) | ||
| def harness_environment() -> Iterator[None]: | ||
| # The harness holds the secrets it derives for agents in its own environment, so each test gets its own copy. | ||
| with patch.dict(os.environ): | ||
| yield |
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] Harness-derived credentials land in the harness process environment, where every child process inherits them
The reference mechanism itself is the right call and I verified it against
harbor==0.16.1:resolve_env_varsonly readsos.environ(harbor/utils/env.py:118-119), andtemplatize_sensitive_envkeeps an already-templated value as-is (:68), so the job files never contain the literal. The reason this helper exists is also real —is_sensitive_env_key("PROXY_URL")is False, so without templating the agent proxy URL would be written to the job file in full. Confirmed:The part worth tightening is the storage location.
environ[held] = valueputs every harness-derived credential into the harness process's own environment table, where it is inherited by everything the harness spawns. Measured:The harness runs
git(settings.py:143),docker compose(Harbor passesenv=os.environinto the container process), and the plugin install command as subprocesses, so the token is readable from/proc/<pid>/environorps eby anything else on the machine, for the lifetime of the run. This is a wider surface than the one the commit message sets out to fix — it moves the value out of Harbor's output directory but not out of reach. The prefix keeps it from being read as an integration's own setting; it does not keep it from being read by unrelated processes.Suggested direction: hold these values in a process-local store on
HarnessSettingsrather thanos.environ, and inject them into the environment only at the point Harbor resolves the reference (Harbor readsos.environinside the same process, so a short-lived injection immediately beforecreate_agent_from_config, restored right after, keeps the mechanism working). If the current shape is kept, at minimum document why process-environment visibility is acceptable for these values, since the same runner can be pointed at a real token.Test worth adding: assert the harness's own
os.environcontains none of the derived values afteragent_secretreturns (todaytest_job_files_hold_no_part_of_a_short_server_tokenchecksconfig.model_dump_json()and the native env, but notos.environ), and that a subprocess spawned from the harness does not see the token.