feat: automate issue creation#53
Conversation
There was a problem hiding this comment.
Pull request overview
This PR shifts Bauer from “run Copilot locally / create PR” toward an automated parse → push parse JSON to a branch → create a GitHub issue workflow, with a --parse-only mode to skip GitHub operations.
Changes:
- Removes the prior dry-run/Copilot CLI execution path and introduces parse-first workflow behavior (parse-only vs parse-and-issue).
- Adds GitHub automation helpers (commit specific files, push branch, create issues via
gh, remote PR helper). - Updates prompt/description generation and README/docs to reflect the new execution modes and GH CLI auth.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates CLI usage, flags table, and documents parse-only vs parse-and-issue + GH auth. |
| internal/workflow/workflow.go | Reworks workflow to always parse first, then (optionally) push JSON to a branch and create an issue. |
| internal/workflow/api.go | Updates API request/validation and response messaging for parse-only vs parse-and-issue. |
| internal/prompt/README.md | Updates prompt docs to note shared issue/PR description usage. |
| internal/prompt/pr_description.go | Adds embedded PR/issue description rendering + JSON chunking helpers. |
| internal/prompt/pr_description_test.go | Adds tests asserting template references in generated PR description. |
| internal/orchestrator/orchestrator.go | Removes Copilot execution; keeps extraction/prompt generation pipeline with parse-only behavior. |
| internal/github/repo.go | Adds CommitFiles and GetHeadCommitSHA helpers used by the workflow. |
| internal/github/remote_pr.go | Adds remote branch/file/PR creation helper via gh api (no local clone). |
| internal/github/issue.go | Adds issue creation + comment helpers via gh issue. |
| internal/copilotcli/client.go | Deletes Copilot SDK client implementation (no longer used). |
| internal/config/config.go | Removes DryRun/Model fields; config now centers on parse-only + prompt generation inputs. |
| internal/config/cli.go | Removes dry-run/model flags; introduces/renames parse-only flag. |
| cmd/bauer/main.go | Updates CLI flags/output to support issue creation instead of PR creation. |
| cmd/app/types/config.go | Removes model fields from app API config. |
Comments suppressed due to low confidence (1)
cmd/app/types/config.go:20
APIConfigremovedModel/SummaryModel, but the v1 API handler still referencesrc.APIConfig.Model/SummaryModelwhen building aconfig.Config(seecmd/app/v1/api.go). This will not compile until that code path is updated.
type APIConfig struct {
// CredentialsPath is the path to the Google Cloud service account JSON key file.
CredentialsPath string
// OutputDir is the directory where generated prompt files will be saved.
// Default is "bauer-output" if not specified.
BaseOutputDir string
// TargetRepo is the path (relative or absolute) to the target repository
// where tasks should be executed. If not specified, uses the current directory.
TargetRepo string `json:"target_repo"`
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I ran it on Copy of canonical.com/ceph/support and there was a lot of noise for areas that don't have suggestions in the |
|
|
I ran on doc The issues created/jsons look the same: My issue & your issue But our PRs were drastically different, with the description of mine halucinating changes that weren't suggested or made: My PR & your PR (yours also added a test that isn't needed) |
Looking at the CLI logs, it seems like you did not pass the tab ID for the doc. This is the new copy doc 2.0 template so so we would have to pass in the tab ID for the page as well. If no tab ID is passed, it will pick up changes from the other instruction pages. Can you try running it again with the tab ID? |
Can you clarify what you mean by custom agent? The instructions are embedded in the prompt engine, so the engine carries the MD instruction files inside the binary executable.
No, it will be an API service. We will pass in the values from the API call. For example, Jira webhook will call the endpoint with doc ID credentials, repository URL and so on.
I was thinking of creating a workflow to delete the branches once it's merged
Ideally, we would only have one request at a time for the copy doc. With the current workflow logic, it will create a new branch with a duplication of unresolved suggestions. Whichever ticket runs Bauer, it will implement all unresolved suggestions on a copy doc. To reduce duplication, maybe this could be something that can be discussed with the BAU panel/PMs. Wdyt?
Good call, will do! |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
cmd/bauer/main.go:51
- In
--parse-onlymode,--github-repois allowed, but this code still attempts to fetch a GitHub token and can emit a misleading warning even though GitHub auth isn't required. Gate token retrieval on!parseOnlyto match the advertised parse-only behavior.
if *githubRepo != "" {
var err error
ghToken, err = github.GetGitHubToken()
if err != nil {
fmt.Fprintf(os.Stderr, "WARNING: Could not get GitHub token: %v\n", err)
}
}
| ./bauer --doc-id <doc-id> \ | ||
| --credentials <path-to-creds> \ | ||
| --parse-only | ||
| --credentials <path-to-creds> | ||
| --github-repo <github-repo> | ||
| ``` |
| --credentials <path-to-creds> | ||
| --github-repo <github-repo> | ||
| ``` | ||
| Additionally, you can run it with `--parse-only` without creeting an issue. |
| repoPromptDir := filepath.Base(filepath.Clean(input.OutputDir)) | ||
| if repoPromptDir == "." { | ||
| repoPromptDir = "" | ||
| } |
| 1. Build Bauer locally using the Local development steps above (`task build`) | ||
| 2. If running with GitHub integration (no `--parse-only`), ensure `copilot` is installed and authenticated | ||
| 2. If running with GitHub issue creation (no `--parse-only`), ensure GitHub CLI auth is available |
Done
dryRunflag and deprecated Copilot CLI checkparseOnlyflag that creates a parser without creating issueQA
task build--parse-onlyflag)bauer-parse-output.jsonIssue / Card
Fixes WD-34220 and WD-37091
Screenshots
[If relevant, please include a screenshot.]