Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/tasks_to_be_done')
-rw-r--r--app/services/tasks_to_be_done/base_service.rb55
-rw-r--r--app/services/tasks_to_be_done/create_ci_task_service.rb44
-rw-r--r--app/services/tasks_to_be_done/create_code_task_service.rb52
-rw-r--r--app/services/tasks_to_be_done/create_issues_task_service.rb43
4 files changed, 194 insertions, 0 deletions
diff --git a/app/services/tasks_to_be_done/base_service.rb b/app/services/tasks_to_be_done/base_service.rb
new file mode 100644
index 00000000000..a5648ad10c4
--- /dev/null
+++ b/app/services/tasks_to_be_done/base_service.rb
@@ -0,0 +1,55 @@
+# frozen_string_literal: true
+
+module TasksToBeDone
+ class BaseService < ::IssuableBaseService
+ LABEL_PREFIX = 'tasks to be done'
+
+ def initialize(project:, current_user:, assignee_ids: [])
+ params = {
+ assignee_ids: assignee_ids,
+ title: title,
+ description: description,
+ add_labels: label_name
+ }
+ super(project: project, current_user: current_user, params: params)
+ end
+
+ def execute
+ if (issue = existing_task_issue)
+ update_service = Issues::UpdateService.new(project: project, current_user: current_user, params: { add_assignee_ids: params[:assignee_ids] })
+ update_service.execute(issue)
+ else
+ build_service = Issues::BuildService.new(project: project, current_user: current_user, params: params)
+ create(build_service.execute)
+ end
+ end
+
+ private
+
+ def existing_task_issue
+ IssuesFinder.new(
+ current_user,
+ project_id: project.id,
+ state: 'opened',
+ non_archived: true,
+ label_name: label_name
+ ).execute.last
+ end
+
+ def title
+ raise NotImplementedError
+ end
+
+ def description
+ raise NotImplementedError
+ end
+
+ def label_suffix
+ raise NotImplementedError
+ end
+
+ def label_name
+ "#{LABEL_PREFIX}:#{label_suffix}"
+ end
+ end
+end
diff --git a/app/services/tasks_to_be_done/create_ci_task_service.rb b/app/services/tasks_to_be_done/create_ci_task_service.rb
new file mode 100644
index 00000000000..025ca2feb8e
--- /dev/null
+++ b/app/services/tasks_to_be_done/create_ci_task_service.rb
@@ -0,0 +1,44 @@
+# frozen_string_literal: true
+
+module TasksToBeDone
+ class CreateCiTaskService < BaseService
+ protected
+
+ def title
+ 'Set up CI/CD'
+ end
+
+ def description
+ <<~DESCRIPTION
+ GitLab CI/CD is a tool built into GitLab for software development through the [continuous methodologies](https://docs.gitlab.com/ee/ci/introduction/index.html#introduction-to-cicd-methodologies):
+
+ * Continuous Integration (CI)
+ * Continuous Delivery (CD)
+ * Continuous Deployment (CD)
+
+ Continuous Integration works by pushing small changes to your application’s codebase hosted in a Git repository, and, to every push, run a pipeline of scripts to build, test, and validate the code changes before merging them into the main branch.
+
+ Continuous Delivery and Deployment consist of a step further CI, deploying your application to production at every push to the default branch of the repository.
+
+ These methodologies allow you to catch bugs and errors early in the development cycle, ensuring that all the code deployed to production complies with the code standards you established for your app.
+
+ * :book: [Read the documentation](https://docs.gitlab.com/ee/ci/introduction/index.html)
+ * :clapper: [Watch a Demo](https://www.youtube.com/watch?v=1iXFbchozdY)
+
+ ## Next steps
+
+ * [ ] To start we recommend reviewing the following documentation:
+ * [ ] [How GitLab CI/CD works.](https://docs.gitlab.com/ee/ci/introduction/index.html#how-gitlab-cicd-works)
+ * [ ] [Fundamental pipeline architectures.](https://docs.gitlab.com/ee/ci/pipelines/pipeline_architectures.html)
+ * [ ] [GitLab CI/CD basic workflow.](https://docs.gitlab.com/ee/ci/introduction/index.html#basic-cicd-workflow)
+ * [ ] [Step-by-step guide for writing .gitlab-ci.yml for the first time.](https://docs.gitlab.com/ee/user/project/pages/getting_started_part_four.html)
+ * [ ] When you're ready select **Projects** (in the top navigation bar) > **Your projects** > select the Project you've already created.
+ * [ ] Select **CI / CD** in the left navigation to start setting up CI / CD in your project.
+ DESCRIPTION
+ end
+
+ def label_suffix
+ 'ci'
+ end
+ end
+end
diff --git a/app/services/tasks_to_be_done/create_code_task_service.rb b/app/services/tasks_to_be_done/create_code_task_service.rb
new file mode 100644
index 00000000000..dc3b9366a66
--- /dev/null
+++ b/app/services/tasks_to_be_done/create_code_task_service.rb
@@ -0,0 +1,52 @@
+# frozen_string_literal: true
+
+module TasksToBeDone
+ class CreateCodeTaskService < BaseService
+ protected
+
+ def title
+ 'Create or import your code into your Project (Repository)'
+ end
+
+ def description
+ <<~DESCRIPTION
+ You've already created your Group and Project within GitLab; we'll quickly review this hierarchy below. Once you're within your project you can easily create or import repositories.
+
+ **With GitLab Groups, you can:**
+
+ * Create one or multiple Projects for hosting your codebase (repositories).
+ * Assemble related projects together.
+ * Grant members access to several projects at once.
+
+ Groups can also be nested in subgroups.
+
+ Read more about groups in our [documentation](https://docs.gitlab.com/ee/user/group/).
+
+ **Within GitLab Projects, you can**
+
+ * Use it as an issue tracker.
+ * Collaborate on code.
+ * Continuously build, test, and deploy your app with built-in GitLab CI/CD.
+
+ You can also import an existing repository by providing the Git URL.
+
+ * :book: [Read the documentation](https://docs.gitlab.com/ee/user/project/index.html).
+
+ ## Next steps
+
+ Create or import your first repository into the project you created:
+
+ * [ ] Click **Projects** in the top navigation bar, then click **Your projects**.
+ * [ ] Select the Project that you created, then select **Repository**.
+ * [ ] Once on the Repository page you can select the **+** icon to add or import files.
+ * [ ] You can review our full documentation on creating [repositories](https://docs.gitlab.com/ee/user/project/repository/) in GitLab.
+
+ :tada: All done, you can close this issue!
+ DESCRIPTION
+ end
+
+ def label_suffix
+ 'code'
+ end
+ end
+end
diff --git a/app/services/tasks_to_be_done/create_issues_task_service.rb b/app/services/tasks_to_be_done/create_issues_task_service.rb
new file mode 100644
index 00000000000..a2de6852868
--- /dev/null
+++ b/app/services/tasks_to_be_done/create_issues_task_service.rb
@@ -0,0 +1,43 @@
+# frozen_string_literal: true
+
+module TasksToBeDone
+ class CreateIssuesTaskService < BaseService
+ protected
+
+ def title
+ 'Create/import issues (tickets) to collaborate on ideas and plan work'
+ end
+
+ def description
+ <<~DESCRIPTION
+ Issues allow you and your team to discuss proposals before, and during, their implementation. They can be used for a variety of other purposes, customized to your needs and workflow.
+
+ Issues are always associated with a specific project. If you have multiple projects in a group, you can view all the issues at the group level. [You can review our full Issue documentation here.](https://docs.gitlab.com/ee/user/project/issues/)
+
+ If you have existing issues or equivalent tickets you can import them as long as they are formatted as a CSV file, [the import process is covered here](https://docs.gitlab.com/ee/user/project/issues/csv_import.html).
+
+ **Common use cases include:**
+
+ * Discussing the implementation of a new idea
+ * Tracking tasks and work status
+ * Accepting feature proposals, questions, support requests, or bug reports
+ * Elaborating on new code implementations
+
+ ## Next steps
+
+ * [ ] Select **Projects** in the top navigation > **Your Projects** > select the Project you've already created.
+ * [ ] Once you've selected that project, you can select **Issues** in the left navigation, then click **New issue**.
+ * [ ] Fill in the title and description in the **New issue** page.
+ * [ ] Click on **Create issue**.
+
+ Pro tip: When you're in a group or project you can always utilize the **+** icon in the top navigation (located to the left of the search bar) to quickly create new issues.
+
+ That's it! You can close this issue.
+ DESCRIPTION
+ end
+
+ def label_suffix
+ 'issues'
+ end
+ end
+end