bug: microcks login ignores the --config flag and always modifies default config
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 88/100
Hướng nghiên cứu
Bắt đầu bằng việc đọc login.go quanh các dòng 113-124, nơi lệnh gọi config.DefaultLocalConfigPath() thay vì dùng globalClientOpts.ConfigPath. Hãy so sánh điều đó với cmd.go quanh dòng 63 và với logout, context, start, stop và import, những lệnh đã tuân theo cờ toàn cục. Bản sửa là làm cho login đọc và ghi qua đường dẫn cấu hình được cung cấp; hoàn tất nghĩa là microcks login http://localhost:8080 --config ./test-config.yaml cập nhật tệp đó và để nguyên cấu hình mặc định.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
When authenticating using the microcks login command, the global --config <path> flag is silently ignored. Even when a custom configuration file path is explicitly provided, microcks login continues to read and write authentication tokens, users, and contexts directly to the default path (~/.config/microcks/config).
This breaks multi-profile setups, CI/CD pipeline isolation (where jobs maintain ephemeral configuration files in dedicated directories), and prevents tests from running in isolated temporary directories.
Expected behavior
Passing --config <path> to microcks login should load and persist configuration, user tokens, server definitions, and contexts into the specified path, matching the behavior of microcks logout, microcks context, microcks start, microcks stop, and microcks import.
Actual behavior
microcks login ignores the provided --config argument and writes the login state to ~/.config/microcks/config. The specified custom configuration file remains untouched.
How to Reproduce?
-
Specify a path for an isolated custom configuration file (e.g.,
./test-config.yaml). -
Run the login command with the custom configuration file:
microcks login http://localhost:8080 --config ./test-config.yaml -
Check
./test-config.yamland observe that the file was not created or modified. -
Check
~/.config/microcks/configand observe that the default configuration file was updated with the context and server information.
Microcks version or git rev
1.0.3 / master (commit 5cef506)
Install method (docker-compose, helm chart, operator, docker-desktop extension,...)
Built from source (go build)
Additional information
Root cause
In cmd.go:63, the persistent --config flag is registered and bound to clientOpts.ConfigPath, then passed to NewLoginCommand(&clientOpts):
command.PersistentFlags().StringVar(
&clientOpts.ConfigPath,
"config",
defaultLocalConfigPath,
"Path to Microcks config",
)
command.AddCommand(NewLoginCommand(&clientOpts))
However, in login.go:113-124, the command hardcodes a call to config.DefaultLocalConfigPath() instead of reading globalClientOpts.ConfigPath:
configFile, err := config.DefaultLocalConfigPath()
if err != nil {
return err
}
localConfig, err := config.ReadLocalConfig(configFile)
// ...
if err := config.WriteLocalConfig(*localConfig, configFile); err != nil {
return err
}
Every other command (start, stop, context, logout, import, and service) correctly uses globalClientOpts.ConfigPath.
Changing the hardcoded path assignment to configFile := globalClientOpts.ConfigPath should restore consistency across the CLI and ensure that microcks login respects the global --config flag.
- Ngôn ngữ chính
- Go
- Star
- 59
- Fork
- 74
- Merge trung bình
- 5 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 22
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microcks/microcks-cli
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
microcks/microcks-cli#601 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
microcks/microcks-cli#598 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Wrong link to test resultsCó thể đã có người làm @SajanBisht đã nhận 3 ngày trước. Đang mởcomponent/cli keep-open kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
microcks/microcks-cli#589 · 4 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Default configuration path falls back to the current directory when the home directory cannot be determinedCó thể đã có người làm @Sarthak-Shreshtha01 đã nhận 16 ngày trước. Đang mởcomponent/cli kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
microcks/microcks-cli#583 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug: YAML parse error in config is silently swallowed, login overwrites all other contextsCó thể đã có người làm @Sarthak-Shreshtha01 đã nhận 22 ngày trước. Đang mởcomponent/cli kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
microcks/microcks-cli#572 · 6 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của microcks/microcks-cli
Issue tương tự
-
Project submission: CodeAFĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
slavakurilyak/awesome-ai-agents#888 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement nav-pilot
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
kind/enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 1 ngày
-
feat(gmail): make gmail get --format raw text output the exact message, like drafts get --format rawĐang mởclawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
openclaw/gogcli#1276 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Seed a JRNYAx price before the last close so asset-detail S1.3 doesn't fail from 08:00Z to the openĐang mởbug tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
lognorman20/monaco#7231 ·