Skip to content

feat: scaffold ARM automation framework for Relativity workspace restoration#2

Draft
davis-chad wants to merge 1 commit into
mainfrom
cursor/-bc-3b29d566-6d06-4cef-b7be-6c06446f2fdd-a9d0
Draft

feat: scaffold ARM automation framework for Relativity workspace restoration#2
davis-chad wants to merge 1 commit into
mainfrom
cursor/-bc-3b29d566-6d06-4cef-b7be-6c06446f2fdd-a9d0

Conversation

@davis-chad

Copy link
Copy Markdown
Owner

Summary

Scaffolds the Python-based ARM (Archive & Restore Manager) automation system for automating Relativity workspace restoration steps tracked in Smartsheet.

What's included

Core modules (arm_automation/)

Module Purpose
config.py Environment-variable-based configuration. Reads SMARTSHEET_API_KEY, REQUESTS_CA_BUNDLE (Zscaler support), and REQUEST_TIMEOUT. Produces an immutable Config dataclass with a .verify property ready for requests.
archive_parser.py Parses Relativity ARM ArchiveInformation.xml files using xml.etree.ElementTree. Returns a flat dict[str, str] keyed by element path (e.g. ArchiveInformation/DatabaseInfo/ServerName). Also supports CSV export via to_csv(). Handles UNC paths via pathlib.Path.
smartsheet_client.py Schema-agnostic Smartsheet REST API client built on requests. Supports get_sheet, list_columns, get_row, update_row, and add_rows. Does not hard-code column names/IDs — callers pass them explicitly. Respects the Config.verify property for TLS.
step_runner.py Decorator-based step registry (@register_step) and execution framework. Steps receive a StepContext dataclass and return a StepResult. Exceptions are caught and surfaced as failed results with messages.

First step implementation (arm_automation/steps/)

Module Step name Description
parse_archive_info.py parse_archive_info Parses an ArchiveInformation.xml from a path in context.params["archive_xml_path"], optionally exports to CSV, and makes the parsed dict available in StepResult.outputs["archive_data"].

Tests (tests/)

28 tests covering:

  • Config.from_env() — valid configs, missing/empty API key, frozen dataclass
  • archive_parser.parse() — top-level fields, nested fields, UNC paths, XML attributes, error cases
  • archive_parser.to_csv() — file creation, headers, content fidelity, parent directory creation
  • Step runner — registration, duplicate detection, unknown steps, success/failure, context passing
  • parse_archive_info step — end-to-end with real XML fixture

Other changes

  • Updated requirements.txt with requests and pytest
  • Updated README.md with full project documentation, usage examples, and design decisions

Design decisions

  • REST API over Smartsheet SDK: Keeps the dependency footprint small and gives full control over HTTP behaviour for Zscaler environments.
  • stdlib XML parsing: Uses xml.etree.ElementTree — no lxml needed.
  • TLS verification never disabled: Config.verify always returns True or a CA bundle path.
  • Schema-agnostic Smartsheet client: Column IDs and sheet schemas are never hard-coded.

How to test

pip install -r requirements.txt
pytest tests/ -v
Open in Web Open in Cursor 

- arm_automation/config.py: environment-based configuration with Zscaler
  CA bundle support
- arm_automation/archive_parser.py: XML parser for ArchiveInformation.xml
  with CSV export and dict output
- arm_automation/smartsheet_client.py: schema-agnostic Smartsheet REST API
  client using requests
- arm_automation/step_runner.py: decorator-based step registry and
  execution framework with error handling
- arm_automation/steps/parse_archive_info.py: first checklist step —
  parse archive XML, optionally export CSV
- tests/: 28 passing tests covering config, parser, step runner, and
  the parse_archive_info step
- Updated requirements.txt with requests and pytest
- Updated README.md with project documentation

Co-authored-by: davis-chad <davis-chad@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants