Skip to content

Commit

Permalink
subtree(witness-run-action): onboarded the witness-run-action to the …
Browse files Browse the repository at this point in the history
…monorepo

closes in-toto#70
  • Loading branch information
kriscoleman committed Jun 29, 2023
1 parent 58eb00b commit 068179d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
22 changes: 12 additions & 10 deletions README.subtrees.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@ The public open source code has been added to the project as [Git Subtrees](http

## List of our subtrees

- <name-of-subtree> <path-to-subtree> <name-of-remote>
- `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.

Expand All @@ -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 <name-of-your-subtree> 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 <path-to-your-subtree> <name-of-your-subtree> main --squash` will create an initial commit for your subtree into the monorepo project.
1. `git remote add -f <name-of-your-subtree> 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 <path-to-your-subtree> <name-of-your-subtree> 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?

Expand Down
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 068179d

Please sign in to comment.