-
Notifications
You must be signed in to change notification settings - Fork 20
feat: Add Template Library #278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
krishna9358
wants to merge
14
commits into
main
Choose a base branch
from
krishna9358/template-library
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add comprehensive template library for workflow templates - Support publishing workflows as templates with GitHub integration - Allow users to browse and use existing templates - Include template submission workflow with pull request generation - Add frontend UI for template discovery and usage - Add database schema for templates and submissions - Implement GitHub template service for fetching templates - Add workflow sanitization service to remove sensitive data - Include TypeScript type definitions and error handling Co-Authored-By: Claude Haiku 4.5 <[email protected]> Signed-off-by: Krishna Mohan <[email protected]>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
- Change Array<T> to T[] in templateStore.ts - Fix Select component props formatting in TemplateLibraryPage - Fix Button onClick callback formatting - Fix fetch call and .json() chaining formatting - Fix Publish as Template text wrapping in TopBar Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Krishna Mohan <[email protected]>
- Change Array<T> to T[] throughout template files - Fix import statement formatting - Fix query chain formatting in repository - Fix unused variables by prefixing with underscore - Fix object literal formatting and error logging Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Krishna Mohan <[email protected]>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
…lity issue The TemplatesModule causes a "function is not a constructor" error when loaded by NestJS in the Bun runtime. This is a known Bun+NestJS compatibility issue (see oven-sh/bun#4858). Changes: - Added forwardRef for WorkflowsModule import (good practice regardless) - Added comments documenting the temporary disable - Removed TemplatesModule from app.module.ts coreModules array The backend now starts successfully. The template library feature will be unavailable until this compatibility issue is resolved. Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Krishna Mohan <[email protected]>
This commit refactors the Template Library to use GitHub's web flow for publishing instead of Octokit API, and fixes Bun+NestJS compatibility issues. Changes: - Frontend now generates GitHub URLs directly for template submission - Added GitHub sync service to fetch templates from repository - Made template listing endpoints public for browsing - Fixed Bun+NestJS constructor error by removing duplicate providers - Replaced RequireWorkflowRole with RolesGuard to avoid module dependencies - Added better PR creation instructions in the publish modal - Removed Octokit dependency and token from backend Users can now: 1. Publish workflows as templates via GitHub PR flow 2. Browse templates from the library (after sync from GitHub) 3. Sync templates from GitHub repo to database via admin endpoint Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Krishna Mohan <[email protected]>
Signed-off-by: Krishna Mohan <[email protected]>
This is required for webhook signature verification. Signed-off-by: Krishna Mohan <[email protected]>
The sync is now handled directly by GitHubSyncService in the controller. This removes confusing dead code that returned a "disabled" message. Also fixes ESLint errors for unused parameters. Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Krishna Mohan <[email protected]>
- Remove webhook controller and token auth (repo is public) - Remove periodic sync interval to avoid GitHub rate limit exhaustion - Add graceful 403 rate limit handling in GitHub API calls - Fix findAll() query composition bug using and() pattern - Add tag filtering, ILIKE escaping, and proper sort ordering - Add ARCHITECTURE.md documenting the template library system Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Krishna Mohan <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Krishna Mohan <[email protected]>
…b URL length limit Large workflow graphs were causing "URL is too long" errors on GitHub. Now copies template JSON to clipboard and instructs user to paste it in the GitHub editor. Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Krishna Mohan <[email protected]>
Backend: Remove mandatory `manifest` field check - actual templates only have `_metadata`, `graph`, and `requiredSecrets`. Build manifest from `_metadata` for DB storage. Frontend: Strip viewport/position data from graph to reduce URL size. Embed template content in GitHub URL when it fits (<7.5KB), fall back to clipboard with paste instructions only for very large templates. Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Krishna Mohan <[email protected]>
- Implement useTemplate endpoint: creates a real workflow from template graph via WorkflowsService, increments popularity counter - Publish flow: use minified JSON + stripped layout data to always embed content in GitHub URL (no clipboard fallback) - Template cards: fix inconsistent button positioning with flex layout so buttons are always pinned to the bottom of each card Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Krishna Mohan <[email protected]>
…oken support - Fix workflowId undefined in redirect by mapping backend response (workflow.id → workflowId) in templateStore - Restore pretty-printed JSON (2-space indent) in publish flow so GitHub renders syntax highlighting correctly - Add optional GITHUB_TEMPLATE_TOKEN env var for authenticated API requests (60 → 5000 req/hr) with startup log showing auth status Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Krishna Mohan <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Test plan