Repository navigation
fix: fork installs update from the fork again and carried upstream PRs are tracked #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| { | ||
| "upstream": "pingdotgg/t3code", | ||
| "prs": [ | ||
| { | ||
| "number": 15030, | ||
| "takenSha": "a2d855c9f602d50da63fea6c07d3ca6c7db36655", | ||
| "reason": "iOS race fixes and Android keyboard parity" | ||
| }, | ||
| { | ||
| "number": 15975, | ||
| "takenSha": "b5d05a6ebf3c0b99a097f2a197983cb1203669c6", | ||
| "reason": "Home agent that manages threads across machines" | ||
| }, | ||
| { | ||
| "number": 17195, | ||
| "takenSha": "31f51f4746d0ed3d59e672bdbb5596e919a73e5d", | ||
| "reason": "Android terminal transfers and paints dirty rows only", | ||
| "closedUpstream": true | ||
| }, | ||
| { | ||
| "number": 17618, | ||
| "takenSha": "ce7e86f0aece6a52073c8be09ab3db479c14d532", | ||
| "reason": "Claude next-prompt composer ghost text", | ||
| "closedUpstream": true | ||
| }, | ||
| { | ||
| "number": 17890, | ||
| "takenSha": "0a5d3e0083e43946b180dc4cc89568af111c645c", | ||
| "reason": "Android subscription usage widgets", | ||
| "closedUpstream": true | ||
| }, | ||
| { | ||
| "number": 18634, | ||
| "takenSha": "6485555d5d7c365849dd6def5a335c8171238ccf", | ||
| "reason": "Android tablets launched in landscape open full screen" | ||
| }, | ||
| { | ||
| "number": 18839, | ||
| "takenSha": "457acb425c5fa5d5248bc0ed646b5ccb68f8f256", | ||
| "reason": "Android PR viewer keeps the chat back stack" | ||
| }, | ||
| { | ||
| "number": 19273, | ||
| "takenSha": "c983c522ad9c2e3ffd5735cdbfca6c073f9cde95", | ||
| "reason": "Local-model composer dictation" | ||
| }, | ||
| { | ||
| "number": 19424, | ||
| "takenSha": "9e5e520f786566b3004a004efc9e21817ad49e9c", | ||
| "reason": "Android foldables use the sidebar header", | ||
| "note": "Took only the first two commits. Upstream superseded it with merged #21071, #20812 and #20813.", | ||
| "closedUpstream": true | ||
| } | ||
| ] | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| name: Fork carried PRs | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: "17 6 * * 1" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| check: | ||
| name: Carried upstream PRs drift | ||
| if: github.repository == 'issuelt/t3code' | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 | ||
| - uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1 | ||
| with: | ||
| node-version-file: package.json | ||
| cache: true | ||
| run-install: true | ||
| - name: Check carried PRs | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| # Explicit bash adds pipefail, so drift still fails the step through tee. | ||
| shell: bash | ||
| run: node scripts/fork-carried-prs.ts | tee -a "$GITHUB_STEP_SUMMARY" |
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| // @effect-diagnostics-next-line nodeBuiltinImport:off -- reads repo files synchronously to cross-check literals. | ||
| import * as NodeFS from "node:fs"; | ||
|
|
||
| import { describe, expect, it } from "vite-plus/test"; | ||
|
|
||
| import { | ||
| CLI_RELEASES_PAGE_URL, | ||
| cliReleaseDownloadBaseUrl, | ||
| cliReleaseIndexPageUrl, | ||
| } from "./cliRelease.ts"; | ||
| import { FORK_RELEASES_URL, FORK_REPOSITORY } from "./fork.ts"; | ||
|
|
||
| const repoFile = (path: string) => | ||
| NodeFS.readFileSync(new URL(`../../../${path}`, import.meta.url), "utf8"); | ||
|
|
||
| // Upstream syncs have reverted the release source to pingdotgg/t3code before. | ||
| describe("fork release source", () => { | ||
| it("serves CLI updates and downloads from the fork", () => { | ||
| expect(CLI_RELEASES_PAGE_URL).toBe(FORK_RELEASES_URL); | ||
| expect(cliReleaseDownloadBaseUrl("1.2.3")).toBe(`${FORK_RELEASES_URL}/download/v1.2.3`); | ||
| expect(cliReleaseIndexPageUrl(1)).toBe( | ||
| `https://api.github.com/repos/${FORK_REPOSITORY}/releases?per_page=100&page=1`, | ||
| ); | ||
| }); | ||
|
|
||
| it.each([ | ||
| ["scripts/install.sh", /^repo="([^"]+)"$/m], | ||
| ["scripts/install.ps1", /^\$repo = "([^"]+)"$/m], | ||
| ])("installs from the fork in %s", (path, repoLiteral) => { | ||
| expect(repoLiteral.exec(repoFile(path))?.[1]).toBe(FORK_REPOSITORY); | ||
| }); | ||
|
|
||
| it.each([ | ||
| "apps/desktop/src/app/DesktopStartupRecovery.ts", | ||
| "apps/web/src/components/desktopUpdate.logic.ts", | ||
| ])("takes desktop release links from the fork module in %s", (path) => { | ||
| const source = repoFile(path); | ||
| expect(source).toContain('from "@t3tools/shared/fork"'); | ||
| expect(source).not.toContain("pingdotgg/t3code"); | ||
| }); | ||
| }); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| // The fork's release source: CLI and desktop updates, installers, and release links point here. | ||
| // scripts/install.sh and scripts/install.ps1 repeat the slug as a literal; fork.test.ts keeps them in sync. | ||
| export const FORK_REPOSITORY = "issuelt/t3code"; | ||
| export const FORK_RELEASES_URL = `https://github.com/${FORK_REPOSITORY}/releases`; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| import { assert, describe, it } from "@effect/vitest"; | ||
|
|
||
| import { classifyCarriedPr } from "./fork-carried-prs.ts"; | ||
|
|
||
| const taken = "a".repeat(40); | ||
| const later = "b".repeat(40); | ||
| const other = "c".repeat(40); | ||
|
|
||
| function pullRequest( | ||
| state: "OPEN" | "CLOSED" | "MERGED", | ||
| headRefOid: string, | ||
| oids: ReadonlyArray<string>, | ||
| totalCount = oids.length, | ||
| ) { | ||
| return { | ||
| state, | ||
| headRefOid, | ||
| commits: { totalCount, nodes: oids.map((oid) => ({ commit: { oid } })) }, | ||
| } as const; | ||
| } | ||
|
|
||
| describe("classifyCarriedPr", () => { | ||
| it("separates every upstream state", () => { | ||
| const cases = [ | ||
| [pullRequest("OPEN", taken, [other, taken]), { kind: "unchanged" }], | ||
| [pullRequest("OPEN", later, [taken, other, later]), { kind: "new-commits", newCommits: 2 }], | ||
| [ | ||
| pullRequest("OPEN", later, [other, later]), | ||
| { kind: "new-commits", newCommits: "rewritten" }, | ||
| ], | ||
| [ | ||
| pullRequest("OPEN", later, [other, later], 150), | ||
| { kind: "new-commits", newCommits: "unknown" }, | ||
| ], | ||
| [pullRequest("MERGED", taken, [taken]), { kind: "merged" }], | ||
| [pullRequest("CLOSED", taken, [taken]), { kind: "closed-unmerged" }], | ||
| ] as const; | ||
| for (const [pr, expected] of cases) { | ||
| assert.deepStrictEqual(classifyCarriedPr({ takenSha: taken }, pr), expected); | ||
| } | ||
| }); | ||
|
|
||
| it("stays quiet on an accepted closed PR until its head moves", () => { | ||
| const entry = { takenSha: taken, closedUpstream: true } as const; | ||
| assert.deepStrictEqual(classifyCarriedPr(entry, pullRequest("CLOSED", taken, [taken])), { | ||
| kind: "unchanged", | ||
| }); | ||
| assert.deepStrictEqual(classifyCarriedPr(entry, pullRequest("CLOSED", later, [taken, later])), { | ||
| kind: "closed-unmerged", | ||
| }); | ||
| }); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When Settings → About switches a boot-service environment to another update track,
UpdateTrackSwitchDialogstill resolves the target throughnpmReleaseAtom, backed bycloud/npmRelease.tsquerying upstream'st3npm package. However,cloud/selfUpdate.tsinstalls that exact version throughpinnedRuntime.ts, whose download URL now defaults to the fork because of this change. The fork'sfork-release.ymlpublishes independently versioned nightlies, not upstream's stable releases, so switching to Stable now attempts to download an upstream version from the fork and fails instead of updating. Make track-switch resolution and archive downloads use a consistent release source, or explicitly disable unsupported tracks.AGENTS.md reference: AGENTS.md:L69-L69
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed, but the bug predates this PR. The track switch reads its target version from upstream's
t3npm package, and the fork doesn't publish to npm. Before this PR, the switch installed upstream's archive of that version, which quietly moved a fork install onto an upstream build running on a database with fork migrations. Now the download from fork releases fails instead, which is the safer of the two. The fork also has no Stable releases, only nightlies.The real fix depends on what the fork does about npm (
npx t3, and whether to publish or disable tracks it doesn't ship). A follow-up already owns that, so I'm leaving this PR's scope as is.