From 068179d61cca9d904d27727710ef4de1e7ab0046 Mon Sep 17 00:00:00 2001 From: Kris Coleman Date: Thu, 22 Jun 2023 14:54:24 -0400 Subject: [PATCH] subtree(witness-run-action): onboarded the witness-run-action to the monorepo closes #70 --- README.subtrees.md | 22 ++++++++++++---------- package.json | 14 +++++++++----- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/README.subtrees.md b/README.subtrees.md index f56d90ac..a655ed9e 100644 --- a/README.subtrees.md +++ b/README.subtrees.md @@ -6,17 +6,19 @@ The public open source code has been added to the project as [Git Subtrees](http ## List of our subtrees -- -- `subtrees/archivista` `archivista/` `archivista` -- `subtrees/go-witness` `go-witness/` `go-witness` -- `subtrees/witness` `witness/` `witness` +| path-to-subtree | name-of-subtree | name-of-remote | +| ----------------------------- | -------------------- | -------------------- | +| `subtrees/archivista` | `archivista` | `archivista` | +| `subtrees/go-witness` | `go-witness` | `go-witness` | +| `subtrees/witness` | `witness` | `witness` | +| `subtrees/witness-run-action` | `witness-run-action` | `witness-run-action` | ## Getting Started -Assuming you have already gotten started with the root readme.md, then you can do the following: +Assuming you have already gotten started with the root readme.md, then you can do the following: -1. `npm run remotes:add-all` this is a one time script to add all of our remotes. You'll only need to run it one time initially, and anytime we add more remote subtrees. -1. `npm run remotes:fetch-all` will fetch all the remote subtrees. +1. `npm run remotes:add:all` this is a one time script to add all of our remotes. You'll only need to run it one time initially, and anytime we add more remote subtrees. +1. `npm run remotes:fetch:all` will fetch all the remote subtrees. From there you can add more subtrees, update subtree subfolders, and/or update subtree parent repositories. @@ -28,12 +30,12 @@ Review the scripts in our root `package.json` for helper scripts related to subt You should add subtrees as remotes for easier management. -1. `git remote add -f https://github.com/testifysec/some-great-open-source-project.git` with the name of your subtree and the https or ssh link to the git project -1. `git subtree add --prefix main --squash` will create an initial commit for your subtree into the monorepo project. +1. `git remote add -f https://github.com/testifysec/some-great-open-source-project.git` with the name of your subtree and the https or ssh link to the git project. You can add this as a script in our root `package.json` to help other devs out! +1. `git subtree add --prefix main --squash` will create an initial commit for your subtree into the monorepo project. This should be a one-time command. Be careful to keep any subtree work completely seperate from any other commits. ## Updating a subtree with upstream changes -So, some awesome soul decided to help us out and contributed open source changes to one of our subtrees! +So, some awesome soul decided to help us out and contributed open source changes to one of our subtrees! Now what? diff --git a/package.json b/package.json index 31c090e3..6c98e186 100644 --- a/package.json +++ b/package.json @@ -10,23 +10,27 @@ "pre-commit": "npm run pre-commit -w web", "pre-push": "npx prepush-if-changed", "prepare": "husky install", - "remotes:add-all": "npm run remotes:add-archivista & npm run remotes:add-go-witness & npm run remotes:add-witness", - "remotes:add-archivista": "git remote add -f archivista https://github.com/testifysec/archivista.git", - "remotes:add-go-witness": "git remote add -f go-witness https://github.com/testifysec/go-witness.git", - "remotes:add-witness": "git remote add -f witness https://github.com/testifysec/witness.git", + "remotes:add:all": "npm run remotes:add-archivista & npm run remotes:add-go-witness & npm run remotes:add-witness & npm run remotes:add-witness-run-action", + "remotes:add:archivista": "git remote add -f archivista https://github.com/testifysec/archivista.git", + "remotes:add:go-witness": "git remote add -f go-witness https://github.com/testifysec/go-witness.git", + "remotes:add:witness": "git remote add -f witness https://github.com/testifysec/witness.git", + "remotes:add:witness-run-action": "git remote add -f witness-run-action https://github.com/testifysec/witness-run-action", "start:web:remote-proxy": "npm run start:remote-proxy -w web", "start:web": "npm start -w web", "start": "cd dev && make deps && tmux has-session -t mysession 2>/dev/null || tmux new-session -d -s mysession 'make up' && tmux split-window -h 'minikube tunnel' && tmux select-layout even-horizontal && tmux attach-session -d -t mysession", - "subtrees:fetch:all": "npm run subtrees:fetch:archivista & npm run subtrees:fetch:go-witness & npm run subtrees:fetch:witness", + "subtrees:fetch:all": "npm run subtrees:fetch:archivista & npm run subtrees:fetch:go-witness & npm run subtrees:fetch:witness & npm run subtrees:fetch:witness-run-action", "subtrees:fetch:archivista": "git fetch archivista main", "subtrees:fetch:go-witness": "git fetch go-witness main", "subtrees:fetch:witness": "git fetch witness main", + "subtrees:fetch:witness-run-action": "git fetch witness-run-action main", "subtrees:pull:archivista": "git subtree pull --prefix subtrees/archivista/ archivista main --squash", "subtrees:pull:go-witness": "git subtree pull --prefix subtrees/go-witness/ go-witness main --squash", "subtrees:pull:witness": "git subtree pull --prefix subtrees/witness/ witness main --squash", + "subtrees:pull:witness-run-action": "git subtree pull --prefix subtrees/witness-run-action/ witness-run-action main --squash", "subtress:push:archivista": "git subtree push --prefix subtrees/archivista/ archivista main", "subtress:push:go-witness": "git subtree push --prefix subtrees/go-witness/ go-witness main", "subtress:push:witness": "git subtree push --prefix subtrees/witness/ witness main", + "subtress:push:witness-run-action": "git subtree push --prefix subtrees/witness-run-action/ witness-run-action main", "test:archivista": "cd subtrees/archivista && go test ./... && cd ../..", "test:go-witness": "cd subtrees/go-witness && go test ./... && cd ../..", "test:go": "npm run test:archivista && npm run test:go-witness && npm run test:judge-api && npm run test:witness",