-
-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modern Configuration Builder (v16.x) Part 1 (#2241)
The new config will support: - **appsettings.json** - With defaults for many settings here rather than in code. - **Environment Settings** - Enables the ability to override settings with, for example, `MigratonTools:Target:PersonalAccessToken` as an environment variable. - **Console Overides** - Enables any setting to be passed via the console. These changes are a prelude to creating a configuration command that allows users to change the settings and reduce the failure from manual changes. Will also allow greater flexibility and use of the Options Pattern as much as possible. This will trigger a bump to 16.0 as its a major config change and the code will adapt the new configs to the old model for legacy support.. Todo List: - [x] Move all setting defaults to **appsettings.json** - [x] Load settings where possible directly from config (options) - [x] Map back to old format - [x] Create TfsWorkItemTypeMapping - [x] Create TTfsGitRepoMappings - [x] Create TTfsFieldMappings - [x] Create TTfsChangeSetMapping - [x] ~Create convertor from Old EngineConfig to new Options loading~ - [x] Update Processors to #2292 - [x] Add Writable solution with https://stackoverflow.com/questions/40970944/how-to-update-values-into-appsetting-json - [x] Soruce & Target - [x] Version - [x] Create new test strategy for main elements like processors - [ ] Update the docs with new getting started.
- Loading branch information
Showing
655 changed files
with
26,904 additions
and
14,279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,8 +49,10 @@ jobs: | |
nkdAgility_ReleaseDescription: ${{ steps.nkdagility.outputs.release_description }} | ||
nkdAgility_ReleaseDescriptionState: ${{ steps.nkdagility.outputs.release_description_state }} | ||
nkdAgility_DocsDeployFolder: ${{ steps.nkdagility.outputs.docs_deploy_folder }} | ||
nkdAgility_DocsBaseURL: ${{ steps.nkdagility.outputs.docs_baseURL }} | ||
nkdAgility_DocsVersionFolder: ${{ steps.nkdagility.outputs.docs_version_folder }} | ||
nkdAgility_RunRelease: ${{ steps.nkdagility.outputs.RunRelease }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
@@ -88,32 +90,46 @@ jobs: | |
env: | ||
GH_TOKEN: ${{ steps.app-token.outputs.token }} | ||
run: | | ||
# Get Branch Name | ||
Write-Output "::group::Get Branch Name" | ||
Write-Output "-------------------------------------------" | ||
$branchName = "${{ github.head_ref || github.ref_name }}" | ||
Write-Output "We are running on: $branchName!" | ||
$branchSafeName = $branchName.Replace("/", "-") | ||
Write-Output "branchSafeName: $branchSafeName!" | ||
Write-Output "-------------------------------------------" | ||
Write-Output "::endgroup::" | ||
# Ring Setup | ||
Write-Output "::group::Ring Control Setup" | ||
Write-Output "-------------------------------------------" | ||
Write-Output "Ring Control Setup" | ||
Write-Output "-------------------------------------------" | ||
$Ring = "Canary" | ||
$WingetApplicationId = "nkdagility.azure-devops-migration-tools" | ||
$docs_deploy_folder = "./azure-devops-migration-tools/"; | ||
$docs_baseURL = "/learn/azure-devops-migration-tools" | ||
$RunCodeRelease = 'false' | ||
$RunDocsRelease = 'false' | ||
switch ($Env:GitVersion_PreReleaseLabel) { | ||
"" { | ||
$Ring = "Release"; | ||
$WingetApplicationId = "nkdagility.azure-devops-migration-tools"; | ||
$docs_deploy_folder = "./azure-devops-migration-tools/" | ||
$docs_baseURL = "/learn/azure-devops-migration-tools" | ||
$RunRelease = 'true' | ||
} | ||
"Preview" { | ||
$Ring = "Preview"; | ||
$WingetApplicationId = "nkdagility.azure-devops-migration-tools.Preview"; | ||
$docs_deploy_folder = "./azure-devops-migration-tools/preview/"; | ||
$docs_baseURL = "/learn/azure-devops-migration-tools/preview/" | ||
$RunRelease = ( ('${{ inputs.ForceRelease }}' -eq 'true' ) -or ('${{ steps.filter.outputs.src }}' -eq 'true') -or ('${{ steps.filter.outputs.docs }}' -eq 'true') ) | ||
} | ||
default { | ||
$Ring = "Canary"; | ||
$WingetApplicationId = "nkdagility.azure-devops-migration-tools.Canary"; | ||
$docs_deploy_folder = "./azure-devops-migration-tools/canary/" | ||
$docs_deploy_folder = "./azure-devops-migration-tools/canary/$branchSafeName" | ||
$docs_baseURL = "/learn/azure-devops-migration-tools/canary/$branchSafeName" | ||
$RunRelease = 'false' | ||
} | ||
} | ||
|
@@ -123,19 +139,24 @@ jobs: | |
echo "WingetApplicationId=$WingetApplicationId" >> $env:GITHUB_OUTPUT | ||
Write-Output "docs_deploy_folder=$docs_deploy_folder" | ||
echo "docs_deploy_folder=$docs_deploy_folder" >> $env:GITHUB_OUTPUT | ||
Write-Output "docs_baseURL=$docs_baseURL" | ||
echo "docs_baseURL=$docs_baseURL" >> $env:GITHUB_OUTPUT | ||
Write-Output "RunRelease=$RunRelease" | ||
echo "RunRelease=$RunRelease" >> $env:GITHUB_OUTPUT | ||
Write-Output "-------------------------------------------" | ||
Write-Output "::endgroup::" | ||
# Docs Setup | ||
Write-Output "::group::Docs Setup" | ||
Write-Output "-------------------------------------------" | ||
Write-Output "Docs" | ||
Write-Output "-------------------------------------------" | ||
$docs_version_folder = "/azure-devops-migration-tools/$Env:GitVersion_SemVer" | ||
Write-Output "docs_version_folder=$docs_version_folder" | ||
echo "docs_version_folder=$docs_version_folder" >> $env:GITHUB_OUTPUT | ||
Write-Output "-------------------------------------------" | ||
Write-Output "::endgroup::" | ||
# Get-ReleaseDescription | ||
Write-Output "::group::Release Description Setup" | ||
Write-Output "-------------------------------------------" | ||
Write-Output "Get-ReleaseDescription" | ||
Write-Output "-------------------------------------------" | ||
|
@@ -154,6 +175,7 @@ jobs: | |
echo $description >> $env:GITHUB_OUTPUT | ||
echo "$EOF" >> $env:GITHUB_OUTPUT | ||
Write-Output "-------------------------------------------" | ||
Write-Output "::endgroup::" | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
|
@@ -166,7 +188,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
needs: Setup | ||
steps: | ||
- name: "Create Summery" | ||
- name: "Show Summery" | ||
if: always() | ||
shell: pwsh | ||
id: nkdagility-summery | ||
|
@@ -178,6 +200,7 @@ jobs: | |
- nkdAgility_WingetApplicationId: ${{needs.Setup.outputs.nkdAgility_WingetApplicationId}} | ||
- nkdAgility_DocsVersionFolder: ${{needs.Setup.outputs.nkdAgility_DocsVersionFolder}} | ||
- nkdAgility_DocsDeployFolder: ${{needs.Setup.outputs.nkdAgility_DocsDeployFolder}} | ||
- nkdAgility_DocsBaseURL: ${{needs.Setup.outputs.nkdAgility_DocsBaseURL}} | ||
- nkdAgility_ReleaseDescriptionState: ${{needs.Setup.outputs.nkdAgility_ReleaseDescriptionState}} | ||
- nkdAgility_RunRelease: ${{needs.Setup.outputs.nkdAgility_RunRelease}} | ||
### GitVersion | ||
|
@@ -191,6 +214,15 @@ jobs: | |
- HasChanged_src: ${{needs.Setup.outputs.HasChanged_src}} | ||
- HasChanged_docs: ${{needs.Setup.outputs.HasChanged_docs}} | ||
- HasChanged_automation: ${{needs.Setup.outputs.HasChanged_automation}} | ||
"@ | ||
echo $markdown >> $Env:GITHUB_STEP_SUMMARY | ||
- name: "Show Release Description" | ||
if: always() | ||
shell: pwsh | ||
id: nkdAgility_ReleaseDescription | ||
run: | | ||
Write-Host "::debug::nkdAgility_ReleaseDescription | $Env:GITHUB_STEP_SUMMARY" | ||
$markdown = @" | ||
## nkdAgility_ReleaseDescription | ||
${{needs.Setup.outputs.nkdAgility_ReleaseDescription}} | ||
"@ | ||
|
@@ -291,6 +323,12 @@ jobs: | |
GitVersion_InformationalVersion: ${{ needs.Setup.outputs.GitVersion_InformationalVersion }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Ruby | ||
uses: ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42 # v1.161.0 | ||
with: | ||
ruby-version: '3.2' # Not needed with a .ruby-version file | ||
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | ||
cache-version: 0 # Increment this number if you need to re-download cached gems | ||
- uses: cschleiden/replace-tokens@v1 | ||
with: | ||
files: '["**/*.html"]' | ||
|
@@ -304,8 +342,13 @@ jobs: | |
- uses: igsekor/[email protected] | ||
id: spellcheck | ||
name: Spellcheck | ||
- name: Build Jekyll | ||
uses: jerryjvl/jekyll-build-action@v1 | ||
- name: Build with Jekyll | ||
# Outputs to the './_site' directory by default | ||
run: bundle exec jekyll build --baseurl "${{needs.Setup.outputs.nkdAgility_DocsBaseURL}}" | ||
env: | ||
JEKYLL_ENV: production | ||
# - name: Build Jekyll | ||
# uses: jerryjvl/jekyll-build-action@v1 | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: AzureDevOpsMigrationTools-Site | ||
|
@@ -473,8 +516,8 @@ jobs: | |
DocsRelease: | ||
name: "Release to Docs" | ||
runs-on: ubuntu-latest | ||
needs: [Setup, BuildDocs, GitHubRelease] | ||
if: ${{ success() && ( needs.Setup.outputs.nkdAgility_RunRelease == 'true' ) }} | ||
needs: [Setup, BuildDocs] | ||
if: ${{ success() }} | ||
steps: | ||
- name: Download a single artifact | ||
uses: actions/download-artifact@v4 | ||
|
@@ -493,7 +536,7 @@ jobs: | |
password: ${{ secrets.NKDAGILITY_LEARN_SFTP }} | ||
port: 2222 | ||
# If true, outputs the results of the upload, without actually uploading. | ||
dry-run: ${{ (needs.Setup.outputs.nkdAgility_Ring) == 'Canary' }} | ||
#dry-run: ${{ (needs.Setup.outputs.nkdAgility_Ring) == 'Canary' }} | ||
# A list of folders to upload in the format of `folder/ => upload_folder/` | ||
uploads: | | ||
./_site/ => ${{needs.Setup.outputs.nkdAgility_DocsDeployFolder}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
using MigrationTools; | ||
using MigrationTools.Enrichers; | ||
using MigrationTools.Processors; | ||
using MigrationTools.Processors.Infrastructure; |
Oops, something went wrong.