Open
Conversation
Copilot
AI
changed the title
[WIP] Fix e2e logs collect step to use correct ssh key
Fix E2E log collection SSH identity selection
Jul 7, 2026
bcho
approved these changes
Jul 7, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the reliability of the E2E SSH/SCP flows by selecting an appropriate SSH identity (especially across separate run.sh invocations like logs/cleanup) and by switching SSH/SCP calls to argv arrays to preserve paths safely.
Changes:
- Add
configure_ssh_identityand_build_ssh_optshelpers to centralize SSH identity selection and option building. - Update SSH/SCP helpers (
wait_for_ssh,remote_exec,remote_copy) to pass options via arrays instead of relying on unquoted$E2E_SSH_OPTSexpansion. - Invoke SSH identity configuration during both main entry (
run.sh) and infra deploy (infra.sh) so standalonelogs/cleanupruns can reuse identities.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| hack/e2e/run.sh | Configures SSH identity during common initialization so logs/cleanup in a fresh shell can still connect. |
| hack/e2e/lib/infra.sh | Uses centralized SSH identity configuration during infra provisioning (but needs a guard against stale work-dir keys). |
| hack/e2e/lib/common.sh | Introduces identity resolution and builds SSH/SCP argv options safely via arrays. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
72
to
76
| # Resolve SSH key | ||
| local ssh_key | ||
| ssh_key="$(_resolve_ssh_key)" | ||
| if [[ -f "${E2E_WORK_DIR}/e2e_ssh_key" && "${ssh_key}" == "$(cat "${E2E_WORK_DIR}/e2e_ssh_key.pub")" ]]; then | ||
| export E2E_SSH_OPTS="-i ${E2E_WORK_DIR}/e2e_ssh_key -o IdentitiesOnly=yes ${E2E_SSH_OPTS}" | ||
| fi | ||
| configure_ssh_identity | ||
|
|
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.
The E2E log collection step could run in a fresh shell after infra deployment and lose the generated VM SSH identity. That made
run.sh logs/cleanupfall back to the runner’s default SSH key and fail to collect VM diagnostics.SSH identity reuse
${E2E_WORK_DIR}/e2e_ssh_keyacross standalonelogsandcleanupinvocations.SSH/SCP option handling
E2E_SSH_OPTSas an explicit whitespace-delimited option list.Existing identity detection
-i,-i/path, orIdentityFile.