fix: apply Poetry pin workaround to Azure fork build path#126
Conversation
Co-authored-by: ewega <26189114+ewega@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds the existing “pin Poetry to 2.2.1” Dockerfile workaround to the Azure fork/source build path so gh devlake init on Azure no longer fails during backend image builds due to Poetry 2.3.2 crashing.
Changes:
- Invoke
applyPoetryPinWorkaround(repoRoot)inrunDeployAzure()before the Azure Docker build loop.
cmd/deploy_azure.go
Outdated
| } | ||
| if err := applyPoetryPinWorkaround(repoRoot); err != nil { | ||
| fmt.Printf("\n ⚠️ Could not apply temporary Poetry pin workaround: %v\n", err) | ||
| } else { | ||
| fmt.Printf("\n ⚠️ Applied temporary Poetry pin workaround (poetry==%s) for fork builds\n", poetryWorkaroundVersion) | ||
| } |
There was a problem hiding this comment.
applyPoetryPinWorkaround(repoRoot) runs for any Azure image build, including the auto-detect path where repoRoot can be the user’s local working tree (when --repo-url is not set). This will rewrite backend/Dockerfile in-place and can leave unexpected local modifications. Consider gating the workaround to the temp-clone/fork path (e.g., only when azureRepoURL != ""), or applying it to a copied build context rather than mutating a local repo.
| } | |
| if err := applyPoetryPinWorkaround(repoRoot); err != nil { | |
| fmt.Printf("\n ⚠️ Could not apply temporary Poetry pin workaround: %v\n", err) | |
| } else { | |
| fmt.Printf("\n ⚠️ Applied temporary Poetry pin workaround (poetry==%s) for fork builds\n", poetryWorkaroundVersion) | |
| } | |
| if err := applyPoetryPinWorkaround(repoRoot); err != nil { | |
| fmt.Printf("\n ⚠️ Could not apply temporary Poetry pin workaround: %v\n", err) | |
| } else { | |
| fmt.Printf("\n ⚠️ Applied temporary Poetry pin workaround (poetry==%s) for fork builds\n", poetryWorkaroundVersion) | |
| } | |
| } |
cmd/deploy_azure.go
Outdated
| fmt.Printf("\n ⚠️ Could not apply temporary Poetry pin workaround: %v\n", err) | ||
| } else { | ||
| fmt.Printf("\n ⚠️ Applied temporary Poetry pin workaround (poetry==%s) for fork builds\n", poetryWorkaroundVersion) |
There was a problem hiding this comment.
These warning/status fmt.Printf calls start with a leading \n, which introduces an extra blank line and breaks the “sub-items stay tight under their parent” output pattern used elsewhere in this command (e.g., other indented ⚠️ lines don’t add a preceding blank line). Remove the leading newline and let the surrounding step headers control spacing.
| fmt.Printf("\n ⚠️ Could not apply temporary Poetry pin workaround: %v\n", err) | |
| } else { | |
| fmt.Printf("\n ⚠️ Applied temporary Poetry pin workaround (poetry==%s) for fork builds\n", poetryWorkaroundVersion) | |
| fmt.Printf(" ⚠️ Could not apply temporary Poetry pin workaround: %v\n", err) | |
| } else { | |
| fmt.Printf(" ⚠️ Applied temporary Poetry pin workaround (poetry==%s) for fork builds\n", poetryWorkaroundVersion) |
|
@copilot apply changes based on the comments in this thread |
Co-authored-by: ewega <26189114+ewega@users.noreply.github.com>
Done in c9d4767. Both issues addressed:
|
applyPoetryPinWorkaround(repoRoot)call in Azure deploy fork build pathazureRepoURL != ""(temp-clone path only) to avoid mutating a local working tree\nfrom sub-item warning messages (stay tight under parent per terminal output standards)Original prompt
Can you execute on the above plan please
**Chronological Review:** 1. User submitted a request to create an implementation plan for a failed `gh devlake init` Azure deployment 2. Agent read the pasted error log (630 lines) in chunks to understand the failure 3. Agent dispatched an explore task to understand the Docker build flow in the codebase 4. Agent examined specific files: `deploy_local.go` (Poetry workaround), `deploy_azure.go` (missing workaround) 5. Agent confirmed the root cause: Poetry pin workaround exists for local but not Azure fork builds 6. Agent created the plan file and inserted todos into the SQL database 7. Agent exited plan mode with a summary recommending autopilotIntent Mapping:
gh devlake initfailed when deploying to Azure with fork image sourceTechnical Inventory:
Code Archaeology:
cmd/deploy_azure.go: Azure deployment flow, lines 150-435 examined. Missing Poetry workaround call between lines 188-189.cmd/deploy_local.go: Local deployment flow, lines 345-404 examined. ContainsapplyPoetryPinWorkaround()at line 360,rewritePoetryInstallLine()at line 391, andpoetryWorkaroundVersion = "2.2.1"constant at line 21.internal/docker/build.go: Docker build/push functionsinternal/gitclone/clone.go: Git clone with depth=1Progress Assessment:
Context Validation:
Recent Commands Analysis:
create(plan.md),sql(insert todos),exit_plan_mode(with autopilot recommendation)1. Conversation Overview: - Primary Objectives: User ran `gh devlake init` to deploy to Azure using the fork image source option (cloning `https://github.com/DevExpGBB/incubator-devlake`) and it failed during Docker build. User requested: "I want to create an implementation plan" to fix the failure. - Session Context: Single-phase conversation — user provided error log, agent analyzed the failure, explored the codebase, identified root cause, created plan, and exited plan mode ready for implementation. - User Intent Evolution: Straightforward — diagnose failure → create plan to fix it.-
- gh-devlake: GitHub CLI extension (Go codebase) at
- Poetry 2.3.2: Latest Poetry version that fails to install inside the Docker container (upstream DevLake Dockerfile line 152:
- Poetry 2.2.1: Known working version, already pinned in local deploy workaround
- Azure Container Apps: Target deployment platform; uses ACR for custom-built images
- Docker build flow: Three images built sequentially —
- Image source options:
-
- Purpose: Azure deployment flow for
- Current State: Missing Poetry pin workaround — this is the bug
- Key Code:
- The fix location: Between lines 188 and 189 (after
- Purpose: Local Docker Compose deployment flow
- Current State: Already has the workaround working correctly
- Key Code:
- Both function and constant are in the
- Purpose: Docker CLI wrapper functions
- Key Code:
Technical Foundation:
C:\Users\eldrickt\Projects\gh-devlakefor deploying Apache DevLakeRUN curl -sSL https://install.python-poetry.org | python3 -)devlake-backend,devlake-config-ui,devlake-grafana— backend fails first due to Poetryofficial(Docker Hub, no build),fork(clone + build),custom(pre-built)Codebase Status:
cmd/deploy_azure.go:gh devlake initfindRepoRoot()(line 378) clones repo; lines 205-229 build/push Docker images without workaround;savePartialAzureState()(line 423) writes early checkpoint for cleanupfindRepoRoot()returnsrepoRoot, before the build loop)cmd/deploy_local.go:poetryWorkaroundVersion = "2.2.1"(line 21);applyPoetryPinWorkaround(absDir)called at line 360;rewritePoetryInstallLine()at line 391 replaces the unpinned Poetry install line with a version-pinned onecmdpackage, so already accessible fromdeploy_azure.gointernal/docker/build.go:Build()(line 27),TagAndPush()(line 36), `CheckAv...Created from Copilot CLI via the copilot delegate command.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.