Skip to content

🐛 Fix Broken Template Launcher Due to Unbundled project-templates Dir - #434

Merged
MFA-X-AI merged 3 commits into
masterfrom
fahreza/fix-template
Aug 5, 2025
Merged

MFA-X-AI merged 3 commits into
masterfrom
fahreza/fix-template

Conversation

@MFA-X-AI

@MFA-X-AI MFA-X-AI commented Aug 5, 2025

Copy link
Copy Markdown
Member

Description

This PR fixes a bug where the project-templates directory (used only when developing from source) wasn’t bundled in the pip-installed wheel, causing template commands to fail on a clean install. To address this:

  • Moved AgentTemplate.xircuits and ServiceTemplate.xircuits from project-templates/ into examples/ so they ship inside the wheel.
  • Added a new /examples/ backend endpoint (FetchExamplesRouteHandler) that copies the bundled examples/ folder into the user’s working directory.
  • Registered a new xircuits:fetch-examples command and wired it into the launcher-template logic before copying individual examples.

References

#428

Pull Request Type

  • Xircuits Core (JupyterLab-related changes)
  • Xircuits Canvas (Custom RD-related changes)
  • Xircuits Project Template
  • Xircuits Component Library
  • Testing Automation
  • Documentation
  • Others (Please Specify)

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Tests

1. Test A

  1. Create a fresh virtual environment and pip install xircuits.
  2. Launch JupyterLab (jupyter lab) in an empty directory.
  3. In the Launcher’s Xircuits Templates section, click Agent.
    • Verify the new examples/ folder is created at the project root.
    • Verify AgentTemplate.xircuits is copied into your current workspace and opens in the editor.
  4. Repeat for the Service template.
  5. Confirm that re-running the same template command does not re-copy or overwrite an existing examples/ directory (you should see “Examples folder already exists and is not empty.”).

Tested on? Specify Version.

  • Windows 10
  • Linux
  • Mac
  • Others (State here → ___)

Notes

I originally missed this bug when reviewing because I was testing on Binder, which clones the full repo (including project-templates/), rather than using a fresh pip install where the project-templates/ directory isn’t bundled. Definitely a thing to be remembered for future reviewers.

@github-actions

github-actions Bot commented Aug 5, 2025

Copy link
Copy Markdown

Binder 👈 Launch a binder notebook on branch XpressAI/xircuits/fahreza/fix-template

@MFA-X-AI
MFA-X-AI merged commit 6f101e4 into master Aug 5, 2025
@MFA-X-AI
MFA-X-AI deleted the fahreza/fix-template branch August 5, 2025 09:11
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.

1 participant