diff --git a/docs/src/content/docs/agent-factory-status.mdx b/docs/src/content/docs/agent-factory-status.mdx index cf7f983faba..05bf6c09fde 100644 --- a/docs/src/content/docs/agent-factory-status.mdx +++ b/docs/src/content/docs/agent-factory-status.mdx @@ -238,11 +238,7 @@ These are experimental agentic workflows used by the GitHub Next team to learn, | [Super Linter Report](https://github.com/github/gh-aw/blob/main/.github/workflows/super-linter.md) | copilot | [![Super Linter Report](https://github.com/github/gh-aw/actions/workflows/super-linter.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/super-linter.lock.yml) | `daily around 14:00 on weekdays` | - | | [Team Status](https://github.com/github/gh-aw/blob/main/.github/workflows/daily-team-status.md) | copilot | [![Team Status](https://github.com/github/gh-aw/actions/workflows/daily-team-status.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/daily-team-status.lock.yml) | - | - | | [Terminal Stylist](https://github.com/github/gh-aw/blob/main/.github/workflows/terminal-stylist.md) | copilot | [![Terminal Stylist](https://github.com/github/gh-aw/actions/workflows/terminal-stylist.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/terminal-stylist.lock.yml) | - | - | -| [Test Create PR Error Handling](https://github.com/github/gh-aw/blob/main/.github/workflows/test-create-pr-error-handling.md) | claude | [![Test Create PR Error Handling](https://github.com/github/gh-aw/actions/workflows/test-create-pr-error-handling.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/test-create-pr-error-handling.lock.yml) | - | - | -| [Test Dispatcher Workflow](https://github.com/github/gh-aw/blob/main/.github/workflows/test-dispatcher.md) | copilot | [![Test Dispatcher Workflow](https://github.com/github/gh-aw/actions/workflows/test-dispatcher.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/test-dispatcher.lock.yml) | - | - | -| [Test Project URL Explicit Requirement](https://github.com/github/gh-aw/blob/main/.github/workflows/test-project-url-default.md) | copilot | [![Test Project URL Explicit Requirement](https://github.com/github/gh-aw/actions/workflows/test-project-url-default.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/test-project-url-default.lock.yml) | - | - | | [Test Quality Sentinel](https://github.com/github/gh-aw/blob/main/.github/workflows/test-quality-sentinel.md) | copilot | [![Test Quality Sentinel](https://github.com/github/gh-aw/actions/workflows/test-quality-sentinel.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/test-quality-sentinel.lock.yml) | - | - | -| [Test Workflow](https://github.com/github/gh-aw/blob/main/.github/workflows/test-workflow.md) | copilot | [![Test Workflow](https://github.com/github/gh-aw/actions/workflows/test-workflow.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/test-workflow.lock.yml) | - | - | | [The Daily Repository Chronicle](https://github.com/github/gh-aw/blob/main/.github/workflows/daily-repo-chronicle.md) | copilot | [![The Daily Repository Chronicle](https://github.com/github/gh-aw/actions/workflows/daily-repo-chronicle.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/daily-repo-chronicle.lock.yml) | `daily around 16:00 on weekdays` | - | | [The Great Escapi](https://github.com/github/gh-aw/blob/main/.github/workflows/firewall-escape.md) | copilot | [![The Great Escapi](https://github.com/github/gh-aw/actions/workflows/firewall-escape.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/firewall-escape.lock.yml) | - | - | | [Tidy](https://github.com/github/gh-aw/blob/main/.github/workflows/tidy.md) | copilot | [![Tidy](https://github.com/github/gh-aw/actions/workflows/tidy.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/tidy.lock.yml) | `daily around 7:00` | - | diff --git a/pkg/cli/add_command_test.go b/pkg/cli/add_command_test.go index a8227284e22..a92671e9f00 100644 --- a/pkg/cli/add_command_test.go +++ b/pkg/cli/add_command_test.go @@ -142,18 +142,26 @@ func TestAddWorkflows(t *testing.T) { func TestAddResolvedWorkflows(t *testing.T) { tests := []struct { - name string - expectError bool - errorContains string + name string }{ { - name: "valid workflow", - expectError: true, // Will still error due to missing git repo, but validates basic flow + name: "valid workflow", }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + tmpDir := t.TempDir() + oldWd, err := os.Getwd() + require.NoError(t, err) + require.NoError(t, os.Chdir(tmpDir)) + defer func() { + require.NoError(t, os.Chdir(oldWd)) + }() + gitInit := exec.Command("git", "init") + gitInit.Dir = tmpDir + require.NoError(t, gitInit.Run()) + // Create a minimal resolved workflow structure resolved := &ResolvedWorkflows{ Workflows: []*ResolvedWorkflow{ @@ -170,21 +178,17 @@ func TestAddResolvedWorkflows(t *testing.T) { } opts := AddOptions{} - _, err := AddResolvedWorkflows( + _, err = AddResolvedWorkflows( context.Background(), []string{"test/repo/test-workflow"}, resolved, opts, ) + require.NoError(t, err, "Should not error for test case: %s", tt.name) - if tt.expectError { - require.Error(t, err, "Expected error for test case: %s", tt.name) - if tt.errorContains != "" { - assert.Contains(t, err.Error(), tt.errorContains, "Error should contain expected message") - } - } else { - assert.NoError(t, err, "Should not error for test case: %s", tt.name) - } + workflowPath := filepath.Join(tmpDir, ".github", "workflows", "test-workflow.md") + _, err = os.Stat(workflowPath) + require.NoError(t, err, "workflow should be written to the temporary workflows directory") }) } } diff --git a/pkg/cli/workflows/shared/otlp.md b/pkg/cli/workflows/shared/otlp.md new file mode 100644 index 00000000000..f68eee05a7f --- /dev/null +++ b/pkg/cli/workflows/shared/otlp.md @@ -0,0 +1,26 @@ +--- +network: + allowed: + - "*.sentry.io" + - "*.grafana.net" +observability: + otlp: + endpoint: + - url: ${{ secrets.GH_AW_OTEL_SENTRY_ENDPOINT }} + headers: + Authorization: ${{ secrets.GH_AW_OTEL_SENTRY_AUTHORIZATION }} + - url: ${{ secrets.GH_AW_OTEL_GRAFANA_ENDPOINT }} + headers: + Authorization: ${{ secrets.GH_AW_OTEL_GRAFANA_AUTHORIZATION }} +--- + + diff --git a/.github/workflows/test-create-pr-error-handling.md b/pkg/cli/workflows/test-create-pr-error-handling.md similarity index 100% rename from .github/workflows/test-create-pr-error-handling.md rename to pkg/cli/workflows/test-create-pr-error-handling.md diff --git a/.github/workflows/test-dispatcher.md b/pkg/cli/workflows/test-dispatcher.md similarity index 100% rename from .github/workflows/test-dispatcher.md rename to pkg/cli/workflows/test-dispatcher.md diff --git a/.github/workflows/test-project-url-default.md b/pkg/cli/workflows/test-project-url-default.md similarity index 100% rename from .github/workflows/test-project-url-default.md rename to pkg/cli/workflows/test-project-url-default.md diff --git a/.github/workflows/test-workflow.md b/pkg/cli/workflows/test-workflow.md similarity index 100% rename from .github/workflows/test-workflow.md rename to pkg/cli/workflows/test-workflow.md