[BUZZOK-31816] feat: respect APPLICATION_TEMPLATE_GIT_BASE_URL in dr component commands#722
Conversation
|
@copilot can you move rewriting action in a separate command |
Done. The rewriting logic has been moved to a new |
|
@copilot For any work done in this PR so far, as well as future updates -- make sure to update the command and dev docs. |
…TEMPLATE_GIT_BASE_URL
Done in commit
|
|
@copilot check that value we get from APPLICATION_TEMPLATE_GIT_BASE_URL has no trailing slash, and remove it if it is |
This is already handled — |
All
dr componentsubcommands now replace known DataRobot GitHub base URLs (https://github.com/datarobot-community,https://github.com/datarobot) withAPPLICATION_TEMPLATE_GIT_BASE_URLwhen that env var is set — enabling air-gapped / corporate mirror setups.Changes
Core helpers —
internal/copier/giturl.go(new)ApplyGitBaseURL(url)— rewrites a URL's base prefix if the env var is set; handles both DataRobot GitHub orgs, strips trailing slash, no-ops when unset or prefix unrecognisedRewriteSrcPathIfNeeded(yamlFile)— patches_src_pathin an existing copier answers file in-place; no-op when env var is unset or URL already uses the custom basedr component addApplyGitBaseURLapplied to the resolved repo URL before passing to copier, so newly-added components write the correct_src_pathfrom the startdr component update(CLI + TUI flows)RewriteSrcPathIfNeededcalled before copier update, migrating legacy answers files that still contain old GitHub URLsrunUpdate(non-interactive) path and the TUIupdateComponentpathdr component list(indirect)ComponentDetailsByURLindex ininit()now also registers the remapped URL variant, so component-name resolution continues to work after answers files have been rewritten