flake-update-20260505
1// Package config handles daily-plan configuration.
2package config
3
4import (
5 "os"
6 "path/filepath"
7)
8
9// Config holds the daily-plan configuration.
10type Config struct {
11 // Jira configuration
12 Jira JiraConfig
13
14 // GitHub configuration
15 GitHub GitHubConfig
16
17 // Org-mode configuration
18 Org OrgConfig
19
20 // AI session history configuration
21 AI AIConfig
22
23 // State directory for last-check tracking
24 StateDir string
25}
26
27// AIConfig configures AI session history scanning.
28type AIConfig struct {
29 Dir string // Base directory (e.g. ~/.local/share/ai)
30}
31
32// JiraConfig configures Jira integration.
33type JiraConfig struct {
34 User string // Jira username (e.g. "vdemeest")
35 BaseURL string // Jira browse URL (e.g. "https://issues.redhat.com/browse")
36 Project string // Default project (e.g. "SRVKP")
37}
38
39// GitHubConfig configures GitHub integration.
40type GitHubConfig struct {
41 Username string // GitHub username
42 Owners []string // GitHub orgs/users to track
43 // SecurityRepos are repos to check for security advisories (GHSAs).
44 // These are repos where you're a maintainer with security advisory access.
45 SecurityRepos []string
46 // BotFilters are author patterns to filter out from inbox
47 BotFilters []string
48}
49
50// OrgConfig configures org-mode integration.
51type OrgConfig struct {
52 File string // Path to todos.org (for scheduling)
53 Section string // Section to add TODOs under (e.g. "Work")
54 Files []string // All org files to scan for done items
55 ArchiveDir string // Archive directory for historical done items
56}
57
58// DefaultConfig returns sensible defaults.
59func DefaultConfig() *Config {
60 home, _ := os.UserHomeDir()
61 return &Config{
62 Jira: JiraConfig{
63 User: "vdemeest",
64 BaseURL: "https://issues.redhat.com/browse",
65 Project: "SRVKP",
66 },
67 GitHub: GitHubConfig{
68 Username: "vdemeester",
69 Owners: []string{"tektoncd", "openshift-pipelines"},
70 SecurityRepos: []string{
71 "tektoncd/pipeline",
72 "tektoncd/cli",
73 "tektoncd/triggers",
74 "tektoncd/chains",
75 "tektoncd/operator",
76 "tektoncd/results",
77 "tektoncd/dashboard",
78 "tektoncd/pipelines-as-code",
79 },
80 BotFilters: []string{
81 "openshift-pipelines-bot",
82 "red-hat-konflux",
83 "dependabot[bot]",
84 "github-actions[bot]",
85 "openshift-cherrypick-robot",
86 },
87 },
88 Org: OrgConfig{
89 File: filepath.Join(home, "desktop", "org", "todos.org"),
90 Section: "Work",
91 Files: []string{
92 filepath.Join(home, "desktop", "org", "todos.org"),
93 },
94 ArchiveDir: filepath.Join(home, "desktop", "org", "archive"),
95 },
96 AI: AIConfig{
97 Dir: filepath.Join(home, ".local", "share", "ai"),
98 },
99 StateDir: filepath.Join(home, ".local", "share", "daily-plan"),
100 }
101}
102
103// LastCheckFile returns the path to the last-check timestamp file.
104func (c *Config) LastCheckFile() string {
105 return filepath.Join(c.StateDir, "last-check")
106}