-
Notifications
You must be signed in to change notification settings - Fork 40
Add scripts and documentation for tests and common development flows #866
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
base: main
Are you sure you want to change the base?
Conversation
9c872ce to
b6cbe9d
Compare
b6cbe9d to
e9123b1
Compare
f1fd738 to
f74bc73
Compare
59bc246 to
e8fbf39
Compare
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.
I've started seeing how I can use these scripts in my own development workflow so thanks for developing and documenting them.
In general I am a bit apprehensive at the prospect of maintaining this much bash. We should run shellcheck on it in CI at the very least. In the future we should think about starting to use a more robust scripting language (or even non-scripting language?) for things like this.
As you will see I got to the point just short of actually running the VM in a useful way. I will continue to try and use these tools and do a second pass at review for sure.
| **Preview remote branch:** | ||
| ```bash | ||
| cc-utils vm start my-feature-branch --db cached | ||
| ``` |
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.
It might just be me but I was confused by the combination of the words "remote branch" and the lack of an origin/ prefix. When I saw a comment later calling it a "Github branch" it cleared it up for me. I think we should use the words "Github branch" everywhere. Maybe we should even explicitly say "CatColab Github repo branch"
The other thing this has without any explanation is the --db cached thing. Maybe that shouldn't be in the quickstart?
| @@ -0,0 +1,40 @@ | |||
| # Developer Documentation | |||
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.
Is there a reason this is a separate document from CONTRIBUTING.md? It should at least be linked from it.
| @@ -0,0 +1,52 @@ | |||
| # cc-utils DB Commands Reference | |||
|
|
|||
| The `cc-utils db` commands provide tools for managing databases across environments (local, staging, production, vm). | |||
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.
As mentioned at dev meeting we need to document how to get cc-utils onto your path i.e. mention nix develop and any alternatives.
| Learn how to run integration tests, test deployments, and debug test failures with a progressive isolation strategy. | ||
|
|
||
| ### [Development Workflows](docs/workflows.md) | ||
| Example workflows demonstrating how to use `cc-utils` script for common development tasks. |
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.
Small thing but running just cc-utils on my system prints:
/home/kaspar/projects/topos/CatColab/infrastructure/scripts/cc-utils: line 29: $1: unbound variable
but exits with 0 i.e. success status while doing nothing. cc-utils db etc seems to be working. Would be nice to exit with -1 and print "Error: no command given" and then show the help.
| **Examples:** | ||
| ```bash | ||
| # Start local VM with fresh staging DB | ||
| cc-utils vm start |
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.
My experience running this so far is it building a lot of things and timing out.
Starting local VM...
Logs: cc-utils vm logs
Waiting for VM to start...
Error: Timeout waiting for VM to be available
Check logs: /home/kaspar/.cache/catcolab/vm.log
In the background it's still building and I can tail that log
- I think this should log to stdout so I can see what's going on
- The timeout needs to be adjusted or something, maybe there should be separate
buildandstartcommands?
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 I run it today it seems to use the built VM and completes instantly and I can do cc-utils vm connect.
No description provided.