Record Steps

Base Class

All record steps must inherit from/implement the following base class (with some repeated from FlowStep)

class flow.flow_steps.FlowRecordStep[RecordType]

A flow step to update the overall list of records.

Parent Class: FlowStep

abstract class property description: str

A high-level description of the step

abstract class property config_types: list[tuple[str, Type[ValidConfigTypes], str]]

The types of the configurations for the step. Each tuple in the list should include the name, type, and description of a configuration (respectively). See FlowStep

abstractmethod validate() None

This function should inspect the object’s configs attribute, and perform any static validation possible.

abstractmethod new_records(curr_records: list[RecordType], logger: Callable[[str], None], get_metadata: Callable[[str], Any], set_metadata: Callable[[str, Any], None], debug: bool = False) list[RecordType]

Add any new records to the list of records.

Parameters:
  • curr_records (list[RecordType]) – The current list of records

  • logger (Callable[[str], None]) – A function to log any notable events

  • get_metadata (Callable[[str], Any],) – A function to retrieve global metadata previously set in the flow

  • set_metadata (Callable[[str, Any], None]) – A function to set global metadata within the flow

  • debug (bool, optional) – Whether we are in “debug” mode. In debug mode, no external state should be modified, and we are free to inject dummy information. Defaults to False.

Returns:

The possibly augmented list of records

Return type:

list[RecordType]

Implementations

class canvas_steps.enrollment.AddEnrollment

A record step that adds new student records for new enrollment.

This step gets the current enrollment from Canvas, and creates a new record for any student that there isn’t a record for already.

Supported record types: StudentRecord

Sets metadata: new_netids

class google_steps.get_tag_records.GetTagRecords

Get TagRecords from a spreadsheet containing StudentRecords.

This step assumes that a spreadsheet contains StudentRecords (such as those made by SpreadsheetStorer), and translates them to TagRecordss (adding a non-tagged TagRecords for each non-empty personal and group repo entry).

Supported record types: TagRecords

configs.sheet_id: str

The ID of the Google Sheet to access

Service Account access

Make sure that your service account has access to the Google Sheet with this ID!

configs.tag: str

The Google Sheet tab to access for records

validate() None

Validate the configurations for the spreadsheet storer.

Parameters:

self (Self) – The step to validate

Specifically, we make sure that the service account can access the specified Google Sheet

class utils.basic_steps.BasicRecordStep

A basic flow record step to add a new record.

The record is chosen at random between 0 and 10 (inclusive).

Supported record types: int