Skip to content

feat(cli): probe remote build sources for issue #133 - #889

Merged
ralyodio merged 2 commits into
profullstack:masterfrom
aiirvizionz:clientkit/issue-133-remote-build-source
Aug 1, 2026
Merged

feat(cli): probe remote build sources for issue #133#889
ralyodio merged 2 commits into
profullstack:masterfrom
aiirvizionz:clientkit/issue-133-remote-build-source

Conversation

@aiirvizionz

Copy link
Copy Markdown
Contributor

Summary

  • probe URL build sources with a lightweight HEAD request
  • fall back to a one-byte ranged GET when HEAD is unsupported
  • report status, content type, final URL, channel, and target without downloading the source

Closes #133

Verification

  • Vitest build.test.ts: 18 tests passed
  • git diff --check

Copilot AI review requested due to automatic review settings August 1, 2026 05:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a remote-source “probe” path to the CLI build command so --from <url> can be validated and summarized (status, content-type, final URL) without downloading the full build source.

Changes:

  • Introduces probeRemoteBuild() to probe --from URLs via HEAD, falling back to a 1-byte ranged GET.
  • Makes the build command action async and prints a remote build summary for URL inputs.
  • Adds Vitest coverage for the new probe behavior (HEAD, fallback, and error cases).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/cli/src/commands/build.ts Adds remote URL probing and prints a summary for build --from <url>.
packages/cli/src/commands/build.test.ts Adds unit tests for probeRemoteBuild() behavior and error handling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +127 to +145
let response = await fetch(input.value, { method: 'HEAD', redirect: 'follow' });
if (response.status === 405 || response.status === 501) {
response = await fetch(input.value, {
method: 'GET',
headers: { Range: 'bytes=0-0' },
redirect: 'follow',
});
}
if (!response.ok) {
throw new Error(`build source returned HTTP ${response.status}: ${input.value}`);
}

return {
sourceUrl: input.value,
finalUrl: response.url || input.value,
status: response.status,
contentType: response.headers.get('content-type') ?? undefined,
};
}
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: git fetch upstream master && git rebase upstream/master.

Copilot AI review requested due to automatic review settings August 1, 2026 07:28
@aiirvizionz

Copy link
Copy Markdown
Contributor Author

Resolved the merge conflicts against public master and pushed commit 8f1f95be to this PR branch. Focused local check: packages/cli/src/commands/build.test.ts passed (21/21). The branch preserves remote-source probing and master local-path validation. I will request the uGig invoice only after the PR is merged.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Suppressed comments (1)

packages/cli/src/commands/build.ts:145

  • probeRemoteBuild does not consume or cancel the response body. In Node/undici this can keep the underlying connection open, and for the fallback GET it may still download a full response if the server ignores Range, contradicting the intent of probing without downloading.
  let response = await fetch(input.value, { method: 'HEAD', redirect: 'follow' });
  if (response.status === 405 || response.status === 501) {
    response = await fetch(input.value, {
      method: 'GET',
      headers: { Range: 'bytes=0-0' },
      redirect: 'follow',
    });
  }
  if (!response.ok) {
    throw new Error(`build source returned HTTP ${response.status}: ${input.value}`);
  }

  return {
    sourceUrl: input.value,
    finalUrl: response.url || input.value,
    status: response.status,
    contentType: response.headers.get('content-type') ?? undefined,
  };
}

@aiirvizionz

Copy link
Copy Markdown
Contributor Author

All required GitHub checks are now green and the PR is mergeable_state=clean at the pushed commit. The conflict resolution is ready for maintainer merge. Once GitHub records the merge, I will request the corresponding uGig invoice.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: git fetch upstream master && git rebase upstream/master.

1 similar comment
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: git fetch upstream master && git rebase upstream/master.

@ralyodio
ralyodio merged commit 9fb5239 into profullstack:master Aug 1, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

need PRs that implement the 4 main sh1pt cli commands (and sub-commands) as seen in our docs page:

3 participants