Add error handling for workspace project cloning
Issue: BUG: Errors are not properly handled when proje... (#471531 - closed)
What does this MR do and why?
Current logic of project cloning is faulty. If there is some error mid-cloning, the project is not cloned successfully again because we only check for the existence of project folder which will be present.
Ideally, the project should be cloned only if one is not cloned successfully already. This is required to avoid resetting user's modifications to the files. This is achieved by checking for the existence of a file before cloning. If the file does not exist, clone the project. To accommodate for scenarios where the project cloning failed midway in the previous attempt, remove the directory before cloning. Once cloning is successful, create the file which is used in the check above. This will ensure the project is not cloned again on restarts.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Create a workspace. Check the logs of the project cloner container. It should clone the project from scratch.
$ kubectl logs -f workspace-1-1-ornkbn-67c57bd4c-h4kq8 -c gl-cloner-injector-gl-cloner-injector-command-1
Cloning project
Cloning into '/projects/gitlab-shell'...
Project cloning successful
Updated file to indicate successful project cloning
- Restart the workspace. Check the logs of the project cloner container. It should not clone the project.
$ kubectl logs -f workspace-1-1-ornkbn-67c57bd4c-9mx4p -c gl-cloner-injector-gl-cloner-injector-command-1
Project cloning was already successful
Merge request reports
Activity
assigned to @vtak
mentioned in issue #471531 (closed)
added pipelinetier-3 pipeline:run-e2e-omnibus-once labels
changed milestone to %17.4
added Category:Workspaces bugfunctional groupremote development typebug labels
added devopscreate sectiondev labels
- A deleted user
added backend label
1 Warning e806bd54: Commits that change 30 or more lines across at least 3 files should describe these changes in the commit body. For more information, take a look at our Commit message guidelines. 1 Message CHANGELOG missing: If this merge request needs a changelog entry, add the
Changelog
trailer to the commit message you want to add to the changelog.If this merge request doesn't need a CHANGELOG entry, feel free to ignore this message.
Reviewer roulette
Category Reviewer Maintainer backend @ngala
(UTC+5.5, same timezone as author)
@dbalexandre
(UTC+0, 5.5 hours behind author)
Please refer to documentation page for guidance on how you can benefit from the Reviewer Roulette, or use the GitLab Review Workload Dashboard to find other available reviewers.
If needed, you can retry the
danger-review
job that generated this comment.Generated by
Dangeradded 1 commit
- b9106448 - Add error handling for workspace project cloning
added 1 commit
- 9e5a2f71 - Add error handling for workspace project cloning
- Resolved by Chad Woolley
@zhaochen_li - Can you please review this MR?
requested review from @zhaochen_li
E2E Test Result Summary
allure-report-publisher
generated test report!e2e-test-on-gdk:
test report for e806bd54expand test summary
+------------------------------------------------------------------+ | suites summary | +-------------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +-------------+--------+--------+---------+-------+-------+--------+ | Govern | 71 | 0 | 0 | 0 | 71 | ✅ | | Plan | 73 | 0 | 0 | 0 | 73 | ✅ | | Secure | 3 | 0 | 0 | 0 | 3 | ✅ | | Create | 128 | 0 | 15 | 0 | 143 | ✅ | | Verify | 44 | 0 | 2 | 0 | 46 | ✅ | | Data Stores | 31 | 0 | 1 | 0 | 32 | ✅ | | Package | 20 | 0 | 12 | 0 | 32 | ✅ | | Monitor | 8 | 0 | 0 | 0 | 8 | ✅ | | Manage | 1 | 0 | 1 | 0 | 2 | ✅ | | Analytics | 2 | 0 | 0 | 0 | 2 | ✅ | | Fulfillment | 2 | 0 | 0 | 0 | 2 | ✅ | | Release | 5 | 0 | 0 | 0 | 5 | ✅ | +-------------+--------+--------+---------+-------+-------+--------+ | Total | 388 | 0 | 31 | 0 | 419 | ✅ | +-------------+--------+--------+---------+-------+-------+--------+
e2e-package-and-test:
test report for c8fdde4eexpand test summary
+-------------------------------------------------------------+ | suites summary | +--------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +--------+--------+--------+---------+-------+-------+--------+ | Create | 415 | 0 | 51 | 0 | 466 | ✅ | +--------+--------+--------+---------+-------+-------+--------+ | Total | 415 | 0 | 51 | 0 | 466 | ✅ | +--------+--------+--------+---------+-------+-------+--------+
added 923 commits
-
9e5a2f71...dc365c29 - 922 commits from branch
master
- c8fdde4e - Add error handling for workspace project cloning
-
9e5a2f71...dc365c29 - 922 commits from branch
removed pipeline:run-e2e-omnibus-once label
- Resolved by Vishal Tak
- Resolved by Zhaochen Li
added 234 commits
-
c8fdde4e...1198290a - 233 commits from branch
master
- e806bd54 - Add error handling for workspace project cloning
-
c8fdde4e...1198290a - 233 commits from branch
- Resolved by Zhaochen Li
requested review from @cwoolley-gitlab
- Resolved by Zhaochen Li
@cwoolley-gitlab - Adding you as the reviewer since you are already involved in the conversations.
added pipeline:mr-approved label
requested review from @zhaochen_li
started a merge train
added this merge request to the merge train at position 2
mentioned in commit 694a8c28
added workflowstaging-canary label
added workflowcanary label and removed workflowstaging-canary label
added workflowstaging label and removed workflowcanary label
added workflowproduction label and removed workflowstaging label
added releasedcandidate label
added releasedpublished label and removed releasedcandidate label