Skip to content

Conversation

@krishna9358
Copy link
Contributor

Summary

  • Add comprehensive template library functionality 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

Test plan

  • Test template publishing workflow
  • Test template browsing and filtering
  • Test template usage and workflow creation
  • Test GitHub integration and PR generation
  • Test error handling for invalid templates

- 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]>
@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@krishna9358 krishna9358 marked this pull request as draft February 11, 2026 06:19
krishna9358 and others added 2 commits February 11, 2026 11:54
- 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]>
@krishna9358 krishna9358 marked this pull request as ready for review February 11, 2026 06:33
@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@krishna9358 krishna9358 marked this pull request as draft February 11, 2026 06:33
krishna9358 and others added 11 commits February 12, 2026 18:51
…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]>
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]>
…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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant