You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/exercises/exercise-utils.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,12 +13,21 @@ They are loaded during exercise download, which means that the `app` has access
13
13
## Available utility modules
14
14
15
15
-`exercise_utils.cli`: generic CLI calls
16
+
-`exercise_utils.exercise_config`: helpers for updating `.gitmastery-exercise.json`, including adding PR metadata
16
17
-`exercise_utils.file`: file creation and appending helpers
17
18
-`exercise_utils.git`: common Git operations such as commit, repository initialization, and adding files
18
19
-`exercise_utils.gitmastery`: Git-Mastery specific functions such as creating the start tag
19
-
-`exercise_utils.github_cli`: GitHub CLI wrappers for forking, cloning, deleting, and creating repositories, as well as looking up the authenticated user
20
+
-`exercise_utils.github_cli`: GitHub CLI wrappers for repository operations and pull request workflows such as creating, viewing, commenting on, reviewing, merging, and closing PRs
21
+
-`exercise_utils.roles`: role-marker helpers for generating teammate-authored commits, merges, pull requests, comments, reviews, and PR closures
20
22
-`exercise_utils.test`: testing utilities including `GitAutograderTestLoader` and `assert_output` for unit testing verification scripts
21
23
24
+
### `exercise_utils.roles`
25
+
26
+
`RoleMarker(role)` is useful when an exercise needs to simulate teammate-authored Git or GitHub activity while still using the normal helper APIs.
27
+
28
+
- It automatically prefixes commit messages, merge messages, PR titles and bodies, PR comments, and PR reviews with a `[ROLE:...]` marker
29
+
- It also provides utilities for formatting, detecting, extracting, and stripping role markers when you need to work with the text directly
30
+
22
31
### `exercise_utils.cli` functions
23
32
24
33
The existing utility functions should cover most use cases, but if there is no existing utility function for your use case, `exercise_utils.cli` functions are available to execute other CLI calls. These should be used as a last resort.
0 commit comments