Skip to content

test(selfhost): cover env_get and require_cmd in deploy-common lib (#7769) - #7878

Closed
RealDiligent wants to merge 1 commit into
JSONbored:mainfrom
RealDiligent:test/selfhost-deploy-common-env-get-require-cmd-7769
Closed

test(selfhost): cover env_get and require_cmd in deploy-common lib (#7769)#7878
RealDiligent wants to merge 1 commit into
JSONbored:mainfrom
RealDiligent:test/selfhost-deploy-common-env-get-require-cmd-7769

Conversation

@RealDiligent

Copy link
Copy Markdown
Contributor

Summary

Closes #7769

Test plan

Not a UI change — no screenshot table required.

Made with Cursor

@RealDiligent
RealDiligent requested a review from JSONbored as a code owner July 21, 2026 15:45
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 21, 2026
@loopover-orb

loopover-orb Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Caution

🛑 LoopOver review result - fixes required

Review updated: 2026-07-21 15:54:51 UTC

1 file · 1 AI reviewer · no blockers · CI failing · blocked

🛑 Suggested Action - Fix Blockers

Review summary
This is a pure test-addition PR that adds unit coverage for env_get and require_cmd in scripts/lib/selfhost-deploy-common.sh, following the same real-bash-subprocess harness pattern already established in the file for maybe_infisical_run, env_put, and compose_file_args. The tests are well-targeted, exercise real code paths (plain/quoted values, comments, missing key/file, ENV_FILE fallback, present/missing commands) via actual spawned bash rather than mocks, and explicitly avoid duplicating the existing compose_file_args coverage. The 4 FAILED CI checks (validate, validate-tests x3) have no detail provided, and given the branch is 1 commit behind default, the more likely explanation is drift from what landed on default after divergence rather than a defect in this diff.

Nits — 5 non-blocking
  • The PR description says 'Closes scripts/lib/selfhost-deploy-common.sh: 3 of 4 functions have zero test coverage #7769' but per repo convention this PR must close/link an eligible open issue — confirm scripts/lib/selfhost-deploy-common.sh: 3 of 4 functions have zero test coverage #7769 is indeed an open, maintainer-authorized issue and not just a self-referenced PR-numbering artifact.
  • runLibFn (test/unit/selfhost-deploy-common.test.ts) duplicates the mkdtempSync/writeFileSync/chmodSync/rmSync scaffolding already present in createHarness and runEnvPut in the same file; consider consolidating into one shared temp-script helper.
  • The comment on set -u omission is good context but slightly buries the more important fact that set -eo pipefail is still enabled, which is what actually makes the exit-1 assertions meaningful — worth a one-line clarification.
  • Consider extracting a single shared 'run a script sourcing libPath in a scratch dir' helper used by createHarness, runEnvPut, and runLibFn to remove the three near-identical mkdtemp/write/chmod/spawn/cleanup blocks.
  • Given CI's validate/validate-tests jobs failed with no detail and the branch is behind default, rebase onto the latest default branch before re-requesting review to rule out drift as the cause.

CI checks failing

  • validate
  • validate-tests (1)
  • validate-tests (3)
  • validate-tests (2)

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #7769
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 387 registered-repo PR(s), 179 merged, 36 issue(s).
Contributor context ✅ Confirmed Gittensor contributor RealDiligent; Gittensor profile; 387 PR(s), 36 issue(s).
Improvement ℹ️ Insufficient signal risk: clean · value: insufficient-signal · LLM: moderate
Linked issue satisfaction

Partially addressed
The PR adds solid new test coverage for env_get and require_cmd using the same harness pattern, but explicitly declines to add compose_file_args tests in this file, instead relying on an external #7765 suite the issue author flagged as unverified ('check before duplicating') and which is not shown in this diff.

Review context
  • Author: RealDiligent
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, JavaScript, Ruby, Svelte, TypeScript, Markdown, MDX
  • Official Gittensor activity: 387 PR(s), 36 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb

loopover-orb Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-tests (1), validate-tests (3), validate-tests (2))). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

@loopover-orb loopover-orb Bot closed this Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scripts/lib/selfhost-deploy-common.sh: 3 of 4 functions have zero test coverage

1 participant