From 61319d537156144c462146ad115c824b4492fd0a Mon Sep 17 00:00:00 2001 From: j-dunham Date: Tue, 16 Aug 2022 13:28:57 -0400 Subject: [PATCH 01/10] Create valet-migrate-lab.md --- gitlab/valet-migrate-lab.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 gitlab/valet-migrate-lab.md diff --git a/gitlab/valet-migrate-lab.md b/gitlab/valet-migrate-lab.md new file mode 100644 index 0000000..429b1fa --- /dev/null +++ b/gitlab/valet-migrate-lab.md @@ -0,0 +1,36 @@ +# Migrate an Azure DevOps pipeline to GitHub Actions +In this lab, you will use the Valet `migrate` command to migrate a GitLab pipeline to GitHub Actions. +All of the previous commands we have been using, such as `audit` and `dry-run` have be preparing us to run the `migrate` command. +The `migrate` command is what will generate the GitHub Actions workflow files like the `dry-run` and then create a pull request with the files. +The pull request will also contain `Manual Tasks` if required. These task are manual steps that Valet could not do on your behalf, like creating a runner or adding a secret. + +- [Prerequisites](#prerequisites) +- [Preparing for migration](#preparing-for-migration) +- [Perform a migration](#perform-a-migration) +- [View the pull request](#view-the-pull-request) +- [Next Lab](#next-lab) + +## Prerequisites +1. Followed [steps](../gitlab#readme) to set up your codespace environment. +2. Completed the [configure lab](../gitlab/valet-configure-lab.md) + +## Preparing for migration +Before running the command we need to collect some information: + 1. What is the project we want to migrate? TBD + 2. What is the namespace for that project? __Valet. In this case the namespace is the same as the group the project is in__ + 3. What is the GitHub Repository we want to add the workflow too? TBD + +## Perform a migration +1. Run `migrate` command using the information collected above +``` +gh valet migrate gitlab --target-url https://github.com/GITHUB-ORG/GITHUB-REPO --output-dir migrate --namespace valet --project TBD +``` +2. Valet will create a pull request directly to your GitHub repository. +3. Open the pull request by clicking the green pull request link in the output of the migrate command. See below. +ADD_SCREENSHOT_HERE + +## Review the pull request +TBD + +### Next Lab +TBD From c14bef3c4a145cf7040a58a88f00801542013d5d Mon Sep 17 00:00:00 2001 From: j-dunham Date: Tue, 16 Aug 2022 15:05:30 -0400 Subject: [PATCH 02/10] Update valet-migrate-lab.md --- gitlab/valet-migrate-lab.md | 44 +++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/gitlab/valet-migrate-lab.md b/gitlab/valet-migrate-lab.md index 429b1fa..fc82e2d 100644 --- a/gitlab/valet-migrate-lab.md +++ b/gitlab/valet-migrate-lab.md @@ -1,13 +1,13 @@ # Migrate an Azure DevOps pipeline to GitHub Actions -In this lab, you will use the Valet `migrate` command to migrate a GitLab pipeline to GitHub Actions. -All of the previous commands we have been using, such as `audit` and `dry-run` have be preparing us to run the `migrate` command. -The `migrate` command is what will generate the GitHub Actions workflow files like the `dry-run` and then create a pull request with the files. -The pull request will also contain `Manual Tasks` if required. These task are manual steps that Valet could not do on your behalf, like creating a runner or adding a secret. +In this lab, we will use the Valet `migrate` command to migrate a GitLab pipeline to GitHub Actions. +All of the previous commands we have been using, such as `audit` and `dry-run` have been preparing us to run the `migrate` command. +The `migrate` command is what will generate the GitHub Actions workflow files, like the `dry-run`, and create a pull request with the files. +The pull request will also contain a checklist of `Manual Tasks` if required. These tasks are changes that Valet could not do on our behalf, like creating a runner or adding a secret to a repository. - [Prerequisites](#prerequisites) - [Preparing for migration](#preparing-for-migration) -- [Perform a migration](#perform-a-migration) -- [View the pull request](#view-the-pull-request) +- [Performing the migration](#performing-a-migration) +- [Reviewing the pull request](#reviewing-the-pull-request) - [Next Lab](#next-lab) ## Prerequisites @@ -18,19 +18,25 @@ The pull request will also contain `Manual Tasks` if required. These task are ma Before running the command we need to collect some information: 1. What is the project we want to migrate? TBD 2. What is the namespace for that project? __Valet. In this case the namespace is the same as the group the project is in__ - 3. What is the GitHub Repository we want to add the workflow too? TBD - -## Perform a migration -1. Run `migrate` command using the information collected above -``` -gh valet migrate gitlab --target-url https://github.com/GITHUB-ORG/GITHUB-REPO --output-dir migrate --namespace valet --project TBD -``` -2. Valet will create a pull request directly to your GitHub repository. -3. Open the pull request by clicking the green pull request link in the output of the migrate command. See below. -ADD_SCREENSHOT_HERE + 3. Where do we want to store the logs? __./tmp/migrate__. + 4. What is the URL for GitHub Repository we want to add the workflow too? __We can use this repo__. *When constructing the value for the migrate command it should match the the url https://github.com/GITHUB-ORG-USERNAME-HERE/GITHUB-REPO-NAME-HERE with `GITHUB-ORG-USERNAME` and `GITHUB-REPO-NAME` substitued with your values* -## Review the pull request -TBD +## Performing a migration +1. Run `migrate` command using the information collected above, make sure to update the `--target-url` value with the information from step 4 above +``` +gh valet migrate gitlab --target-url https://github.com/GITHUB-ORG-USERNAME-HERE/GITHUB-REPO-NAME-HERE --output-dir ./tmp/migrate --namespace valet --project rails-example +``` +2. Valet will create a pull request directly in the target GitHub repository. +3. Open the pull request by clicking the green pull request link in the output of the migrate command. See below. + ![pr-screen-shot](https://user-images.githubusercontent.com/18723510/184953133-9bafd9a1-c3f0-40b3-8414-f23cea698c8e.png) + +## Reviewing the pull request +- Lets first look at the `Conversation` tab of the PR. Its telling us we have a manual task to perform before the GitHub Actions workflow is functional. We need to a secret. We can use the GitHub [documentation](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) for secrets and add a `actions` secret for `PASSWORD` with any value. + +- Next, lets review the workflow we are adding by clicking on `Files changed` tab. This is where you would double check everything looks good. +- Now we want to go back to the `Conversation` tab and click `Merge pull request` +- Once the PR is merged the new workflow should start and we can view this by clicking `Actions` in the top navigation + actions-screen-shot ### Next Lab -TBD +[Forecast GitLab Usage](../gitlab/valet-forecast-lab.md) From 6a36573eae023ad57d2dcbf6f35bc47fe8ded229 Mon Sep 17 00:00:00 2001 From: j-dunham Date: Tue, 16 Aug 2022 16:11:42 -0400 Subject: [PATCH 03/10] Update valet-migrate-lab.md --- gitlab/valet-migrate-lab.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gitlab/valet-migrate-lab.md b/gitlab/valet-migrate-lab.md index fc82e2d..a8336b4 100644 --- a/gitlab/valet-migrate-lab.md +++ b/gitlab/valet-migrate-lab.md @@ -1,7 +1,7 @@ # Migrate an Azure DevOps pipeline to GitHub Actions In this lab, we will use the Valet `migrate` command to migrate a GitLab pipeline to GitHub Actions. -All of the previous commands we have been using, such as `audit` and `dry-run` have been preparing us to run the `migrate` command. -The `migrate` command is what will generate the GitHub Actions workflow files, like the `dry-run`, and create a pull request with the files. +All of the previous commands we have been using in the labs, such as `audit` and `dry-run` have been preparing us to run a migration. +The `migrate` command will generate the GitHub Actions workflow files, like the `dry-run` did, and also create a pull request with the files. The pull request will also contain a checklist of `Manual Tasks` if required. These tasks are changes that Valet could not do on our behalf, like creating a runner or adding a secret to a repository. - [Prerequisites](#prerequisites) @@ -16,26 +16,26 @@ The pull request will also contain a checklist of `Manual Tasks` if required. Th ## Preparing for migration Before running the command we need to collect some information: - 1. What is the project we want to migrate? TBD + 1. What is the project we want to migrate? __rails-example__ 2. What is the namespace for that project? __Valet. In this case the namespace is the same as the group the project is in__ 3. Where do we want to store the logs? __./tmp/migrate__. - 4. What is the URL for GitHub Repository we want to add the workflow too? __We can use this repo__. *When constructing the value for the migrate command it should match the the url https://github.com/GITHUB-ORG-USERNAME-HERE/GITHUB-REPO-NAME-HERE with `GITHUB-ORG-USERNAME` and `GITHUB-REPO-NAME` substitued with your values* + 4. What is the URL for GitHub repository we want to add the workflow too? __this repo!__. *When constructing the value for the migrate command it should match this url https://github.com/GITHUB-ORG-USERNAME-HERE/GITHUB-REPO-NAME-HERE with `GITHUB-ORG-USERNAME` and `GITHUB-REPO-NAME` substitued with your values* ## Performing a migration -1. Run `migrate` command using the information collected above, make sure to update the `--target-url` value with the information from step 4 above +1. Run `migrate` command using the information collected above, make sure to update the `--target-url` value with the information from step 4. ``` gh valet migrate gitlab --target-url https://github.com/GITHUB-ORG-USERNAME-HERE/GITHUB-REPO-NAME-HERE --output-dir ./tmp/migrate --namespace valet --project rails-example ``` 2. Valet will create a pull request directly in the target GitHub repository. -3. Open the pull request by clicking the green pull request link in the output of the migrate command. See below. +3. Open the pull request by clicking the green pull request link in the output of the migrate command, if you have trouble clicking it you can always copy and paste the url in your browser. ![pr-screen-shot](https://user-images.githubusercontent.com/18723510/184953133-9bafd9a1-c3f0-40b3-8414-f23cea698c8e.png) ## Reviewing the pull request -- Lets first look at the `Conversation` tab of the PR. Its telling us we have a manual task to perform before the GitHub Actions workflow is functional. We need to a secret. We can use the GitHub [documentation](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) for secrets and add a `actions` secret for `PASSWORD` with any value. +- Lets first look at the `Conversation` tab of the PR. It tells us we have a manual task to perform before the GitHub Actions workflow is functional. We need to a secret. We can use the GitHub [documentation](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) for secrets and add a `actions` secret for `PASSWORD` with any value. - Next, lets review the workflow we are adding by clicking on `Files changed` tab. This is where you would double check everything looks good. -- Now we want to go back to the `Conversation` tab and click `Merge pull request` -- Once the PR is merged the new workflow should start and we can view this by clicking `Actions` in the top navigation +- Now our review is completed we want to go back to the `Conversation` tab and click `Merge pull request` +- Once the PR is merged the new workflow should start and we can view it by clicking `Actions` in the top navigation actions-screen-shot ### Next Lab From d95798b8ea070354a20187907d49d8e41f715c1e Mon Sep 17 00:00:00 2001 From: j-dunham Date: Tue, 16 Aug 2022 16:14:46 -0400 Subject: [PATCH 04/10] Update valet-migrate-lab.md --- gitlab/valet-migrate-lab.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitlab/valet-migrate-lab.md b/gitlab/valet-migrate-lab.md index a8336b4..a3974de 100644 --- a/gitlab/valet-migrate-lab.md +++ b/gitlab/valet-migrate-lab.md @@ -1,4 +1,4 @@ -# Migrate an Azure DevOps pipeline to GitHub Actions +# Migrate an GitLab Project to GitHub Actions In this lab, we will use the Valet `migrate` command to migrate a GitLab pipeline to GitHub Actions. All of the previous commands we have been using in the labs, such as `audit` and `dry-run` have been preparing us to run a migration. The `migrate` command will generate the GitHub Actions workflow files, like the `dry-run` did, and also create a pull request with the files. From a725818f1f34b41a79a5a16c92d4decebb753dbb Mon Sep 17 00:00:00 2001 From: j-dunham Date: Wed, 17 Aug 2022 10:04:36 -0400 Subject: [PATCH 05/10] Update valet-migrate-lab.md --- gitlab/valet-migrate-lab.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gitlab/valet-migrate-lab.md b/gitlab/valet-migrate-lab.md index a3974de..fec751c 100644 --- a/gitlab/valet-migrate-lab.md +++ b/gitlab/valet-migrate-lab.md @@ -1,7 +1,7 @@ # Migrate an GitLab Project to GitHub Actions In this lab, we will use the Valet `migrate` command to migrate a GitLab pipeline to GitHub Actions. All of the previous commands we have been using in the labs, such as `audit` and `dry-run` have been preparing us to run a migration. -The `migrate` command will generate the GitHub Actions workflow files, like the `dry-run` did, and also create a pull request with the files. +The `migrate` command will generate the GitHub Actions workflow files, like the `dry-run` did, and additionally create a pull request with the files. The pull request will also contain a checklist of `Manual Tasks` if required. These tasks are changes that Valet could not do on our behalf, like creating a runner or adding a secret to a repository. - [Prerequisites](#prerequisites) @@ -19,7 +19,7 @@ Before running the command we need to collect some information: 1. What is the project we want to migrate? __rails-example__ 2. What is the namespace for that project? __Valet. In this case the namespace is the same as the group the project is in__ 3. Where do we want to store the logs? __./tmp/migrate__. - 4. What is the URL for GitHub repository we want to add the workflow too? __this repo!__. *When constructing the value for the migrate command it should match this url https://github.com/GITHUB-ORG-USERNAME-HERE/GITHUB-REPO-NAME-HERE with `GITHUB-ORG-USERNAME` and `GITHUB-REPO-NAME` substitued with your values* + 4. What is the URL for the GitHub repository we want to add the workflow too? __this repo!__. *When constructing the value for the migrate command it should match this url https://github.com/GITHUB-ORG-USERNAME-HERE/GITHUB-REPO-NAME-HERE with `GITHUB-ORG-USERNAME` and `GITHUB-REPO-NAME` substitued with your values* ## Performing a migration 1. Run `migrate` command using the information collected above, make sure to update the `--target-url` value with the information from step 4. @@ -31,12 +31,13 @@ gh valet migrate gitlab --target-url https://github.com/GITHUB-ORG-USERNAME-HERE ![pr-screen-shot](https://user-images.githubusercontent.com/18723510/184953133-9bafd9a1-c3f0-40b3-8414-f23cea698c8e.png) ## Reviewing the pull request -- Lets first look at the `Conversation` tab of the PR. It tells us we have a manual task to perform before the GitHub Actions workflow is functional. We need to a secret. We can use the GitHub [documentation](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) for secrets and add a `actions` secret for `PASSWORD` with any value. +- Lets first look at the `Conversation` tab of the PR. It tells us we have a manual task to perform before the GitHub Actions workflow is functional. We need to add a secret. We can use the GitHub [documentation](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) for secrets and add a `actions` secret for `PASSWORD` with any value. -- Next, lets review the workflow we are adding by clicking on `Files changed` tab. This is where you would double check everything looks good. +- Next, lets review the workflow we are adding by clicking on `Files changed` tab. This is where you would double check everything looks good. If it didn't you could push commits with the required changes, prior to merging. - Now our review is completed we want to go back to the `Conversation` tab and click `Merge pull request` - Once the PR is merged the new workflow should start and we can view it by clicking `Actions` in the top navigation actions-screen-shot +- The migration is complete and we have success transformed a pipeline in GitLab, transformed into a GitHub Actions workflow, added to a GitHub Repository, and run in Actions ### Next Lab [Forecast GitLab Usage](../gitlab/valet-forecast-lab.md) From d994fc95043af1f08ad2cb06432943621a8f25a8 Mon Sep 17 00:00:00 2001 From: j-dunham Date: Wed, 17 Aug 2022 12:36:27 -0400 Subject: [PATCH 06/10] Update gitlab/valet-migrate-lab.md Co-authored-by: Begona Guereca --- gitlab/valet-migrate-lab.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitlab/valet-migrate-lab.md b/gitlab/valet-migrate-lab.md index fec751c..6f1db42 100644 --- a/gitlab/valet-migrate-lab.md +++ b/gitlab/valet-migrate-lab.md @@ -1,6 +1,6 @@ # Migrate an GitLab Project to GitHub Actions In this lab, we will use the Valet `migrate` command to migrate a GitLab pipeline to GitHub Actions. -All of the previous commands we have been using in the labs, such as `audit` and `dry-run` have been preparing us to run a migration. +The previous commands used in the labs, such as `audit` and `dry-run` have prepared us to run a migration. The `migrate` command will generate the GitHub Actions workflow files, like the `dry-run` did, and additionally create a pull request with the files. The pull request will also contain a checklist of `Manual Tasks` if required. These tasks are changes that Valet could not do on our behalf, like creating a runner or adding a secret to a repository. From db0d5673c1a4e26a6f239583e969bf21123b7a48 Mon Sep 17 00:00:00 2001 From: j-dunham Date: Wed, 17 Aug 2022 12:37:09 -0400 Subject: [PATCH 07/10] Update gitlab/valet-migrate-lab.md Co-authored-by: Begona Guereca --- gitlab/valet-migrate-lab.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitlab/valet-migrate-lab.md b/gitlab/valet-migrate-lab.md index 6f1db42..1116f6a 100644 --- a/gitlab/valet-migrate-lab.md +++ b/gitlab/valet-migrate-lab.md @@ -1,7 +1,7 @@ # Migrate an GitLab Project to GitHub Actions In this lab, we will use the Valet `migrate` command to migrate a GitLab pipeline to GitHub Actions. The previous commands used in the labs, such as `audit` and `dry-run` have prepared us to run a migration. -The `migrate` command will generate the GitHub Actions workflow files, like the `dry-run` did, and additionally create a pull request with the files. +The `migrate` command will transform the Gitlab pipeline into a GitHub Actions workflow like the `dry-run` command did, but instead of writing these files locally, it will open a pull request with the files. The pull request will also contain a checklist of `Manual Tasks` if required. These tasks are changes that Valet could not do on our behalf, like creating a runner or adding a secret to a repository. - [Prerequisites](#prerequisites) From c9927669f894591647eb3907e18580f2a95747c4 Mon Sep 17 00:00:00 2001 From: j-dunham Date: Wed, 17 Aug 2022 12:37:26 -0400 Subject: [PATCH 08/10] Update gitlab/valet-migrate-lab.md Co-authored-by: Begona Guereca --- gitlab/valet-migrate-lab.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitlab/valet-migrate-lab.md b/gitlab/valet-migrate-lab.md index 1116f6a..e962e99 100644 --- a/gitlab/valet-migrate-lab.md +++ b/gitlab/valet-migrate-lab.md @@ -2,7 +2,7 @@ In this lab, we will use the Valet `migrate` command to migrate a GitLab pipeline to GitHub Actions. The previous commands used in the labs, such as `audit` and `dry-run` have prepared us to run a migration. The `migrate` command will transform the Gitlab pipeline into a GitHub Actions workflow like the `dry-run` command did, but instead of writing these files locally, it will open a pull request with the files. -The pull request will also contain a checklist of `Manual Tasks` if required. These tasks are changes that Valet could not do on our behalf, like creating a runner or adding a secret to a repository. +The pull request will contain a checklist of `Manual Tasks` if required. These tasks are changes that Valet could not do on our behalf, like creating a runner or adding a secret to a repository. - [Prerequisites](#prerequisites) - [Preparing for migration](#preparing-for-migration) From 213042d5cdcd25e6c7151ba1166af858ec0087d4 Mon Sep 17 00:00:00 2001 From: j-dunham Date: Wed, 17 Aug 2022 12:49:35 -0400 Subject: [PATCH 09/10] add dry-run prerequisites --- gitlab/valet-migrate-lab.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gitlab/valet-migrate-lab.md b/gitlab/valet-migrate-lab.md index e962e99..ffcff3d 100644 --- a/gitlab/valet-migrate-lab.md +++ b/gitlab/valet-migrate-lab.md @@ -13,6 +13,8 @@ The pull request will contain a checklist of `Manual Tasks` if required. These t ## Prerequisites 1. Followed [steps](../gitlab#readme) to set up your codespace environment. 2. Completed the [configure lab](../gitlab/valet-configure-lab.md) +3. Completed the [dry-run lab](../gitlab/valet-dry-run-lab.md) +4. Completed the [dry-run lab with custom transformer](../gitlab/valet-custom-transformers-lab.md) ## Preparing for migration Before running the command we need to collect some information: From a4ab766fa9c1075077afababb632255a69c5c16f Mon Sep 17 00:00:00 2001 From: j-dunham Date: Wed, 17 Aug 2022 12:50:12 -0400 Subject: [PATCH 10/10] Update gitlab/valet-migrate-lab.md Co-authored-by: Begona Guereca --- gitlab/valet-migrate-lab.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitlab/valet-migrate-lab.md b/gitlab/valet-migrate-lab.md index ffcff3d..23041a6 100644 --- a/gitlab/valet-migrate-lab.md +++ b/gitlab/valet-migrate-lab.md @@ -39,7 +39,7 @@ gh valet migrate gitlab --target-url https://github.com/GITHUB-ORG-USERNAME-HERE - Now our review is completed we want to go back to the `Conversation` tab and click `Merge pull request` - Once the PR is merged the new workflow should start and we can view it by clicking `Actions` in the top navigation actions-screen-shot -- The migration is complete and we have success transformed a pipeline in GitLab, transformed into a GitHub Actions workflow, added to a GitHub Repository, and run in Actions +- The migration is complete and we have successfully transformed a pipeline from GitLab into a GitHub Actions workflow, added it to a GitHub Repository, and run the workflow in Actions. ### Next Lab [Forecast GitLab Usage](../gitlab/valet-forecast-lab.md)