Skip to content

fix(artifacts-init): preserve configured HTTPS push remotes#2225

Open
time-attack wants to merge 1 commit into
garrytan:mainfrom
time-attack:test-issue-1348
Open

fix(artifacts-init): preserve configured HTTPS push remotes#2225
time-attack wants to merge 1 commit into
garrytan:mainfrom
time-attack:test-issue-1348

Conversation

@time-attack

Copy link
Copy Markdown

Summary

  • honor gh config get git_protocol for provider-created GitHub remotes, with the GitHub CLI default of HTTPS when the value is unavailable
  • honor the equivalent GitLab setting when present
  • preserve the scheme of explicit --remote URLs and existing remotes, fixing the July report where an explicit HTTPS recovery URL was converted back to SSH
  • add --push-protocol auto|https|ssh for deliberate overrides
  • make connectivity errors and completion output name the selected protocol

Fixes #1348.

Why this differs from #1469

PR #1469 handles provider-created remotes, but its auto path falls back to SSH when HOST_PREF is empty. That means --remote https://... still becomes SSH, reproducing the newer failure reported on July 3. It also uses SSH when GitHub CLI's setting is unavailable, while GitHub CLI itself defaults to HTTPS.

This version distinguishes provider-created, explicit, existing, and manually entered remotes. Explicit and existing URL schemes are preserved; provider-created remotes follow the CLI preference.

pr-test-env live matrix

SSH was disabled for every run to reproduce an HTTPS-only machine. Before the fix, all five installs rewrote the HTTPS URL to git@github.com:... and exited at git ls-remote. After the fix, all five completed init and pushed main to a private HTTPS GitHub fixture.

repo cohort score / tags before after
onemancompany with gstack 11 / setup, skill-discovery FAIL: forced SSH PASS: HTTPS init + push
gbrain with gstack 8 / setup, skill-discovery FAIL: forced SSH PASS: HTTPS init + push
zotero-arxiv-daily with gstack 8 / setup, skill-discovery FAIL: forced SSH PASS: HTTPS init + push
plane fresh-install control 8 / fresh-install, web-app FAIL: forced SSH PASS: HTTPS init + push
twenty fresh-install control 8 / fresh-install, web-app FAIL: forced SSH PASS: HTTPS init + push

Tests

  • bash -n bin/gstack-artifacts-init: pass
  • bun test test/pr-test-env.test.ts: 34 pass, 0 fail
  • bun test test/gstack-artifacts-init.test.ts test/gstack-artifacts-url.test.ts test/brain-sync.test.ts test/setup-gbrain-path4-structure.test.ts: 78 pass, 0 fail
  • live HTTPS-only init + real private push: 5/5 pass
  • optional full bun test was not a usable gate under local Bun 1.2.19: unrelated existing files require unavailable test.concurrent and Bun.YAML, with additional PATH-dependent gbrain baseline failures. The issue-specific and affected-area suites above are green.

Versioning

Raw fix only. VERSION, CHANGELOG.md, package version, generated skill indexes, and the local pr-test-env harness are untouched.

Honor the provider CLI protocol for created remotes, preserve the scheme of explicitly supplied and existing remotes, and add a push-protocol override.

Add regression coverage for HTTPS, SSH, unset configuration, GitHub, GitLab, explicit URLs, overrides, and invalid values.

Fixes garrytan#1348
@trunk-io

trunk-io Bot commented Jul 10, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@time-attack

Copy link
Copy Markdown
Author

@16francej

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.

gstack-brain-init defaults to SSH remote, fails for HTTPS-configured gh

1 participant