feat: support exporting Canvas group members with group info #7

Merged
张泊明518370910136 merged 3 commits from feat/groupcsv into master 2026-06-22 18:10:05 +08:00

Summary

Add an optional --group argument to export-users.

When --group is not provided, the command keeps the original behavior and exports all Canvas users as:

name,sis_id,login_id

When --group <group_set_prefix> is provided, the command looks up the corresponding Canvas group set, exports only users in that group set, and appends the normalized group name as the fourth column:

name,sis_id,login_id,group_name

For example, if the group set is p2team, the exported group names will be formatted as p2team01, p2team02, p2team10, etc.

Changes

  • Add optional --group support to export-users
  • Look up Canvas group sets by exact name first, then by prefix
  • Export only members in the matched group set when --group is used
  • Append the user's group name as the fourth CSV column
  • Normalize Canvas group names like p1team 1 and p1team10 into p1team01 and p1team10
  • Sort exported rows by group number in ascending order
  • Handle invalid input more gracefully:
    • if no matching group set is found, exit cleanly with an error log
    • if a Canvas group name does not follow the expected group_set_name + number pattern, exit cleanly with an error log

Behavior

Default

joint-teapot export-users students.csv

Output format:

name,sis_id,login_id

With group export

joint-teapot export-users p2.csv --group p2team

Output format:

name,sis_id,login_id,p2team01

Notes

This change keeps the original export behavior unchanged unless --group is explicitly provided.

## Summary Add an optional `--group` argument to `export-users`. When `--group` is not provided, the command keeps the original behavior and exports all Canvas users as: `name,sis_id,login_id` When `--group <group_set_prefix>` is provided, the command looks up the corresponding Canvas group set, exports only users in that group set, and appends the normalized group name as the fourth column: `name,sis_id,login_id,group_name` For example, if the group set is `p2team`, the exported group names will be formatted as `p2team01`, `p2team02`, `p2team10`, etc. ## Changes - Add optional `--group` support to `export-users` - Look up Canvas group sets by exact name first, then by prefix - Export only members in the matched group set when `--group` is used - Append the user's group name as the fourth CSV column - Normalize Canvas group names like `p1team 1` and `p1team10` into `p1team01` and `p1team10` - Sort exported rows by group number in ascending order - Handle invalid input more gracefully: - if no matching group set is found, exit cleanly with an error log - if a Canvas group name does not follow the expected `group_set_name + number` pattern, exit cleanly with an error log ## Behavior ### Default `joint-teapot export-users students.csv` Output format: `name,sis_id,login_id` ### With group export `joint-teapot export-users p2.csv --group p2team` Output format: `name,sis_id,login_id,p2team01` ## Notes This change keeps the original export behavior unchanged unless `--group` is explicitly provided.
姚云翔523370910110 added the
Kind/Feature
Priority
High
labels 2026-06-09 15:28:47 +08:00
manuel was assigned by 姚云翔523370910110 2026-06-09 15:28:47 +08:00
张泊明518370910136 was assigned by 姚云翔523370910110 2026-06-09 15:28:47 +08:00
姚云翔523370910110 added 3 commits 2026-06-09 15:28:48 +08:00
fix: ji to gc in config
Some checks are pending
build / trigger-build-image (push) Waiting to run
da02600511
feat: new option --group for export-users
Some checks are pending
build / trigger-build-image (push) Waiting to run
e80e319e42
feat: regist --group in app
Some checks failed
build / trigger-build-image (push) Has been cancelled
666457ed15
张泊明518370910136 approved these changes 2026-06-22 18:09:58 +08:00
张泊明518370910136 merged commit 2ac29a6d89 into master 2026-06-22 18:10:05 +08:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: JOJ/Joint-Teapot#7
No description provided.