Documentation
¶
Overview ¶
Package workflows provides Temporal workflow definitions for contextd automation.
Package workflows provides Temporal workflow definitions for contextd automation.
Index ¶
- func FetchFileContentActivity(ctx context.Context, input FetchFileContentInput) (string, error)
- func NewGitHubClient(ctx context.Context, token config.Secret) (*github.Client, error)
- func RemoveVersionMismatchCommentActivity(ctx context.Context, input PostVersionCommentInput) error
- type CategorizeFilesInput
- type CategorizedFiles
- type DocumentationValidationInput
- type DocumentationValidationResult
- type FetchFileContentInput
- type FetchPRFilesInput
- type FileChange
- type GitHubClientConfig
- type PluginUpdateValidationConfig
- type PluginUpdateValidationResult
- type PostCommentInput
- type PostCommentResult
- func PostReminderCommentActivity(ctx context.Context, input PostCommentInput) (*PostCommentResult, error)
- func PostSuccessCommentActivity(ctx context.Context, input PostCommentInput) (*PostCommentResult, error)
- func PostVersionMismatchCommentActivity(ctx context.Context, input PostVersionCommentInput) (*PostCommentResult, error)
- type PostVersionCommentInput
- type SchemaValidationResult
- type ValidateSchemasInput
- type ValidationIssue
- type VersionValidationConfig
- type VersionValidationResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchFileContentActivity ¶
func FetchFileContentActivity(ctx context.Context, input FetchFileContentInput) (string, error)
FetchFileContentActivity fetches the content of a single file from GitHub.
func NewGitHubClient ¶
NewGitHubClient creates a GitHub client with proper authentication.
func RemoveVersionMismatchCommentActivity ¶
func RemoveVersionMismatchCommentActivity(ctx context.Context, input PostVersionCommentInput) error
RemoveVersionMismatchCommentActivity removes the version mismatch comment if it exists. This is called when versions match to clean up any previous mismatch comments.
Types ¶
type CategorizeFilesInput ¶
type CategorizeFilesInput struct {
Files []FileChange
}
type CategorizedFiles ¶
type CategorizedFiles struct {
CodeFiles []string // Files that affect plugin behavior
PluginFiles []string // Files in .claude-plugin/
OtherFiles []string // Other files (tests, docs, etc.)
}
CategorizedFiles contains files categorized by type.
func CategorizeFilesActivity ¶
func CategorizeFilesActivity(ctx context.Context, input CategorizeFilesInput) (*CategorizedFiles, error)
CategorizeFilesActivity categorizes files by whether they affect the plugin.
type DocumentationValidationInput ¶
type DocumentationValidationInput struct {
Owner string
Repo string
PRNumber int
HeadSHA string
CodeFiles []string
PluginFiles []string
}
DocumentationValidationInput defines parameters for ValidateDocumentationActivity.
type DocumentationValidationResult ¶
type DocumentationValidationResult struct {
Valid bool `json:"valid"`
Summary string `json:"summary"`
FilesReviewed int `json:"files_reviewed,omitempty"`
CriticalIssues []ValidationIssue `json:"critical_issues"`
HighIssues []ValidationIssue `json:"high_issues"`
MediumIssues []ValidationIssue `json:"medium_issues"`
LowIssues []ValidationIssue `json:"low_issues"`
}
DocumentationValidationResult represents validation findings.
func ValidateDocumentationActivity ¶
func ValidateDocumentationActivity(ctx context.Context, input DocumentationValidationInput) (*DocumentationValidationResult, error)
ValidateDocumentationActivity validates that plugin docs match code changes. TODO: Implement Claude API integration
type FetchFileContentInput ¶
type FetchPRFilesInput ¶
type FileChange ¶
type FileChange struct {
Path string
Status string // "added", "modified", "removed"
Additions int
Deletions int
}
FileChange represents a changed file in the PR.
func FetchPRFilesActivity ¶
func FetchPRFilesActivity(ctx context.Context, input FetchPRFilesInput) ([]FileChange, error)
FetchPRFilesActivity fetches the list of files changed in a PR.
type GitHubClientConfig ¶
GitHubClientConfig holds GitHub client configuration.
type PluginUpdateValidationConfig ¶
type PluginUpdateValidationConfig struct {
Owner string // GitHub repository owner
Repo string // GitHub repository name
PRNumber int // Pull request number
BaseBranch string // Base branch (usually "main")
HeadBranch string // PR branch
HeadSHA string // PR commit SHA
GitHubToken config.Secret // GitHub API token for activities
UseAgentValidation bool // Whether to use AI agent for documentation validation
}
PluginUpdateValidationConfig configures the plugin validation workflow.
type PluginUpdateValidationResult ¶
type PluginUpdateValidationResult struct {
CodeFilesChanged []string // Files that affect plugin behavior
PluginFilesChanged []string // Files in .claude-plugin/
NeedsUpdate bool // Whether plugin needs updating
SchemaValid bool // Whether schemas are valid JSON
AgentValidation *DocumentationValidationResult // Agent validation results (if enabled)
AgentValidationRan bool // Whether agent validation was executed
CommentPosted bool // Whether we posted a comment
CommentURL string // URL of posted comment
Errors []string // Any errors encountered
}
PluginUpdateValidationResult contains validation results.
func PluginUpdateValidationWorkflow ¶
func PluginUpdateValidationWorkflow(ctx workflow.Context, config PluginUpdateValidationConfig) (*PluginUpdateValidationResult, error)
PluginUpdateValidationWorkflow validates plugin updates in a PR.
This workflow: 1. Fetches PR file changes from GitHub 2. Detects if code changes require plugin updates 3. Validates plugin schemas if modified 4. Posts reminder comments if needed 5. Posts success message if plugin updated correctly
type PostCommentInput ¶
type PostCommentResult ¶
type PostCommentResult struct {
URL string
}
func PostReminderCommentActivity ¶
func PostReminderCommentActivity(ctx context.Context, input PostCommentInput) (*PostCommentResult, error)
PostReminderCommentActivity posts a reminder comment to the PR.
func PostSuccessCommentActivity ¶
func PostSuccessCommentActivity(ctx context.Context, input PostCommentInput) (*PostCommentResult, error)
PostSuccessCommentActivity posts a success message to the PR.
func PostVersionMismatchCommentActivity ¶
func PostVersionMismatchCommentActivity(ctx context.Context, input PostVersionCommentInput) (*PostCommentResult, error)
PostVersionMismatchCommentActivity posts a version mismatch comment to the PR.
type PostVersionCommentInput ¶
type SchemaValidationResult ¶
func ValidatePluginSchemasActivity ¶
func ValidatePluginSchemasActivity(ctx context.Context, input ValidateSchemasInput) (*SchemaValidationResult, error)
ValidatePluginSchemasActivity validates JSON schemas in plugin files.
type ValidateSchemasInput ¶
type ValidationIssue ¶
type ValidationIssue struct {
File string `json:"file"`
Line int `json:"line,omitempty"`
Severity string `json:"severity,omitempty"`
Issue string `json:"issue"`
Current string `json:"current,omitempty"`
ShouldBe string `json:"should_be,omitempty"`
Fix string `json:"fix"`
Impact string `json:"impact,omitempty"`
}
ValidationIssue represents a single validation finding.
type VersionValidationConfig ¶
type VersionValidationConfig struct {
Owner string // GitHub repository owner
Repo string // GitHub repository name
PRNumber int // Pull request number
HeadSHA string // PR commit SHA
GitHubToken config.Secret // GitHub API token for activities
}
VersionValidationConfig configures the version validation workflow.
type VersionValidationResult ¶
type VersionValidationResult struct {
VersionMatches bool // Whether VERSION file matches plugin.json
VersionFile string // Version from VERSION file
PluginVersion string // Version from plugin.json
CommentPosted bool // Whether we posted a comment
CommentURL string // URL of posted comment
Errors []string // Any errors encountered
}
VersionValidationResult contains validation results.
func VersionValidationWorkflow ¶
func VersionValidationWorkflow(ctx workflow.Context, config VersionValidationConfig) (*VersionValidationResult, error)
VersionValidationWorkflow validates that VERSION file matches plugin.json.
This workflow: 1. Fetches VERSION file content from PR 2. Fetches plugin.json and extracts version 3. Compares versions 4. Posts comment if versions don't match