refactor: consolidate OpenCode auth setup into plugin installation flow#11
Merged
refactor: consolidate OpenCode auth setup into plugin installation flow#11
Conversation
## Analysis Complete ### Key Discovery: Cache Step Is Already Redundant The composite actions (pr-review, issue-label, doc-sync) **already handle OPENCODE_AUTH directly**: The cache restore step in workflow templates is **unnecessary duplication**. The composite actions handle auth from the environment variable directly. --- ### Current Architecture (Problematic) ### New Architecture (Simplified) --- ### Impact Assessment | File | Change Type | Impact | |------|-------------|--------| | src/cli/templates/shared.ts | Remove CACHE_RESTORE_STEP | Minor - unused export | | src/cli/templates/pr-review.ts | Remove cache step import/usage | Minor | | src/cli/templates/issue-label.ts | Remove cache step import/usage | Minor | | src/cli/templates/doc-sync.ts | Remove cache step import/usage | Minor | | src/cli/templates/opencode-auth.ts | Keep for backward compat, add deprecation | Minor | | src/cli/templates/index.ts | No change needed | None | | src/cli/index.ts | Major changes - new prompt flow | Major | | src/cli/installer.ts | Minor - keep backward compat | Minor | | test/installer.test.js | Add tests for new behavior | Medium | | README.md | Update auth section | Medium | -- Attempt: att-773e5866-d6b2-46f4-968c-57d58978d4f7 Profile: apg-70541e2b-d01c-4d50-a814-7025ac222ebe
All tasks completed successfully. Here's the summary: ### Files Modified | File | Change | |------|--------| | src/cli/templates/shared.ts | Removed CACHE_RESTORE_STEP export | | src/cli/templates/pr-review.ts | Removed cache import/usage | | src/cli/templates/issue-label.ts | Removed cache import/usage | | src/cli/templates/doc-sync.ts | Removed cache import/usage | | src/cli/templates/index.ts | Removed opencode-auth from exports and type | | src/cli/installer.ts | Removed opencode-auth from generators | | src/cli/index.ts | Added plugin prompt, updated help text and next steps | | test/installer.test.js | Added 3 new tests for cache-free OAuth workflows | | README.md | Updated auth section to promote plugin | ### Files Deleted - src/cli/templates/opencode-auth.ts - .github/workflows/opencode-auth.yml ### New CLI Flow (OAuth path) ### Verification Attempt: att-773e5866-d6b2-46f4-968c-57d58978d4f7 Profile: apg-70541e2b-d01c-4d50-a814-7025ac222ebe
1. CLI runs bunx @activade/opencode-auth-sync directly (interactive setup) 2. After plugin setup completes, shows simplified next step: "Commit and push the workflow files" Attempt: att-773e5866-d6b2-46f4-968c-57d58978d4f7 Profile: apg-70541e2b-d01c-4d50-a814-7025ac222ebe
Contributor
AI Review SummaryVerdict: REQUEST CHANGES Findings
Overall AssessmentThis PR successfully consolidates OpenCode auth by removing redundant cache steps and promoting the plugin-based workflow. However, there's a critical bug in the error handling logic that will cause the CLI to report success even when errors occur. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
closes #10