Fix local repo clone permissions and surface provisioning failures in the console#41
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (8)
📝 WalkthroughOverviewThis PR fixes Linux local deployment failures where project repository cloning could fail due to host bind-mount permissions, and updates the console to surface repository provisioning failures with clearer, actionable messaging instead of a misleading “no repo” state. Key ChangesDeployment Infrastructure
Backend Status Handling (BFF)
Console UX
Git Workspace Handling
Testing & Verification
Migration NotesProjects previously stuck in an WalkthroughThis PR addresses repository cloning permission failures on Linux by establishing a complete error visibility and storage initialization system. The backend refactors project status computation to centralize repository state mapping, explicitly handling error states and propagating error messages into a new Sequence DiagramsequenceDiagram
participant API as asdlc-api Container
participant Storage as Host Bind Mount
participant DB as Project Status
participant Console as Console UI
API->>Storage: attempt to create repo directory
Storage-->>API: permission denied (repo clone fails)
API->>DB: set phase=repo-error, RepoErrorMessage=mkdir permission denied
Console->>DB: fetch ProjectStatus
DB-->>Console: phase=repo-error, repoErrorMessage
Console->>Console: render RepoErrorState with error summary
Console-->>API: show actionable error message
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
asdlc-service/services/project_status_test.go (1)
66-81: ⚡ Quick winAdd an assertion for
RepoURLmapping in the table tests.The helper sets
status.RepoURL, but this contract is not validated in the current assertions.Proposed test addition
if c.repo != nil && status.RepoStatus != c.repo.Status { t.Fatalf("repoStatus: got %q want %q", status.RepoStatus, c.repo.Status) } + if c.repo != nil && status.RepoURL != c.repo.RepoURL { + t.Fatalf("repoUrl: got %q want %q", status.RepoURL, c.repo.RepoURL) + } if status.RepoErrorMessage != c.wantErrMsg { t.Fatalf("repoErrorMessage: got %q want %q", status.RepoErrorMessage, c.wantErrMsg) }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@asdlc-service/services/project_status_test.go` around lines 66 - 81, The table test is missing an assertion that applyRepoToProjectStatus sets models.ProjectStatus.RepoURL; update the loop inside Test (where applyRepoToProjectStatus is called) to assert that when c.repo != nil the status.RepoURL equals c.repo.URL (and if your cases define an expected value use c.wantRepoURL instead), e.g. add an if block similar to the RepoStatus check that fails with t.Fatalf("repoURL: got %q want %q", status.RepoURL, c.repo.URL) so the contract of applyRepoToProjectStatus -> ProjectStatus.RepoURL is validated.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@asdlc-service/services/project_status_test.go`:
- Around line 66-81: The table test is missing an assertion that
applyRepoToProjectStatus sets models.ProjectStatus.RepoURL; update the loop
inside Test (where applyRepoToProjectStatus is called) to assert that when
c.repo != nil the status.RepoURL equals c.repo.URL (and if your cases define an
expected value use c.wantRepoURL instead), e.g. add an if block similar to the
RepoStatus check that fails with t.Fatalf("repoURL: got %q want %q",
status.RepoURL, c.repo.URL) so the contract of applyRepoToProjectStatus ->
ProjectStatus.RepoURL is validated.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d5a6d444-9a56-4908-93dc-c59e8887a374
📒 Files selected for processing (11)
.gitignoreasdlc-service/models/project.goasdlc-service/services/project_service.goasdlc-service/services/project_status_test.goconsole/src/pages/ProjectOverviewPage.tsxconsole/src/services/api/types.tsdeployments/data/repos/.gitkeepdeployments/docker-compose.ymldeployments/scripts/start.shdeployments/scripts/teardown.shdeployments/scripts/utils.sh
…file Updated the load_public_urls function to handle cases where the specified environment file does not contain the expected variables. This change prevents the script from aborting due to grep returning a non-zero exit status when no matches are found, ensuring that default values are applied correctly.
Changed the permissions of the kubeconfig file to 644 to allow non-root containers to read it. Additionally, set the task signing key permissions to 644 to ensure proper access. This improves compatibility with non-root user setups in the deployment environment.
…sitory errors - Updated ProjectStatus model to include RepoErrorMessage for better error reporting. - Refactored GetProjectStatus to utilize a new helper function, applyRepoToProjectStatus, for cleaner logic and improved readability. - Added RepoErrorState component in the ProjectOverviewPage to display user-friendly error messages when repository setup fails. - Enhanced the describeRepoError function to provide specific guidance based on different error scenarios. - Updated .gitignore to include new repository storage paths and ensure proper handling of project git clones. - Introduced tests for applyRepoToProjectStatus to validate behavior across various repository states.
03ed1e9 to
daef20b
Compare
Purpose
Fixes #40
On Linux local setups, project creation often failed silently: the BFF could not clone GitHub repos because the bind-mounted repo directory (
~/specs/repos) was created root-owned by Docker whileasdlc-apiruns as uid 1000. The DB recordedgit_repositories.status=error, but the console showed a misleading “No Git repository associated” empty state.Resolves local repo clone permission failures and incorrect project overview UI for failed provisioning.
Goals
docker compose upApproach
Deployments
${HOME}/specs/repostodeployments/data/reposensure_repo_storage()indeployments/scripts/utils.sh(mkdir -p+chmod 1777) and call it fromstart.shbefore compose startsteardown.shto resolve the repo path from theasdlc-apiservice indocker-compose.ymlBFF
repo-errorSDLC phase andrepoErrorMessageonProjectStatusapplyRepoToProjectStatus()soerrorrepo status is distinct from a missing repoConsole
repo-errorwith a SaaS-friendly empty state (no deployment commands or raw backend errors)Git
deployments/data/repos/*(runtime clones); track only.gitkeepUser stories
Release note
Fixed repository clone failures on Linux local deployments caused by bind-mount permissions, and improved the project overview when Git repository provisioning fails.
Documentation
N/A
Training
N/A
Certification
N/A — no certification exam impact.
Marketing
N/A
Automation tests
asdlc-service/services/project_status_test.go—TestApplyRepoToProjectStatuscoversno-repo,repo-cloning,repo-error, andreadycontinuationSecurity checks
Samples
N/A
Related PRs
N/A
Migrations (if applicable)
Local developers only:
cd deployments && bash scripts/start.shdeployments/data/repos/(not~/specs/repos)errorbefore the fix must be deleted and recreatedOptional: migrate existing clones with
cp -a ~/specs/repos/. deployments/data/repos/Tested on Linux (Docker Compose + k3d local setup).
Test environment
asdlc-api), Docker Compose local stackLearning
Root cause was a classic Docker bind-mount ownership mismatch: missing host dirs created as root, container writes as uid 1000. Mac/Colima setups were more forgiving. Fix follows existing patterns in
start.sh(kubeconfig + signing key permission prep) and uses a repo-local path likedeployments/keys/.