Skip to content

Conversation

@vredchenko
Copy link
Collaborator

@vredchenko vredchenko commented Jan 20, 2026

Summary

Implements GitHub Releases and PyPI publishing for EPUPlayer tool with:

  • Semantic versioning (starting v1.0.0)
  • Tag-triggered stable releases (epuplayer-v*)
  • RC pre-releases on push to main (with change detection)
  • Dual distribution: Windows exe + Python package

Closes #117

Changes

Package Restructuring

  • Moved fsrecorder from tools/fsrecorder/ to packages/smartem-epuplayer/
  • Renamed classes: FSRecorder → EPURecorder, FSReplayer → EPUReplayer, FSEvent → EPUEvent
  • Proper Python package with hatchling build backend
  • Modular code: models, recorder, replayer, cli
  • Entry point: epuplayer command
  • Tests with pytest

Release Workflow

  • release-epuplayer.yml: Tag → stable release (GitHub + PyPI), main push → RC (GitHub only)
  • Tests on Linux and Windows
  • PyInstaller Windows exe build with smoke tests
  • PyPI Trusted Publisher publishing

PR Automation

  • pr-admin.yml for auto-labeling and project board integration
  • labeler.yml with component:epuplayer label for monorepo

Documentation

  • ADR 0013: EPUPlayer Release Strategy
  • Updated e2e-simulation.md, deployment.md, smartem-agent-design.md
  • Updated CLAUDE.md and ARCHITECTURE.md

E2E Test Scripts

  • Updated run-e2e-test.sh and run-e2e-test-multi-microscope.sh to use epuplayer CLI

Setup Required After Merge

  1. Configure PyPI Trusted Publishers for smartem-epuplayer
  2. Create PROJECT_TOKEN secret for project board automation (or use org-level permissions)
  3. Create GitHub environment named pypi

Test plan

  • Verify tests pass in CI (Linux + Windows)
  • Verify lint checks pass
  • Test RC release on merge to main
  • Test stable release with tag epuplayer-v1.0.0
  • Verify PyPI package installs: pip install smartem-epuplayer
  • Verify Windows exe runs: epuplayer.exe --help

Move fsrecorder from tools/fsrecorder/ to packages/smartem-fsrecorder/
with proper package structure:

- pyproject.toml with hatchling build backend
- Modular code: models, recorder, replayer, cli
- Entry point: fsrecorder command
- Tests with pytest
- README with installation and usage docs

Package name: smartem-fsrecorder
Initial version: 1.0.0
Add release-fsrecorder.yml workflow:
- Tag fsrecorder-v* triggers stable release to GitHub + PyPI
- Push to main triggers RC pre-release to GitHub only
- PR triggers build + test only
- Tests on Linux and Windows
- PyInstaller Windows exe build with smoke tests
- PyPI Trusted Publisher publishing

Add PR automation:
- pr-admin.yml for auto-labeling and project board integration
- labeler.yml with component labels for monorepo
Document key decisions for fsrecorder release workflow:
- Dual distribution: Windows exe + Python package
- Semantic versioning with fsrecorder-v* tags
- RC releases on push to main, stable on tag
- PyPI for stable releases only
- Hybrid release notes generation
Delete tools/fsrecorder/ directory (code moved to packages/)
Delete build_win_fsrecorder.yml (replaced by release-fsrecorder.yml)
@vredchenko vredchenko added devops CI/CD, deployment, infrastructure, or tooling work enhancement Minor improvements to existing functionality smartem-devtools Developer tooling, documentation, and workspace configuration labels Jan 20, 2026
Comprehensive rename of fsrecorder to epuplayer including:

Package and module:
- smartem-fsrecorder -> smartem-epuplayer
- smartem_fsrecorder -> smartem_epuplayer

Classes:
- FSRecorder -> EPURecorder
- FSReplayer -> EPUReplayer
- FSEvent -> EPUEvent

CLI and executables:
- fsrecorder -> epuplayer
- fsrecorder.exe -> epuplayer.exe

CI/CD:
- release-fsrecorder.yml -> release-epuplayer.yml
- Tag pattern: fsrecorder-v* -> epuplayer-v*
- Label: component:fsrecorder -> component:epuplayer

Documentation:
- ADR 0013 renamed and updated
- e2e-simulation.md updated
- deployment.md updated
- smartem-agent-design.md updated
- CLAUDE.md and ARCHITECTURE.md updated

Tools:
- E2E test scripts updated to use epuplayer CLI
- Workspace pyproject.toml optional dep renamed
@github-actions github-actions bot added component:epuplayer EPUPlayer filesystem recording and replay tool claude-code labels Jan 20, 2026
@vredchenko vredchenko changed the title feat: FSRecorder release workflow with PyPI publishing feat: EPUPlayer release workflow with PyPI publishing Jan 20, 2026
- Fix remaining documentation references to fsrecorder
- Update recording filenames from _fsrecord to _epurecording
- Add component:epuplayer label to GitHub labels config
- Sync labels (deletes old component:fsrecorder, updates epuplayer)
@vredchenko vredchenko marked this pull request as ready for review January 20, 2026 14:18
@vredchenko
Copy link
Collaborator Author

CI Failures

  1. Windows Test Failure - Path normalization issue:
    AssertionError:
    WindowsPath('C:/Users/runneradmin/...') == WindowsPath('C:/Users/RUNNER1/...')
    The fixture passes a short path form (RUNNER
    1) but EPURecorder resolves it to the full form (runneradmin). The test at test_integration.py:38 does a strict equality check. Fix needed in test or recorder.

  2. Project Board Failure - Missing secret:
    Input required and not supplied: github-token
    The pr-admin.yml workflow uses actions/add-to-project which needs a PROJECT_TOKEN secret with project access (personal access token with project scope).


PyPI Configuration Needed

Yes, before the first publish you need to configure Trusted Publishers on PyPI:

  1. Go to https://pypi.org/ → Your projects → Add project (or create smartem-epuplayer first)
  2. Under Publishing → Add a new pending publisher:
    - Owner: DiamondLightSource
    - Repository: smartem-devtools
    - Workflow name: release-epuplayer.yml
    - Environment: pypi

This enables OIDC-based publishing (no API tokens needed).

EPURecorder.watch_dir is intentionally resolved for consistent path
handling. Test now compares against resolved fixture path to handle
Windows short path forms (e.g., RUNNER~1 vs runneradmin).
@vredchenko
Copy link
Collaborator Author

Step 1: Create a PAT with project access

  1. Go to https://github.com/settings/tokens?type=beta (Fine-grained tokens)
  2. Click "Generate new token"
  3. Name: SmartEM Project Board
  4. Repository access: DiamondLightSource/smartem-devtools (or All repositories)
  5. Permissions → Organization permissions → Projects: Read and write
  6. Generate and copy the token

Step 2: Add secret to repo

  1. Go to https://github.com/DiamondLightSource/smartem-devtools/settings/secrets/actions
  2. Click "New repository secret"
  3. Name: PROJECT_TOKEN
  4. Value: paste the PAT from step 1
  5. Click "Add secret"

Alternatively, if you have the token already, you can add it via CLI:
gh secret set PROJECT_TOKEN --repo DiamondLightSource/smartem-devtools
(It will prompt you to paste the token value)

- Update labeler.yml to use labels from github-labels-config.ts
- Map docs → documentation, ci → devops, webui → smartem-devtools:webui, etc.
- Add component:smartem-workspace to labels config
- Sync labels (delete orphaned labels, create missing ones)

This prevents github-actions bot from recreating unofficial labels
that were deleted by the label sync script.
@github-actions github-actions bot added documentation Improvements or additions to project documentation smartem-devtools:claude Claude Code configuration, skills, and prompts smartem-devtools:e2e-test End-to-end testing infrastructure and scenarios labels Jan 20, 2026
@vredchenko vredchenko merged commit 4b2f0eb into main Jan 20, 2026
13 of 15 checks passed
@vredchenko vredchenko deleted the feat/fsrecorder-release-workflow branch January 20, 2026 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:epuplayer EPUPlayer filesystem recording and replay tool devops CI/CD, deployment, infrastructure, or tooling work documentation Improvements or additions to project documentation enhancement Minor improvements to existing functionality smartem-devtools:claude Claude Code configuration, skills, and prompts smartem-devtools:e2e-test End-to-end testing infrastructure and scenarios smartem-devtools Developer tooling, documentation, and workspace configuration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add GitHub Releases for FSRecorder executable

2 participants