feat(apps): add apps:link and apps:unlink commands#141
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds new CLI capabilities to link/unlink an app to the current git repository by deriving provider/owner/repo from the local origin remote, and wires this through new app service endpoints.
Changes:
- Introduce
apps:linkandapps:unlinkcommands (including interactive app selection + confirmation on unlink). - Add
appsService.linkRepository/appsService.unlinkRepositoryand corresponding DTOs. - Add git remote URL parsing utility with test coverage for supported providers.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/git.ts | Implements reading origin remote and parsing provider/owner/repo (+ Azure project) from the URL. |
| src/utils/git.test.ts | Adds unit tests covering several HTTPS/SSH git remote URL formats. |
| src/types/app.ts | Adds DTOs for link/unlink repository operations. |
| src/services/apps.ts | Adds HTTP calls for linking/unlinking repositories on apps. |
| src/index.ts | Registers the new apps:link and apps:unlink commands. |
| src/commands/apps/link.ts | Implements the apps:link CLI command using git remote auto-detection. |
| src/commands/apps/link.test.ts | Adds tests for apps:link including selection flow and API error handling. |
| src/commands/apps/unlink.ts | Implements the apps:unlink CLI command with confirmation prompt. |
| src/commands/apps/unlink.test.ts | Adds tests for apps:unlink including confirmation flow and API error handling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
apps:linkcommand to connect a git repository to an app by auto-detecting the provider, owner, and repository from the local git remote (origin)apps:unlinkcommand to disconnect a git repository from an app with confirmation promptTest plan
npm run test)npm run build)npm run fmt)apps:link --appId <id>in a GitHub repoapps:unlink --appId <id> --yesapps:linkinteractively (no flags)