Skip to content

feat: add upstream remote support for fork workflows#45

Open
rawnam wants to merge 2 commits intocesarferreira:mainfrom
rawnam:rawnam/02-12/feat-upstream-sync-and-pr-support-for-fork-workflows
Open

feat: add upstream remote support for fork workflows#45
rawnam wants to merge 2 commits intocesarferreira:mainfrom
rawnam:rawnam/02-12/feat-upstream-sync-and-pr-support-for-fork-workflows

Conversation

@rawnam
Copy link
Copy Markdown
Contributor

@rawnam rawnam commented Feb 12, 2026

Summary

  • feat: add upstream remote support for fork workflows

When `upstream` is configured in stax config, sync fetches trunk from
the upstream repo and submit creates PRs against it with cross-fork
head refs. Push still goes to origin (the fork).

Config: [remote] upstream = "upstream"
Co-authored-by: Cursor <cursoragent@cursor.com>
@rawnam
Copy link
Copy Markdown
Contributor Author

rawnam commented Feb 12, 2026

Current dependencies on/for this PR:

This comment was autogenerated by stax

… docs

- DRY: extract duplicated base_url/api_base_url resolution into RemoteInfo::build()
- Add .context() on upstream_from_repo call in submit for clearer errors
- Fix inconsistent verbose output on upstream fetch in sync
- Improve doc comment on create_pr head_owner parameter

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment on lines +607 to +625
### Fork Workflow (Upstream PRs)

If you contribute via a fork, set `upstream` so stax syncs trunk from the source repo and opens PRs against it:

```toml
[remote]
name = "origin" # your fork
upstream = "upstream" # the source repo
```

```bash
# One-time setup
git remote add upstream https://github.com/original-owner/repo.git

# Then use stax normally
st rs # syncs trunk from upstream, fetches origin
st bs # pushes to your fork, opens PR against upstream
```

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

given that i might contribute via fork ocasionally, does that mean i have to change my config just while i do that?

@cesarferreira
Copy link
Copy Markdown
Owner

Hey @rawnam — are you still interested in pursuing this? There have been significant changes to sync.rs and other areas since this was opened (PRs #123, #124, #127), so this will likely need a rebase onto current main.

Let me know if you'd like to continue, and I'm happy to help with any conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants