Skip to content

Commit d92fdc2

Browse files
committed
fixes for CI
1 parent c94407d commit d92fdc2

14 files changed

Lines changed: 144 additions & 62 deletions

File tree

.github/dependabot.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
version: 2
2+
updates:
3+
# Enable version updates for Go modules
4+
- package-ecosystem: "gomod"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
day: "monday"
9+
time: "05:00"
10+
open-pull-requests-limit: 10
11+
reviewers:
12+
- "kevinelliott"
13+
labels:
14+
- "dependencies"
15+
- "go"
16+
commit-message:
17+
prefix: "chore"
18+
include: "scope"
19+
20+
# Enable version updates for GitHub Actions
21+
- package-ecosystem: "github-actions"
22+
directory: "/"
23+
schedule:
24+
interval: "weekly"
25+
day: "monday"
26+
time: "05:00"
27+
open-pull-requests-limit: 5
28+
reviewers:
29+
- "kevinelliott"
30+
labels:
31+
- "dependencies"
32+
- "github-actions"
33+
commit-message:
34+
prefix: "ci"
35+
include: "scope"

.github/workflows/codeql.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
schedule:
9+
- cron: '30 1 * * 1' # Weekly on Monday at 1:30 UTC
10+
11+
permissions:
12+
actions: read
13+
contents: read
14+
security-events: write
15+
16+
jobs:
17+
analyze:
18+
name: Analyze
19+
runs-on: ubuntu-latest
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
language: [ 'go' ]
25+
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
30+
- name: Initialize CodeQL
31+
uses: github/codeql-action/init@v3
32+
with:
33+
languages: ${{ matrix.language }}
34+
queries: security-and-quality
35+
36+
- name: Autobuild
37+
uses: github/codeql-action/autobuild@v3
38+
39+
- name: Perform CodeQL Analysis
40+
uses: github/codeql-action/analyze@v3
41+
with:
42+
category: "/language:${{matrix.language}}"

.github/workflows/test.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ on:
66
pull_request:
77
branches: [ main ]
88

9+
permissions:
10+
contents: read
11+
security-events: write
12+
actions: read
13+
914
jobs:
1015
test:
1116
name: Test
@@ -80,7 +85,7 @@ jobs:
8085
output: 'trivy-results.sarif'
8186

8287
- name: Upload Trivy results to GitHub Security tab
83-
uses: github/codeql-action/upload-sarif@v2
88+
uses: github/codeql-action/upload-sarif@v3
8489
if: always()
8590
with:
8691
sarif_file: 'trivy-results.sarif'

.golangci.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
run:
22
timeout: 5m
33
tests: true
4-
skip-dirs:
5-
- vendor
6-
- .git
7-
- dist
84

95
linters:
106
enable:
@@ -28,18 +24,16 @@ linters:
2824
- gocognit
2925

3026
disable:
31-
- golint # deprecated
32-
- interfacer # deprecated
33-
- maligned # deprecated
34-
- scopelint # deprecated
27+
- unused # False positives on some fields
3528

3629
linters-settings:
3730
gofmt:
3831
simplify: true
3932
goimports:
4033
local-prefixes: github.com/kevinelliott/agentpipe
4134
govet:
42-
check-shadowing: true
35+
enable:
36+
- shadow
4337
errcheck:
4438
check-type-assertions: true
4539
check-blank: true
@@ -59,6 +53,10 @@ linters-settings:
5953
- G304 # File path provided as taint input
6054

6155
issues:
56+
exclude-dirs:
57+
- vendor
58+
- .git
59+
- dist
6260
exclude-rules:
6361
# Exclude some linters from running on test files
6462
- path: _test\.go

cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func init() {
3131
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.agentpipe.yaml)")
3232
rootCmd.PersistentFlags().Bool("verbose", false, "Enable verbose output")
3333

34-
viper.BindPFlag("verbose", rootCmd.PersistentFlags().Lookup("verbose"))
34+
_ = viper.BindPFlag("verbose", rootCmd.PersistentFlags().Lookup("verbose"))
3535
}
3636

3737
func initConfig() {

cmd/run.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,10 @@ func startConversation(cmd *cobra.Command, cfg *config.Config) error {
171171
}
172172

173173
// Perform health check unless skipped
174-
skipHealthCheck, _ := cmd.Flags().GetBool("skip-health-check")
174+
skipHealthCheck, err := cmd.Flags().GetBool("skip-health-check")
175+
if err != nil {
176+
skipHealthCheck = false
177+
}
175178
if !skipHealthCheck {
176179
if verbose {
177180
fmt.Printf(" Checking health of %s...\n", agentCfg.Name)

pkg/adapters/claude.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func (c *ClaudeAgent) StreamMessage(ctx context.Context, messages []agent.Messag
131131
}
132132

133133
func (c *ClaudeAgent) formatConversation(messages []agent.Message) string {
134-
var parts []string
134+
parts := make([]string, 0, len(messages))
135135

136136
for _, msg := range messages {
137137
timestamp := time.Unix(msg.Timestamp, 0).Format("15:04:05")

pkg/adapters/codex.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ func (c *CodexAgent) StreamMessage(ctx context.Context, messages []agent.Message
171171
}
172172

173173
func (c *CodexAgent) formatConversation(messages []agent.Message) string {
174-
var parts []string
174+
parts := make([]string, 0, len(messages))
175175

176176
for _, msg := range messages {
177177
timestamp := time.Unix(msg.Timestamp, 0).Format("15:04:05")
@@ -201,4 +201,3 @@ func (c *CodexAgent) buildPrompt(conversation string) string {
201201
func init() {
202202
agent.RegisterFactory("codex", NewCodexAgent)
203203
}
204-

pkg/adapters/gemini.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func (g *GeminiAgent) HealthCheck(ctx context.Context) error {
5757
if err := testCmd.Start(); err != nil {
5858
return fmt.Errorf("gemini CLI cannot be executed: %w", err)
5959
}
60-
testCmd.Process.Kill()
60+
_ = testCmd.Process.Kill()
6161
// If we can start it, consider it healthy
6262
return nil
6363
}
@@ -185,7 +185,7 @@ func (g *GeminiAgent) StreamMessage(ctx context.Context, messages []agent.Messag
185185
}
186186

187187
func (g *GeminiAgent) formatConversation(messages []agent.Message) string {
188-
var parts []string
188+
parts := make([]string, 0, len(messages))
189189

190190
for _, msg := range messages {
191191
timestamp := time.Unix(msg.Timestamp, 0).Format("15:04:05")
@@ -218,4 +218,3 @@ func (g *GeminiAgent) buildPrompt(conversation string) string {
218218
func init() {
219219
agent.RegisterFactory("gemini", NewGeminiAgent)
220220
}
221-

pkg/adapters/qwen.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func (q *QwenAgent) HealthCheck(ctx context.Context) error {
5858
if err := testCmd.Start(); err != nil {
5959
return fmt.Errorf("qwen CLI cannot be executed: %w", err)
6060
}
61-
testCmd.Process.Kill()
61+
_ = testCmd.Process.Kill()
6262
// If we can start it, consider it healthy
6363
return nil
6464
}
@@ -127,7 +127,7 @@ func (q *QwenAgent) StreamMessage(ctx context.Context, messages []agent.Message,
127127
}
128128

129129
func (q *QwenAgent) formatConversation(messages []agent.Message) string {
130-
var parts []string
130+
parts := make([]string, 0, len(messages))
131131

132132
for _, msg := range messages {
133133
timestamp := time.Unix(msg.Timestamp, 0).Format("15:04:05")
@@ -157,4 +157,3 @@ func (q *QwenAgent) buildPrompt(conversation string) string {
157157
func init() {
158158
agent.RegisterFactory("qwen", NewQwenAgent)
159159
}
160-

0 commit comments

Comments
 (0)