Skip to content

Commit 332638e

Browse files
committed
Docs: add concrete example and CI test for update-ocaml-node script
- Update documentation with real commit example (31caeee) showing the exact command used to update from 3.2.0-alpha1 to 3.2.0-beta1 - Add CI job to test script reproducibility by verifying it produces the same file changes when run from the parent commit - Update commit structure section to match actual commit patterns
1 parent e213a87 commit 332638e

File tree

2 files changed

+48
-5
lines changed

2 files changed

+48
-5
lines changed

.github/workflows/test-docs-scripts.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,41 @@ jobs:
172172
# Docker Desktop needs to be started manually on macOS
173173
# We'll just check if it was installed via Homebrew
174174
docker --version || echo "Docker installed but not running (expected on macOS CI)"
175+
176+
test-update-ocaml-node-script:
177+
name: Test Update OCaml Node Script
178+
runs-on: [macos-latest, ubuntu-latest]
179+
180+
- name: Test update-ocaml-node script reproducibility
181+
run: |
182+
# Save the current script to use with the old commit state
183+
cp ./website/docs/developers/scripts/update-ocaml-node.sh /tmp/update-ocaml-node.sh
184+
chmod +x /tmp/update-ocaml-node.sh
185+
186+
# Check out the parent commit of the example update (cf67d94c)
187+
git checkout cf67d94c
188+
189+
# Run the script from current branch with the same parameters as the example
190+
/tmp/update-ocaml-node.sh 7f94ae0b 978866cd "3.2.0-alpha1" "3.2.0-beta1"
191+
192+
# Check if the changes match the expected diff from commit 31caeee6
193+
git diff --name-only | sort > actual_files.txt
194+
echo ".github/workflows/ci.yaml" > expected_files.txt
195+
echo "docker-compose.archive.devnet.compare.yml" >> expected_files.txt
196+
echo "node/testing/src/node/ocaml/config.rs" >> expected_files.txt
197+
echo "node/testing/src/node/ocaml/mod.rs" >> expected_files.txt
198+
echo "node/testing/src/scenarios/multi_node/basic_connectivity_peer_discovery.rs" >> expected_files.txt
199+
echo "node/testing/src/scenarios/solo_node/basic_connectivity_accept_incoming.rs" >> expected_files.txt
200+
sort expected_files.txt > expected_files_sorted.txt
201+
202+
# Verify the same files were modified
203+
if ! diff -q actual_files.txt expected_files_sorted.txt; then
204+
echo "ERROR: Script modified different files than expected"
205+
echo "Expected files:"
206+
cat expected_files_sorted.txt
207+
echo "Actual files:"
208+
cat actual_files.txt
209+
exit 1
210+
fi
211+
212+
echo "SUCCESS: Script produced the expected file changes"

website/docs/developers/updating-ocaml-node.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ OpenMina provides an automation script to handle the bulk of the update process:
3333

3434
**Example usage:**
3535

36+
For example, to update from `3.2.0-alpha1` to `3.2.0-beta1` (as done in commit
37+
[31caeee6](https://github.com/o1-labs/openmina/commit/31caeee6af7bf20b8578a23bf69718dbe68fe5cc)):
38+
3639
```bash
37-
./website/docs/developers/scripts/update-ocaml-node.sh 12345678 87654321 3.1.0 3.2.0-alpha1
40+
./website/docs/developers/scripts/update-ocaml-node.sh 7f94ae0b 978866cd "3.2.0-alpha1" "3.2.0-beta1"
3841
```
3942

4043
**Parameters:**
@@ -74,11 +77,13 @@ After making updates:
7477

7578
## 5. Commit Structure
7679

77-
Following the pattern from PR #1236:
80+
Following the pattern from commit
81+
[31caeee6](https://github.com/o1-labs/openmina/commit/31caeee6af7bf20b8578a23bf69718dbe68fe5cc):
7882

79-
1. **Main Update Commit**: "Update OCaml node dependencies to [version]"
80-
2. **Changelog**: Add entry documenting the version bump
81-
3. **Config Updates**: Separate commit for configuration file changes if needed
83+
1. **Main Update Commit**: "OCaml nodes: bump up to release [version]"
84+
- Updates 6 files: CI workflows, Docker compose, and testing configurations
85+
- Atomic change affecting all OCaml node references
86+
2. **Changelog**: Add entry documenting the version bump if needed
8287

8388
## Related Resources
8489

0 commit comments

Comments
 (0)