Skip to content

Artie external plugin - #1927

Draft
ArtieReus wants to merge 6 commits into
mainfrom
artie-external-plugin
Draft

Artie external plugin#1927
ArtieReus wants to merge 6 commits into
mainfrom
artie-external-plugin

Conversation

@ArtieReus

Copy link
Copy Markdown
Collaborator

Summary

Changes Made

  • Change 1
  • Change 2
  • Change 3

Related Issues

  • Issue 1: [link to issue]

Screenshots (if applicable)

Testing Instructions

  1. pnpm i
  2. pnpm TASK

Checklist

  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have made corresponding changes to the documentation (if applicable).
  • My changes generate no new warnings or errors.
  • I have created a changeset for my changes.

PR Manifesto

Review the PR Manifesto for best practises.

Signed-off-by: Arturo Reuschenbach Puncernau <reuschenbach@gmail.com>
Signed-off-by: Arturo Reuschenbach Puncernau <reuschenbach@gmail.com>
@ArtieReus
ArtieReus requested a review from a team as a code owner August 28, 2026 13:21
Copilot AI lite review requested due to automatic review settings August 28, 2026 13:21
@changeset-bot

changeset-bot Bot commented Aug 28, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 6adb28c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ArtieReus
ArtieReus marked this pull request as draft August 28, 2026 13:22
@ArtieReus ArtieReus self-assigned this Aug 28, 2026
@ArtieReus ArtieReus added the greenhouse-pr-build Set this label to create a preview image which will automatically set the `greenhouse-pr-preview` label Aug 28, 2026
@github-actions github-actions Bot added the greenhouse-pr-preview THIS LABEL IS SET AUTOMATICALLY. label Aug 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a proof-of-concept “external plugin” flow by building the apps/template app as a standalone container image and teaching the Greenhouse shell to load a plugin module from a runtime path.

Changes:

  • Added a Dockerfile for the Template app and a GitHub Actions workflow to build/push a Template plugin image.
  • Injected a PoC Template plugin config into Greenhouse’s plugin registry.
  • Extended usePluginLoader to optionally load plugin modules from a provided path and expose a loading error state to the UI.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
apps/template/docker/Dockerfile Builds a static Template app and serves it via nginx for external-plugin style hosting.
.github/workflows/build-push-template-image.yaml CI workflow to build/push the Template plugin image to GHCR.
apps/greenhouse/src/routes/__root.tsx Adds a PoC Template plugin entry into the config received from Kubernetes.
apps/greenhouse/src/hooks/usePluginLoader.ts Adds optional remote/dynamic module loading and error tracking.
apps/greenhouse/src/components/Extension.tsx Wires a PoC pluginPath and renders an error state when plugin load fails.
Suppressed comments (3)

apps/greenhouse/src/hooks/usePluginLoader.ts:57

  • Remote modules loaded via pluginPath are cached under appName, which can collide with bundled modules (and also makes switching pluginPath versions impossible). A minimal safe approach is to only cache bundled modules until the cache key includes pluginPath.
  // Cache it for next time
  if (module) {
    moduleCache.set(appName, module)
  }

apps/greenhouse/src/hooks/usePluginLoader.ts:96

  • usePluginLoader treats a cached bundled module as "already loaded" even when pluginPath is provided, so switching a plugin to load remotely will never call getApp(). If pluginPath is set, ignore the appName-only cache for initial state so the remote module can load.
  // Check if module is already cached - if so, start with it loaded!
  const cachedModule = moduleCache.get(pluginName)
  const [app, setApp] = useState<PluginModule | null>(cachedModule || null)
  const [isLoading, setIsLoading] = useState(!cachedModule) // Only show loading if not cached
  const [error, setError] = useState<Error | null>(null) // NEW

apps/greenhouse/src/hooks/usePluginLoader.ts:114

  • If getApp() returns null (unknown plugin or failed remote import with no fallback), the hook currently sets isLoading=false and renders an empty container with no error. Convert a null module into an Error so Extension can show the failure state.
        const appModule = await getApp(pluginName, pluginPath) // Pass pluginPath
        if (!cancelled) {
          setApp(appModule)
          setIsLoading(false)
        }

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +60 to +64
// Merge with Kubernetes configs
const allConfigs = {
...kubernetesConfig,
template: templateConfig,
}
Comment on lines +20 to +22
build-and-push:
name: Build and Push Template Plugin Image
runs-on: [ubuntu-latest]
Comment on lines 16 to 19
// Return cached module immediately if available
if (moduleCache.has(appName)) {
return moduleCache.get(appName)!
}
Signed-off-by: Arturo Reuschenbach Puncernau <reuschenbach@gmail.com>
@github-actions github-actions Bot added greenhouse-pr-preview THIS LABEL IS SET AUTOMATICALLY. and removed greenhouse-pr-preview THIS LABEL IS SET AUTOMATICALLY. labels Aug 28, 2026
Signed-off-by: Arturo Reuschenbach Puncernau <reuschenbach@gmail.com>
@github-actions github-actions Bot added greenhouse-pr-preview THIS LABEL IS SET AUTOMATICALLY. and removed greenhouse-pr-preview THIS LABEL IS SET AUTOMATICALLY. labels Aug 28, 2026
Signed-off-by: Arturo Reuschenbach Puncernau <reuschenbach@gmail.com>
@github-actions github-actions Bot added greenhouse-pr-preview THIS LABEL IS SET AUTOMATICALLY. and removed greenhouse-pr-preview THIS LABEL IS SET AUTOMATICALLY. labels Aug 28, 2026
Signed-off-by: Arturo Reuschenbach Puncernau <reuschenbach@gmail.com>
@github-actions github-actions Bot added greenhouse-pr-preview THIS LABEL IS SET AUTOMATICALLY. and removed greenhouse-pr-preview THIS LABEL IS SET AUTOMATICALLY. labels Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

greenhouse-pr-build Set this label to create a preview image which will automatically set the `greenhouse-pr-preview` greenhouse-pr-preview THIS LABEL IS SET AUTOMATICALLY.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants