Skip to content

Commit 5ee8bfd

Browse files
authored
blog: add personal experience report on updating workspaces (#212)
1 parent 5b992a0 commit 5ee8bfd

7 files changed

+108
-0
lines changed
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
---
2+
posttype: "blog"
3+
title: "Waking up from Hibernation"
4+
cover: "./cover.jpg"
5+
description: "Join me in this personal experience report on how I dust off and update my Terasology workspaces."
6+
tags: ["IMHO", "Comment"]
7+
author: "Skaldarnar"
8+
date: "2023-04-22"
9+
---
10+
11+
_This is a personal experience report, sharing thoughts and insights into my workflow._
12+
13+
It has been some time since our last update, and it also has been some time since my last contribution to Terasology.
14+
We had these quiet periods before, where everyone is charging up their batteries, learning new things, or just taking a break.
15+
16+
Coming back after such a long time can be hard - even if it seems quiet on a first glance, a lot of things might still have happened.
17+
And indeed: There have been hundreds of commits spread over our repositories since the [last blog post](/blog/tera-spotlight-gsoc-2021-final-show-tell/) in September 2021.
18+
We had two releases since then, with [v5.3.0 / Alpha 23](https://github.com/MovingBlocks/Terasology/releases/tag/v5.3.0) being the latest one.
19+
20+
Let me share how I updated my various workspaces when coming back after some time of absence...
21+
22+
## Updating my Workspaces
23+
24+
To start fresh I wanted to reset my workspaces to a clean state - discard any uncommitted changes (at this point I don't have any clue what they might have been about anyways) and pull the latest changes from upstream.
25+
It's not a hard task and I've done it uncountable times before, but not everybody might be that familiar with the tools and little helpers available to assist with that task.
26+
27+
### Updating my Iota Workspace
28+
29+
To bring my Iota workspace up to speed I used the `groovyw` utility tool that is shipped with the engine repository.
30+
You can run it easily via the provided wrapper scripts, that is `./groovyw` on Linux or `./groovyw.bat` on Windows.
31+
It comes in handy to initialize a workspace with a specific set of modules, fetch additional modules, or update everything via git.
32+
Our [Contributor Quick Start Guide](https://github.com/MovingBlocks/Terasology/wiki/Contributor-Quick-Start#set-up-your-terasology-development-workspace) also references it for the initial setup.
33+
34+
But today I'm only interested in updating all my modules in the workspace.
35+
36+
```
37+
groovyw module update-all
38+
```
39+
40+
This command triggers a run over all the modules in `modules/` and attempts to update them.
41+
42+
![](./groovyw-update-all-iota.png)
43+
44+
This took about 5 seconds to go over the 11 modules of our Iota distribution.
45+
Seemingly my modules were all on `develop` and up to date, so there was nothing else to do here.
46+
47+
Note, that this only updates the modules.
48+
I had to update the engine itself manually by checking out the desired branch (`git switch develop`) and pulling in the changes from upstream (`git pull`).
49+
50+
Another thing to keep in mind: `groovyw module update-all` only attempts to update whatever branch is checked out at the moment - it does not _reset_ onto the default branch, and it might just fail if there are uncommitted changes, for instance.
51+
52+
### Updating my Omega Workspace
53+
54+
For my Omega workspace I used my little CLI tool [node-gooey](https://github.com/skaldarnar/node-gooey) to inspect the current status.
55+
56+
```
57+
gooey workspace status
58+
```
59+
60+
With nearly 150 modules checked out the inspection alone takes about 10 seconds, but I got a good overview whether there are any changes in a module and which branch they are on.
61+
62+
![](node-gooey-status-omega.png)
63+
64+
Following that, I did a _hard reset_ of everything, including the engine itself, to the respective default branches (that is, in all cases here, `develop`):
65+
66+
```
67+
gooey branch reset
68+
```
69+
70+
Most modules were still up to date and there was nothing to be done.
71+
Only one module and the main engine repo were changed, and my workspace should be good to go again.
72+
73+
The complete run took about 7s to update all modules.
74+
75+
![](node-gooey-branch-reset-omega.png)
76+
77+
### Updating my Josharia's Survival Workspace
78+
79+
Yes, I do have a dedicated workspace with all the modules required to work on _Josharia's Survival_, one of the main game modes.
80+
While it is possible to just work with one big Omega workspace, dedicated workspaces per game mode are really handy when working on features for a specific module line-up.
81+
I can leave the workspace in a work-in-progress state with experimental features without affecting other game modes.
82+
83+
With roughly 60 modules checked out, this workspace is about a third of a full Omega workspace.
84+
The status check with `gooey workspace status` shows a couple of repositories in blue, indicating that they are behind their upstream counterpart.
85+
86+
As everything is already on branch `develop`, I gave `groovyw` another chance to compare its performance against the `gooey` CLI:
87+
88+
```
89+
groovyw module update-all
90+
```
91+
92+
As expected, there were no changes found for most modules, and for those lacking behind I could see that they were updated.
93+
The whole run took 13 seconds, followed by a very quick `git pull` to also update the engine itself.
94+
95+
![](groovyw-update-all-js.png)
96+
97+
A final status check showed that everything is green - another workspace ready.
98+
I finished my round of updates with `gooey branch reset` on my other workspaces for _Light and Shadow_ and _Metal Renegades_ and should now be ready to get my hands on the code again.
99+
100+
---
101+
102+
It is worth noting that `groovyw` does not only work for modules, but also for libraries (`lib`), facades (`facade`) and meta repositories.
103+
In addition, there are more features, like creating a dependency graph for Graphviz in the [DOT language](https://graphviz.org/doc/info/lang.html).
104+
To learn more have a look at `groovyw usage`.
105+
106+
On a related note, there is also a PR ([#4805](https://github.com/MovingBlocks/Terasology/pull/4805)) attempting to rewrite `groovyw` into a more powerful CLI tool for managing Terasology workspaces.
107+
108+
Happy Coding!
Loading
Loading
Loading

0 commit comments

Comments
 (0)