Skip to content

Learn GitLab 'Add code' task completion add check

What does this MR do and why?

The "Add code" task in Learn GitLab is to prompt the user to use the built-in editor, WebIDE or upload files to the newly created project repo.

We mark that as success currently base on 2 checks:

  • repository.commit_count > 1: If there is more than one commit in the repo, then we can be sure that commit has a file that was submitted with it or changed by it, else the commit wouldn't be valid.
  • repository.branch_count > 1: More than the default repo exists. This can only exist once we have added a file due to the check here.

However, what this does not cover is the import of a project or the adding of code via a project template, since it imports as well.

This MR adds a check for that scenario.

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

  1. Setup to simulate SaaS and restart GDK
  2. Register as a new user.
  3. On /users/sign_up/welcome, select any 'role' and 'Just me' in the welcome form after sign up step.
  4. Choose 'Create a new project'
  5. Click 'Continue'
  6. Fill out fields to create a group and project on the next page.
  7. Click 'Create project'
  8. Verify you get to the onboarding and page refreshes to provide a "Ok, let's go" button.
  9. Click on "Ok, let's go" and verify you are dropped into the learn gitlab project and the celebrate modal pops up with confetti
  10. Verify that you have a project created with only README.md file in the repo, but the "Add code" task is not completed.
  11. Now create a new project in the group from any built-in template
  12. When the import is complete, verify that "Add code" task is marked as done.

Related to #457801 (closed)

Edited by Roy Liu

Merge request reports