-
-
Notifications
You must be signed in to change notification settings - Fork 2
Add multi-instance support with --rid flag for managing multiple Redmine servers #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
Co-authored-by: MrJeffLarry <369605+MrJeffLarry@users.noreply.github.com>
Co-authored-by: MrJeffLarry <369605+MrJeffLarry@users.noreply.github.com>
Co-authored-by: MrJeffLarry <369605+MrJeffLarry@users.noreply.github.com>
Co-authored-by: MrJeffLarry <369605+MrJeffLarry@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add multi-instance support for redmine-cli
Add multi-instance support with --rid flag for managing multiple Redmine servers
Dec 12, 2025
…update config structure to version 2.0
- Updated loginApiKey and loginPassword functions to use server name instead of ID. - Enhanced loginPassword to allow retrying on failed login attempts. - Modified logout functionality to remove the current server instead of clearing all. - Refactored CLI command initialization to support multiple server configurations. - Adjusted issue creation and listing to reference the current server configuration. - Improved issue viewing to utilize the correct server URL. - Updated project helper functions to reflect changes in server configuration. - Revised configuration structure to support multiple servers and improved local/global config handling. - Added methods for adding, removing, and setting default servers in the configuration. - Enhanced tests to validate multi-instance setup and configuration integrity.
…ervers - Implemented `cmdAuthList` to display a list of authenticated Redmine servers. - Implemented `cmdAuthSwitch` to switch the current authenticated server by name. - Updated `auth.go` to include new commands in the authentication command group. fix(config): replace deprecated homedir package with os.UserHomeDir - Updated `config.go` to use `os.UserHomeDir()` instead of `github.com/mitchellh/go-homedir`. - Added `GetServers` method to retrieve the list of authenticated servers. test(config): add unit tests for configuration file operations - Created `config_fileio_test.go` to test temporary file creation and error handling. - Enhanced existing tests in `config_test.go` to cover new functionality and edge cases.
…onfiguration tests
…or cross-platform compatibility
…settings and improve error handling
…HOME environment variable across different OS
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.
Enables simultaneous management of multiple Redmine servers. Users can now login to different instances and switch between them using
--rid <instance-id>without repeated authentication.Changes
Configuration
MultiInstanceConfig_twith instance map and default instance trackingCLI
--ridpersistent flag to all commandsPersistentPreRunEbefore command execution--riduse default, with--ridtarget specified instanceAuthentication
auth login --rid <id>: stores credentials for specific instanceauth logout --rid <id>: removes only specified instance credentialsTesting
Usage
Config Format
{ "instances": { "prod": { "server": "https://prod.redmine.example.com", "api-key": "...", "user-id": 1, "project-id": 23 }, "staging": { "server": "https://staging.redmine.example.com", "api-key": "...", "user-id": 5, "project-id": 42 } }, "default-instance": "prod" }Documentation
Original prompt
This pull request was created as a result of the following prompt from Copilot chat.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.