Skip to content

Commit e7c1f77

Browse files
jeremymanningclaude
andcommitted
Extend onboard/offboard scripts to update lab-manual (Phase 4)
- onboard_member.py now calls add_member_to_lab_manual() after CV update - offboard_member.py now calls move_member_to_alumni() after CV update - Both wrap lab-manual operations in try/except for graceful degradation - Lab-manual changes are committed and pushed directly to master - 192 tests passing Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9a385ac commit e7c1f77

3 files changed

Lines changed: 45 additions & 5 deletions

File tree

scripts/offboard_member.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,26 @@ def offboard_member(
266266
move_to_alumni(xlsx_path, member, years_string)
267267
update_cv_entry(cv_path, member["name"], end_year)
268268

269+
# Update lab-manual (best-effort; failure doesn't block offboarding)
270+
try:
271+
from parse_lab_manual import move_member_to_alumni as lm_move, commit_and_push_lab_manual
272+
lab_manual_tex = project_root / 'lab-manual' / 'lab_manual.tex'
273+
if lab_manual_tex.exists():
274+
print(" Updating lab-manual...")
275+
lm_move(lab_manual_tex, member["name"], end_year)
276+
try:
277+
commit_and_push_lab_manual(
278+
project_root / 'lab-manual',
279+
f"Offboard {member['name']}"
280+
)
281+
print(f" Updated lab-manual and pushed to remote")
282+
except RuntimeError as e:
283+
print(f" WARNING: Lab-manual updated locally but push failed: {e}")
284+
else:
285+
print(" NOTE: Lab-manual submodule not found, skipping lab-manual update")
286+
except Exception as e:
287+
print(f" WARNING: Could not update lab-manual: {e}")
288+
269289
print(f"\nSuccessfully offboarded {member['name']}")
270290
print("Run 'python build.py' to rebuild people.html")
271291

scripts/onboard_member.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,6 +1067,26 @@ def onboard_member(
10671067
print("\nUpdating CV...")
10681068
add_to_cv(cv_path, name, rank, current_year)
10691069

1070+
# Update lab-manual (best-effort; failure doesn't block onboarding)
1071+
try:
1072+
from parse_lab_manual import add_member_to_lab_manual, commit_and_push_lab_manual
1073+
lab_manual_tex = project_root / 'lab-manual' / 'lab_manual.tex'
1074+
if lab_manual_tex.exists():
1075+
print("\nUpdating lab-manual...")
1076+
add_member_to_lab_manual(lab_manual_tex, name, rank, current_year)
1077+
try:
1078+
commit_and_push_lab_manual(
1079+
project_root / 'lab-manual',
1080+
f"Onboard {name}"
1081+
)
1082+
print(f" Updated lab-manual and pushed to remote")
1083+
except RuntimeError as e:
1084+
print(f" WARNING: Lab-manual updated locally but push failed: {e}")
1085+
else:
1086+
print(" NOTE: Lab-manual submodule not found, skipping lab-manual update")
1087+
except Exception as e:
1088+
print(f" WARNING: Could not update lab-manual: {e}")
1089+
10701090
if github_username:
10711091
invite_to_github_org(github_username, github_teams)
10721092

specs/001-people-labmanual-sync/tasks.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@
7373

7474
### Implementation for User Story 2
7575

76-
- [ ] T021 [US2] Refactor T017's lab_manual.tex writer into shared helper `add_member_to_lab_manual(tex_path, name, role, start_year)` in `scripts/parse_lab_manual.py` (depends on T017). Inserts `\item Name (YYYY -- )` into correct `\newthought{Role}` section under `\subsection{Current lab members}`
77-
- [ ] T022 [US2] Create shared helper function in `scripts/parse_lab_manual.py`: `move_member_to_alumni(tex_path, name, end_year)` that moves entry from Current to Alumni section and closes the year range
78-
- [ ] T023 [US2] Update `scripts/onboard_member.py`: after existing people.xlsx + JRM_CV.tex updates, call `add_member_to_lab_manual()` and `commit_and_push_lab_manual()` (from T009a), wrapped in try/except with warning on failure
79-
- [ ] T024 [US2] Update `scripts/offboard_member.py`: after existing people.xlsx + JRM_CV.tex updates, call `move_member_to_alumni()` and `commit_and_push_lab_manual()` (from T009a), wrapped in try/except with warning on failure
80-
- [ ] T025 [P] [US2] Add tests to `tests/test_parse_lab_manual.py` for: add_member_to_lab_manual (correct section, correct format), move_member_to_alumni (removal + insertion)
76+
- [x] T021 [US2] Refactor T017's lab_manual.tex writer into shared helper `add_member_to_lab_manual(tex_path, name, role, start_year)` in `scripts/parse_lab_manual.py` (depends on T017). Inserts `\item Name (YYYY -- )` into correct `\newthought{Role}` section under `\subsection{Current lab members}`
77+
- [x] T022 [US2] Create shared helper function in `scripts/parse_lab_manual.py`: `move_member_to_alumni(tex_path, name, end_year)` that moves entry from Current to Alumni section and closes the year range
78+
- [x] T023 [US2] Update `scripts/onboard_member.py`: after existing people.xlsx + JRM_CV.tex updates, call `add_member_to_lab_manual()` and `commit_and_push_lab_manual()` (from T009a), wrapped in try/except with warning on failure
79+
- [x] T024 [US2] Update `scripts/offboard_member.py`: after existing people.xlsx + JRM_CV.tex updates, call `move_member_to_alumni()` and `commit_and_push_lab_manual()` (from T009a), wrapped in try/except with warning on failure
80+
- [x] T025 [P] [US2] Add tests to `tests/test_parse_lab_manual.py` for: add_member_to_lab_manual (correct section, correct format), move_member_to_alumni (removal + insertion)
8181

8282
**Checkpoint**: Onboard/offboard scripts update all three destinations; lab-manual failures warn but don't block
8383

0 commit comments

Comments
 (0)