Skip to content

Add release action#9

Merged
DevTGHa merged 3 commits intodevfrom
add-release-action
Mar 31, 2026
Merged

Add release action#9
DevTGHa merged 3 commits intodevfrom
add-release-action

Conversation

@DevTGHa
Copy link
Copy Markdown
Collaborator

@DevTGHa DevTGHa commented Mar 31, 2026

Add release action

Summary

Adds a manual GitHub Actions workflow to publish the designer-plugin package to PyPI.

  • Triggered manually via workflow_dispatch
  • Extracts version from pyproject.toml at runtime
  • Guards against publishing an already-released version (checks PyPI before building)
  • Creates a git tag after publishing, with graceful handling if the tag already exists

Summary by CodeRabbit

  • New Features

    • Modules now register automatically on first execute() or rpc() call (lazy registration).
    • Function dependencies are automatically detected and registered.
    • Enhanced function re-registration with replacement handling.
  • API Changes

    • Renamed execution functions: d3_api_plugind3_api_execute, d3_api_aplugind3_api_aexecute.
    • context_modules parameter type changed to set.
    • Removed add_packages_in_current_file() helper.
  • Documentation

    • Updated registration behavior and Jupyter workarounds in README.
    • Version bumped to 1.3.0.

@DevTGHa DevTGHa self-assigned this Mar 31, 2026
@DevTGHa DevTGHa changed the base branch from main to dev March 31, 2026 10:42
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 31, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1a266a05-fcf4-4a94-a6b4-6bd5bdf47606

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

This PR introduces lazy module registration for D3 sessions, implements AST-based automatic import detection for d3functions, renames API execution functions for clarity, and expands CI testing across Python 3.11–3.13. GitHub Actions workflows for release and test publishing are also added.

Changes

Cohort / File(s) Summary
GitHub Actions Workflows
.github/workflows/ci.yml, .github/workflows/release.yml, .github/workflows/test-publish.yml
Updated CI to test Python 3.11–3.13 with fail-fast: false, upgraded action versions (checkout v4→v6, setup-uv v5→v7); added new manual workflows for publishing to PyPI and Test PyPI with version mutation for pre-release builds.
API Function Renames
src/designer_plugin/api.py, src/designer_plugin/d3sdk/client.py
Renamed d3_api_plugind3_api_execute and d3_api_aplugind3_api_aexecute for consistency; updated call sites to use new names.
Import Detection System
src/designer_plugin/d3sdk/ast_utils.py, src/designer_plugin/d3sdk/builtin_modules.py, src/designer_plugin/d3sdk/__init__.py
Replaced call-stack-based find_packages_in_current_file() with AST-driven find_imports_for_function() that detects and filters imports by actual usage within function bodies; added PackageInfo and ImportAlias Pydantic models; introduced SUPPORTED_MODULES and NOT_SUPPORTED_MODULES constants.
Core Session & Function Logic
src/designer_plugin/d3sdk/session.py, src/designer_plugin/d3sdk/function.py
Implemented lazy module registration: execute() now auto-registers modules on first call and tracks them in registered_modules; changed context_modules from list[str] to set[str]; added function replacement logic with debug logging; integrated auto-extracted imports into module payloads.
Documentation & Configuration
CHANGELOG.md, CONTRIBUTING.md, README.md, pyproject.toml
Updated CHANGELOG with v1.3.0 release notes; clarified test-running instructions (unit vs. integration); revised README examples to reflect lazy registration and removed TYPE_CHECKING-guarded imports; bumped version to 1.3.0 and added integration test marker exclusion in pytest config.
Test Suite
tests/test_ast_utils.py, tests/test_client.py, tests/test_core.py, tests/test_session.py, tests/test_supported_modules.py
Updated ast_utils tests to cover new find_imports_for_function and PackageInfo models; added comprehensive session tests for lazy registration behavior (sync and async); added core function replacement and package extraction tests; added integration tests for SUPPORTED_MODULES/NOT_SUPPORTED_MODULES validation via RPC; updated client tests to mock new API function names.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant Session as D3Session<br/>.execute()
    participant Registry as D3Function<br/>._available_packages
    participant API as d3_api_execute<br/>(payload)
    participant Designer as Designer<br/>Instance

    User->>Session: execute(payload with moduleName)
    activate Session
    alt moduleName not in registered_modules
        Session->>Registry: Check if module exists
        Registry-->>Session: Module found
        Session->>API: d3_api_register_module(moduleName)
        activate API
        API->>Designer: Send registration
        Designer-->>API: Acknowledge
        deactivate API
        Session->>Session: Add to registered_modules
    else moduleName already registered
        Session->>Session: Skip registration
    end
    Session->>API: d3_api_execute(payload)
    activate API
    API->>Designer: Execute payload
    Designer-->>API: Result
    deactivate API
    API-->>Session: Response
    deactivate Session
    Session-->>User: Return result
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

  • PRs #4, #7, #8: Directly related code-level changes involving the same d3sdk subsystem modifications—API function renames, AST-based import detection, lazy module registration, and D3Session/D3Function behavior updates.
  • PR #5: Related API renaming changes (d3_api_plugin/d3_api_aplugin → d3_api_execute/d3_api_aexecute).

Suggested labels

enhancement

Suggested reviewers

  • nathan-disguise
  • twhittock-disguise

Poem

🐰 Lazy modules hop into place,
AST whispers imports with grace,
Functions replaced with a gentle log,
Sets now track through the registration fog,
Python 3.13 joins the test brigade!

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Add release action' is vague and only partially describes the changeset. While a release workflow was added, the PR encompasses significantly broader changes including new pystub features, lazy module registration, package auto-discovery, integration tests, and extensive documentation updates. Consider a more specific title that better captures the primary scope, such as 'Add lazy module registration with auto-discovery and release workflows' or refocus the PR scope to match the title.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-release-action

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@DevTGHa DevTGHa force-pushed the add-release-action branch from e489922 to f5e8a07 Compare March 31, 2026 10:54
add tag on release

restrict action to main
@DevTGHa DevTGHa force-pushed the add-release-action branch from f5e8a07 to 53ffa96 Compare March 31, 2026 13:43
@DevTGHa DevTGHa force-pushed the add-release-action branch from 1e5f6bd to d7ed34e Compare March 31, 2026 13:54
@DevTGHa DevTGHa added the enhancement New feature or request label Mar 31, 2026
@DevTGHa DevTGHa merged commit a6f666c into dev Mar 31, 2026
4 checks passed
@DevTGHa DevTGHa deleted the add-release-action branch March 31, 2026 13:54
@coderabbitai coderabbitai bot mentioned this pull request Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Development

Successfully merging this pull request may close these issues.

1 participant