Repository navigation
Repo round trip: Open, Create, Commit, Pull (app-repos work item 3) - #622
Merged
Merged
Conversation
…ommit (app-repos work item 3)
# Conflicts: # AGENTS.md
…id not bring, an open repo's package is written by no other door, Create checks before pushing
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Work item 3 of
plans/app-repos.md: the round trip. A strut works ON a git repository that is a package, the way an editor works on a checkout. The installed items (acme/moonlander/score) are the ones being edited, so an export never makes a second copy of what the workspace names bare. Git merges; strut writes files and applies trees.Builds on #621 (merged): its
git+resolver pieces (fetchCache,exportGitTree,parseGitRef) andupstream.commit.What it adds
POST /packages/repos { url, ref?, path?, tokenSecret? }): the repo is fetched intogit/checkout's bare cache, and a KEPT working copy is made at<dataDir>/packages/work/<publisher>/<name>/. The branch's commit is installed through a third door,repo, and the repo goes on file in<dataDir>/packages/repos.jsonwith the token secret's NAME only.repodoor (src/packages/install.ts): the commit is the truth, since the workspace's edits are always committed into it first.PublishOptions.stampin both workspace stores, with a conformance case.ConceptSet.adopt), but only for a repo already open or Create repo's own open. A first Open refuses it, as an ordinary install does.POST /packages/repos/:publisher/:name/commit { message, branch?, pr? }):packageFiles(deps, { under: pkg }), then shown as a diff (GET …/diff);github/create-pr'sopenPullRequest) or straight to the followed branch when asked;POST …/pull):git merge. A conflict names the files (409) and installs nothing; the person resolves it in the working copy and pulls again;POST /packages/repos/create): the package publisher's picks are built, pushed as the first commit of an EMPTY remote, then opened. The bare originals are offered for retirement (…/retire), never removed silently.POST /workflows,POST /steps,POST /apps). Commit writes them as new files, and the repo door then stamps them as the package's. This isWorkspaceStore.setOpenPackages, which createStrut sets fromrepos.json. Every other installed package keeps marketplace §3's name rule.package/commit: the agent's door. It runs only as an accepted proposal, checked against the record on disk. It is granted and inapprove:besidepackage/installin thejob,builderandorchestratorseeds.web/src/components/PackageRepos.tsx), with Open repo and, per repo, its branch, the commit installed, the items new and edited here, Commit (with the diff), Pull (with any conflict) and Close. Create repo sits on a package's page beside Publish.specs/API.md§16 ("Working on a repository"),AGENTS.md(packages row,package/row), andplans/app-repos.md(item 3 BUILT, item 2 merged).Choices beyond the plan
:publisher/:name.repo/<publisher>/<name>, tracking the followed branch. No other worktree of the shared cache ever holds it.repodoor did not write at the commit on file, plus deletions. Writing every item would undo what git merged whenever HEAD is past the installed commit.strut.yaml,serve.yaml,graph/, the README and other files stay as the repo has them.acme/moonlander/ghost). Inside a package a bare name means its own item first, so a bare new name is outside the package. The builder learns this two ways:AppConcept page gains a short "An app in a repo" section.A file added to the working copy also installs at the next Pull.
package_repo_owned. Close the repo and uninstall it to install that name from elsewhere.scorebesideacme/moon/score) and a package of the same name published from this strut's catalog are left alone: neither is the repo's.strut/<name>-<sha>with a PR. That is GitHub only; elsewhere the branch is pushed andprSkippedsays why. It pushes straight only whenbranchnames the followed branch, and it never forces.git/push); elsewhere the actor's id atstrut@strut.invalid.merge). Until the merged tree is applied, nothing more is written from the workspace and Commit waits. Edits made in the workspace meanwhile are not carried. Pull concludes a merge whose files the person resolved andgit added.package/commitisapprover: "admin": the HTTP door is full scope, and a push may use the deployment's token when the person has none of their own.DELETE /packages/repos/:publisher/:name), beyond the plan's list, forgets the repo and its working copy. The installed items stay.Tests
src/packages/repos.test.tsruns against local bare remotes (git init --bare,file://) over the HTTP routes:meta/edit-workflow, Commit straight tomain. The remote's file changed, and the item is no fork: stamped in place, no third version.workflows/score.yaml, the fork still active, the remote's new workflow not installed, and Commit refused. Resolved andgit added in the working copy, the next Pull applies the merge, and a Commit pushes it.mainis untouched.repos.json, any answer, nor the console.package/commit. Refused as a direct step and at the door without an accepted proposal; nothing is pushed.install.test.ts, on Ladybug: the repo door refuses a page made here on a first Open and adopts it, as the same node, withadoptPages._helper and app under an opened repo's prefix are accepted. Commit writes them to the remote (the app's sources, nodist/), and they become the package's.file:is still refused, with the hint.There is also a conformance case for
stamp(file + Ladybug stores), and the builder seed tests now listpackage/commit. Fullnpm test: 4249 pass, 0 fail beyond the two seed assertions this PR updates.cd web && npx tsc --noEmit && npx vite buildpasses.Checked in the browser pane against a local strut on local bare remotes: Open repo, the edited badge after a
meta/edit-workflow, Commit with the diff straight tomain, a Pull conflict and its banner, resolve + Pull, and Create repo from a package page with the retire offer.