docker-agent is primary binary in taskfile#1961
Conversation
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
There was a problem hiding this comment.
Review Summary
Assessment: 🟡 NEEDS ATTENTION
This refactoring correctly renames the primary binary from cagent to docker-agent and introduces a copy mechanism for the deprecated cagent name. However, there is a backward compatibility issue that affects users who rely on the ~/bin/cagent symlink.
Issue Found
1 MEDIUM severity issue confirmed
- The
~/binsymlink is only created fordocker-agent, not for the deprecatedcagentbinary - Users who previously had
~/bin/cagentin their PATH will lose access to the command after rebuilding - While the deprecated binary exists in
BUILD_DIR, it lacks the convenience symlink for backward compatibility
Recommendation
Consider adding a second symlink for the deprecated binary name to maintain full backward compatibility:
- '{{if ne .CI "true"}}ln -sf {{.USER_WORKING_DIR}}/{{.BUILD_DIR}}/{{.DEPRECATED_BINARY_NAME}} {{.HOME}}/bin/{{.DEPRECATED_BINARY_NAME}}{{end}}'| - '{{if ne .CI "true"}}ln -sf {{.USER_WORKING_DIR}}/{{.BUILD_DIR}}/{{.BINARY_NAME}} {{.HOME}}/bin/{{.BINARY_NAME}}{{end}}' | ||
| - go build -ldflags "{{.LDFLAGS}}" -o {{.BUILD_DIR}}/{{.CLI_PLUGIN_BINARY_NAME}} {{.MAIN_PKG}} | ||
| - cp "{{.BUILD_DIR}}/{{.CLI_PLUGIN_BINARY_NAME}}" {{.BUILD_DIR}}/{{.DEPRECATED_BINARY_NAME}} | ||
| - '{{if ne .CI "true"}}ln -sf {{.USER_WORKING_DIR}}/{{.BUILD_DIR}}/{{.CLI_PLUGIN_BINARY_NAME}} {{.HOME}}/bin/{{.CLI_PLUGIN_BINARY_NAME}}{{end}}' |
There was a problem hiding this comment.
MEDIUM: Missing symlink for DEPRECATED_BINARY_NAME breaks backward compatibility
The build task creates a symlink in ~/bin only for docker-agent (CLI_PLUGIN_BINARY_NAME), but not for cagent (DEPRECATED_BINARY_NAME). Users who previously relied on having ~/bin/cagent in their PATH will lose that functionality after this change.
While the deprecated binary copy exists in BUILD_DIR, the missing symlink means users won't have the convenient cagent command available from their PATH.
Suggestion: Add a second symlink for backward compatibility:
- '{{if ne .CI "true"}}ln -sf {{.USER_WORKING_DIR}}/{{.BUILD_DIR}}/{{.DEPRECATED_BINARY_NAME}} {{.HOME}}/bin/{{.DEPRECATED_BINARY_NAME}}{{end}}'There was a problem hiding this comment.
I removed that symlink on purpose, we want users to start using docker-agent instead of cagent (happy to change if anyone else disagree)
No description provided.