diff --git a/_ref/RepositoryActions.json b/_ref/RepositoryActions.json
index 14e7b8f3..e3c39763 100644
--- a/_ref/RepositoryActions.json
+++ b/_ref/RepositoryActions.json
@@ -1,181 +1,153 @@
-# Define your repository context actions for RepoZ with this file (changes require an app restart).
+// PLACEHOLDER EXAMPLE
+// {Repository.Name} RepoZ
+// {Repository.Path} (prefer SafePath) C:\Develop\RepoZ\ (Windows) or /Users/awaescher/Developer/RepoZ/ (macOS)
+// {Repository.Location} C:\Develop (Windows) or /Users/awaescher/Developer (macOS)
+// {Repository.SafePath} C:/Develop/RepoZ (Windows) or /Users/awaescher/Developer/RepoZ (macOS)
+// {Repository.CurrentBranch} feature/CustomizableContextMenu
+// {Repository.Branches} master|feature/CustomizableContextMenu|origin/HEAD|origin/master|origin/feature/CustomizableContextMenu
+// {Repository.LocalBranches} master|feature/CustomizableContextMenu
+// {Repository.RemoteUrls} https://github.com/awaescher/repoz
+{
+ "version": 1,
-# COMMUNITY
-# ==========
-#
-# Please visit the following repository to find help, ask questions and browse repository actions
-# for 3rd party apps others might already have posted:
-#
-# https://github.com/awaescher/RepoZ-RepositoryActions
-# Don't forget to leave a star ;)
-#
-# If you have created your own repository actions, please consider to share them with the community
-# by submitting a pull-request.
-#
-# Thank you <3
-
+ "variables": [
+ {
+ "name": "IsRepoM",
+ "value": '{empty}{StringContains({Repository.SafePath}, "RepoM")}'
+ }
+ ],
-# HOW TO USE
-# ===========
-#
-# This file can be used to define repository actions and actions based on the file extensions inside of given repositories,
-# so called file associations.
-# Let's start ...
-#
-# Repository actions
-# ------------------
-#
-# Repository actions are actions for the repository context menu in RepoZ. They always refer to the repository they are invoked with.
-# Each repository action is defined in an own json block defining its name, action on invocation and more.
-#
-# Example
-# {
-# "name": "{OpenIn} Visual Studio Code", // {OpenIn} is a placeholder, see "Noteworthy"
-# "command": 'code',
-# "executables":
-# [
-# '%LocalAppData%/Programs/Microsoft VS Code/code.exe',
-# '%ProgramW6432%/Microsoft VS Code/code.exe'
-# ],
-# "arguments": '"{Repository.SafePath}"',
-# "keys": "Ctrl+Shift+C",
-# "active": "true"
-# }
-#
-# Use either 'command' or 'executables'. If both are defined, 'command' will always be preferred.
-#
-# - Commands will not be validated, RepoZ is going to execute it blindly with the given arguments.
-# This is useful for system commands like 'start' on Windows or 'open' on macOS or other global command line tools.
-# - Executables will be validated with File.Exists() and might not be visible in RepoZ if none of the defined executables are available.
-# This is useful if an application is known to be located in different folders (like Visual Studio Code) and require probing.
-#
-# Try to avoid absolute paths if possible by using environment variables like %PROGRAMFILES% or %APPDATA%, for example.
-# On Windows: Run 'SET' in cmd.exe to see the list of environment variables you can use.
-#
-# Use the placeholders below to build repository actions with information of the corresponding repository.
-# RepoZ will replace the placeholders automatically.
-#
-# PLACEHOLDER EXAMPLE
-# {Repository.Name} RepoZ
-# {Repository.Path} (prefer SafePath) C:\Develop\RepoZ\ (Windows) or /Users/awaescher/Developer/RepoZ/ (macOS)
-# {Repository.Location} C:\Develop (Windows) or /Users/awaescher/Developer (macOS)
-# {Repository.SafePath} C:/Develop/RepoZ (Windows) or /Users/awaescher/Developer/RepoZ (macOS)
-# {Repository.CurrentBranch} feature/CustomizableContextMenu
-# {Repository.Branches} master|feature/CustomizableContextMenu|origin/HEAD|origin/master|origin/feature/CustomizableContextMenu
-# {Repository.LocalBranches} master|feature/CustomizableContextMenu
-# {Repository.RemoteUrls} https://github.com/awaescher/repoz
-#
-#
-# File associations
-# ------------------
-#
-# File associations are different to repository actions. They are not related to the repository itself but define a file pattern
-# like "*.sln" which RepoZ uses to scan for files recursively. Matching files will be listed in a separate sub menu named after
-# the file association itself.
-# File associations don't support the repository placeholders from above. The only placeholder is the path of the matching files
-# which can be referred to as {FilePath}.
-#
-# Example
-# {
-# "name": "{Open} Visual Studio solutions", // {OpenIn} is a placeholder, see "Noteworthy"
-# "extension": "*.sln",
-# "command": 'start',
-# "arguments": '"{FilePath}"',
-# "active": "true"
-# }
-#
+ "repository-specific-env-files": [
+ {
+ "filename": "{Repository.SafePath}{slash}.git{slash}repom.env",
+ "when": "{var.IsRepoM}"
+ },
+ {
+ "filename": "{Repository.SafePath}{slash}repom.env",
+ "when": "true"
+ }
+ ],
+ "repository-specific-config-files": [
+ {
+ "filename": "{Repository.SafePath}{slash}.git{slash}RepositoryActions.json"
+ },
+ {
+ "filename": "{Repository.SafePath}{slash}RepositoryActions.json"
+ }
+ ],
-# NOTEWORTHY
-# ===========
-#
-# - You might want to use the placeholders {Open}, {OpenIn} & {OpenWith} for the repository action and file association names,
-# this allows RepoZ to translate "Open ..." to the user's language. The remaining part of the name will be moved at the correct location.
-# - {Repository.Path}, {Repository.SafePath} and {Repository.Location} will NOT be wrapped in quotes by default, because some apps require different escape characters.
-# - The first action will automatically get the Shortcut [Return], the second [Ctrl+Return]/[Command+Return] in addition to the shortcuts defined.
-# - Recursive file scans for the file associations might be time consuming. Therefore, RepoZ will not scan for files unless the sub menu
-# of the corresponding file association gets expanded. This way, RepoZ makes sure that the context menu won't become sluggish.
+ "repository-tags": [
+ {
+ "tag": "Work",
+ "when": '{StringContains({Repository.SafePath}, "Work")}'
+ },
+ {
+ "tag": "Private",
+ "when": '{Not({StringContains({Repository.SafePath}, "Work")})}'
+ }
+ ],
-{
- "repository-actions":
- [
- {
- "name": "{OpenIn} Windows File Explorer",
- "command": '"{Repository.SafePath}"',
- "keys": "Ctrl+E",
- "active": "true"
- },
- {
- "name": "{OpenIn} Windows Terminal",
- "command": 'wt',
- "arguments": '-d "{Repository.SafePath}"',
- "keys": "Ctrl+T",
- "active": "true"
- },
- {
- "name": "{OpenIn} Windows Command Shell",
- "command": 'cmd',
- "arguments": '/K "cd /d {Repository.SafePath}"',
- "active": "false"
- },
- {
- "name": "{OpenIn} Windows PowerShell",
- "executables": ['%WINDIR%/System32/WindowsPowerShell/v1.0/powershell.exe'],
- "arguments": '-executionpolicy bypass -noexit -command "Set-Location \'{Repository.SafePath}\'"',
- "active": "false"
- },
- {
- "name": "{OpenIn} Visual Studio Code",
- "executables":
- [
- '%LocalAppData%/Programs/Microsoft VS Code/code.exe',
- '%ProgramW6432%/Microsoft VS Code/code.exe'
- ],
- "arguments": '"{Repository.SafePath}"',
- "active": "true"
- },
- {
- "name": "{OpenIn} GitHub Desktop",
- "command": 'github',
- "arguments": '"{Repository.SafePath}"',
- "active": "false"
- },
- {
- # Contributed by Coen van den Munckhof (https://github.com/coenm)
- "name": "{OpenIn} Sourcetree",
- "executables":
- [
- '%LocalAppData%/SourceTree/SourceTree.exe',
- '%PROGRAMFILES(X86)%/Atlassian/SourceTree/SourceTree.exe'
- ],
- "arguments": '-f "{Repository.SafePath}"',
- "active": "false"
- },
- {
- # Contributed by Sean Feldman (https://github.com/SeanFeldman)
- "name": "{OpenWith} Git Extensions",
- "executables": ['%PROGRAMFILES(X86)%/GitExtensions/GitExtensions.exe'],
- "arguments": 'browse "{Repository.SafePath}"',
- "active": "false"
- },
- {
- # Contributed by jods (https://github.com/jods4)
- "name": "{OpenIn} Cmder",
- "command": 'cmder.exe', # make sure Cmder is in PATH (https://github.com/cmderdev/cmder/#installation)
- "arguments": '/single /start "{Repository.SafePath}"',
- "keys": "Ctrl+Shift+C",
- "active": "false"
- }
+ "repository-actions": {
+ "variables": [
+ {
+ "name": "key",
+ "value": "abc"
+ }
],
- "file-associations":
- [
- {
- "name": "{Open} Visual Studio solutions",
- "extension": "*.sln",
- "command": 'start',
- "arguments": '"{FilePath}"',
- "active": "true"
- }
+ "actions": [
+ {
+ "type": "command@1",
+ "variables": [
+ {
+ "name": "Test2",
+ "value": "-- T3sT2",
+ "enabled": "true"
+ }
+ ],
+ "name": "{OpenIn} Windows File Explorer",
+ "command": '"{Repository.SafePath}"',
+ "active": "true"
+ },
+ {
+ "type": "command@1",
+ "name": "{OpenIn} Windows Terminal",
+ "command": 'wt',
+ "arguments": '-d "{Repository.SafePath}"',
+ "active": "true"
+ },
+ {
+ "type": "command@1",
+ "name": "{OpenIn} Windows Command Shell",
+ "command": 'cmd',
+ "arguments": '/K "cd /d {Repository.SafePath}"',
+ "active": "false"
+ },
+ {
+ "type": "executable@1",
+ "name": "{OpenIn} Windows PowerShell",
+ "executables": [ '%WINDIR%/System32/WindowsPowerShell/v1.0/powershell.exe' ],
+ "arguments": '-executionpolicy bypass -noexit -command "Set-Location \'{Repository.SafePath}\'"',
+ "active": "false"
+ },
+ {
+ "type": "executable@1",
+ "name": "{OpenIn} Visual Studio Code",
+ "executables": [
+ '%LocalAppData%/Programs/Microsoft VS Code/code.exe',
+ '%ProgramW6432%/Microsoft VS Code/code.exe'
+ ],
+ "arguments": '"{Repository.SafePath}"',
+ "active": "true"
+ },
+ {
+ "type": "executable@1",
+ "name": "{OpenIn} Sourcetree",
+ "executables": [
+ '%LocalAppData%/SourceTree/SourceTree.exe',
+ '%PROGRAMFILES(X86)%/Atlassian/SourceTree/SourceTree.exe'
+ ],
+ "arguments": '-f "{Repository.Location}{backslash}{Repository.Name}"',
+ "active": "true"
+ },
+ {
+ "type": "executable@1",
+ "name": "{OpenIn} Everything",
+ "executables": [
+ '%ProgramW6432%/Everything/Everything.exe'
+ ],
+ "arguments": '-s """"{Repository.Path}""" "',
+ "active": "true"
+ },
+ {
+ "type": "executable@1",
+ "name": "{OpenIn} TotalCommander",
+ "executables": [
+ '%ProgramW6432%/totalcmd/TOTALCMD64.EXE',
+ '%SystemDrive%/totalcmd/TOTALCMD64.EXE'
+ ],
+ "arguments": "/O /T /L=\"{Repository.SafePath}\"",
+ "active": "true"
+ },
+ { "type": "separator@1" },
+ { "type": "browse-repository@1" },
+
+ { "type": "separator@1" },
+ { "type": "git-fetch@1" },
+ { "type": "git-pull@1" },
+ { "type": "git-push@1" },
+ { "type": "git-checkout@1" },
+ { "type": "separator@1" },
+ { "type": "ignore-repositories@1" },
+ { "type": "separator@1" },
+ {
+ "type": "associate-file@1",
+ "name": "{Open} Visual Studio solutions",
+ "extension": "*.sln",
+ "command": "start",
+ "arguments": '"{FilePath}"'
+ }
]
+ }
}
\ No newline at end of file
diff --git a/_ref/RepositoryActions.yaml b/_ref/RepositoryActions.yaml
new file mode 100644
index 00000000..3e429858
--- /dev/null
+++ b/_ref/RepositoryActions.yaml
@@ -0,0 +1,93 @@
+version: 1
+
+variables:
+- name: IsRepoM
+ value: '{empty}{StringContains({Repository.SafePath}, "RepoM")}'
+
+repository-specific-env-files:
+- filename: '{Repository.SafePath}{slash}.git{slash}repom.env'
+ when: '{var.IsRepoM}'
+- filename: '{Repository.SafePath}{slash}repom.env'
+ when: true
+
+repository-specific-config-files:
+- filename: '{Repository.SafePath}{slash}.git{slash}RepositoryActions.json'
+- filename: '{Repository.SafePath}{slash}RepositoryActions.json'
+
+repository-tags:
+- tag: Work
+ when: '{StringContains({Repository.SafePath}, "Work")}'
+- tag: Private
+ when: '{Not({StringContains({Repository.SafePath}, "Work")})}'
+
+repository-actions:
+ variables:
+ - name: key
+ value: abc
+ actions:
+ - type: command@1
+ variables:
+ - name: Test2
+ value: -- T3sT2
+ enabled: true
+ name: '{OpenIn} Windows File Explorer'
+ command: '"{Repository.SafePath}"'
+ active: true
+ - type: command@1
+ name: '{OpenIn} Windows Terminal'
+ command: wt
+ arguments: -d "{Repository.SafePath}"
+ active: true
+ - type: command@1
+ name: '{OpenIn} Windows Command Shell'
+ command: cmd
+ arguments: /K "cd /d {Repository.SafePath}"
+ active: false
+ - type: executable@1
+ name: '{OpenIn} Windows PowerShell'
+ executables:
+ - '%WINDIR%/System32/WindowsPowerShell/v1.0/powershell.exe'
+ arguments: -executionpolicy bypass -noexit -command "Set-Location '{Repository.SafePath}'"
+ active: false
+ - type: executable@1
+ name: '{OpenIn} Visual Studio Code'
+ executables:
+ - '%LocalAppData%/Programs/Microsoft VS Code/code.exe'
+ - '%ProgramW6432%/Microsoft VS Code/code.exe'
+ arguments: '"{Repository.SafePath}"'
+ active: true
+ - type: executable@1
+ name: '{OpenIn} Sourcetree'
+ executables:
+ - '%LocalAppData%/SourceTree/SourceTree.exe'
+ - '%PROGRAMFILES(X86)%/Atlassian/SourceTree/SourceTree.exe'
+ arguments: -f "{Repository.Location}{backslash}{Repository.Name}"
+ active: true
+ - type: executable@1
+ name: '{OpenIn} Everything'
+ executables:
+ - '%ProgramW6432%/Everything/Everything.exe'
+ arguments: -s """"{Repository.Path}""" "
+ active: true
+ - type: executable@1
+ name: '{OpenIn} TotalCommander'
+ executables:
+ - '%ProgramW6432%/totalcmd/TOTALCMD64.EXE'
+ - '%SystemDrive%/totalcmd/TOTALCMD64.EXE'
+ arguments: /O /T /L="{Repository.SafePath}"
+ active: true
+ - type: separator@1
+ - type: browse-repository@1
+ - type: separator@1
+ - type: git-fetch@1
+ - type: git-pull@1
+ - type: git-push@1
+ - type: git-checkout@1
+ - type: separator@1
+ - type: ignore-repositories@1
+ - type: separator@1
+ - type: associate-file@1
+ name: '{Open} Visual Studio solutions'
+ extension: '*.sln'
+ command: start
+ arguments: '"{FilePath}"'
diff --git a/_ref/RepositoryActionsV2.json b/_ref/RepositoryActionsV2.json
deleted file mode 100644
index 37270438..00000000
--- a/_ref/RepositoryActionsV2.json
+++ /dev/null
@@ -1,162 +0,0 @@
-// PLACEHOLDER EXAMPLE
-// {Repository.Name} RepoZ
-// {Repository.Path} (prefer SafePath) C:\Develop\RepoZ\ (Windows) or /Users/awaescher/Developer/RepoZ/ (macOS)
-// {Repository.Location} C:\Develop (Windows) or /Users/awaescher/Developer (macOS)
-// {Repository.SafePath} C:/Develop/RepoZ (Windows) or /Users/awaescher/Developer/RepoZ (macOS)
-// {Repository.CurrentBranch} feature/CustomizableContextMenu
-// {Repository.Branches} master|feature/CustomizableContextMenu|origin/HEAD|origin/master|origin/feature/CustomizableContextMenu
-// {Repository.LocalBranches} master|feature/CustomizableContextMenu
-// {Repository.RemoteUrls} https://github.com/awaescher/repoz
-
-{
- "variables":
- [
- {
- "name": "IsRepoM",
- "value": '{empty}{StringContains({Repository.SafePath}, "RepoM")}'
- }
- ],
-
- "repository-specific-env-files":
- [
- {
- "filename": "{Repository.SafePath}{slash}.git{slash}repom.env",
- "when": "{var.IsRepoM}"
- },
- {
- "filename": "{Repository.SafePath}{slash}repom.env",
- "when": "true"
- }
- ],
-
- "repository-specific-config-files":
- [
- {
- "filename": "{Repository.SafePath}{slash}.git{slash}RepositoryActions.json"
- },
- {
- "filename": "{Repository.SafePath}{slash}RepositoryActions.json"
- }
- ],
-
- "repository-tags":
- [
- {
- "tag": "Work",
- "when": '{StringContains({Repository.SafePath}, "Work")}'
- },
- {
- "tag": "Private",
- "when": '{Not({StringContains({Repository.SafePath}, "Work")})}'
- }
- ],
-
- "repository-actions":
- {
- "variables" :
- [
- {
- "name": "key",
- "value": "abc"
- }
- ],
- "actions": [
- {
- "type": "command@1",
- "variables" :
- [
- {
- "name": "Test2",
- "value": "-- T3sT2",
- "enabled": "true"
- }
- ],
- "name": "{OpenIn} Windows File Explorer",
- "command": '"{Repository.SafePath}"',
- "active": "true"
- },
- {
- "type": "command@1",
- "name": "{OpenIn} Windows Terminal",
- "command": 'wt',
- "arguments": '-d "{Repository.SafePath}"',
- "active": "true"
- },
- {
- "type": "command@1",
- "name": "{OpenIn} Windows Command Shell",
- "command": 'cmd',
- "arguments": '/K "cd /d {Repository.SafePath}"',
- "active": "false"
- },
- {
- "type": "executable@1",
- "name": "{OpenIn} Windows PowerShell",
- "executables": ['%WINDIR%/System32/WindowsPowerShell/v1.0/powershell.exe'],
- "arguments": '-executionpolicy bypass -noexit -command "Set-Location \'{Repository.SafePath}\'"',
- "active": "false"
- },
- {
- "type": "executable@1",
- "name": "{OpenIn} Visual Studio Code",
- "executables":
- [
- '%LocalAppData%/Programs/Microsoft VS Code/code.exe',
- '%ProgramW6432%/Microsoft VS Code/code.exe'
- ],
- "arguments": '"{Repository.SafePath}"',
- "active": "true"
- },
- {
- "type": "executable@1",
- "name": "{OpenIn} Sourcetree",
- "executables":
- [
- '%LocalAppData%/SourceTree/SourceTree.exe',
- '%PROGRAMFILES(X86)%/Atlassian/SourceTree/SourceTree.exe'
- ],
- "arguments": '-f "{Repository.Location}{backslash}{Repository.Name}"',
- "active": "true"
- },
- {
- "type": "executable@1",
- "name": "{OpenIn} Everything",
- "executables":
- [
- '%ProgramW6432%/Everything/Everything.exe'
- ],
- "arguments":'-s """"{Repository.Path}""" "',
- "active": "true"
- },
- {
- "type": "executable@1",
- "name": "{OpenIn} TotalCommander",
- "executables":
- [
- '%ProgramW6432%/totalcmd/TOTALCMD64.EXE',
- '%SystemDrive%/totalcmd/TOTALCMD64.EXE'
- ],
- "arguments": "/O /T /L=\"{Repository.SafePath}\"",
- "active": "true"
- },
- { "type": "separator@1" },
- { "type": "browse-repository@1" },
-
- { "type": "separator@1" },
- { "type": "git-fetch@1" },
- { "type": "git-pull@1" },
- { "type": "git-push@1" },
- { "type": "git-checkout@1" },
- { "type": "separator@1" },
- { "type": "ignore-repositories@1" },
- { "type": "separator@1" },
- {
- "type": "associate-file@1",
- "name": "{Open} Visual Studio solutions",
- "extension": "*.sln",
- "command": "start",
- "arguments": '"{FilePath}"'
- }
- ]
-}
-}
\ No newline at end of file
diff --git a/_setup/RepoM.nsi b/_setup/RepoM.nsi
index 9875ae0b..ef16f536 100644
--- a/_setup/RepoM.nsi
+++ b/_setup/RepoM.nsi
@@ -54,6 +54,7 @@ Section "RepoM"
File ..\_ref\PathEd.exe ; Add PathEd.exe to add the RepoM directory to the system's PATH easily
File ..\_ref\SendKeys.exe ; Add SendKeys.exe to add the RepoM directory for grr and grrui
File ..\_ref\RepositoryActions.json ; Can be copied in-app for the default settings
+ File ..\_ref\RepositoryActions.yaml ; Can be copied in-app for the default settings
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}.lnk" $INSTDIR\${PRODUCT_NAME}.exe
; Add the installation folder to the system PATH -> to enable grr.exe
diff --git a/src/RepoM.Api.Common/IO/CustomEnvironmentVariableVariableProvider.cs b/src/RepoM.Api.Common/IO/CustomEnvironmentVariableVariableProvider.cs
index 08a510ed..203436bd 100644
--- a/src/RepoM.Api.Common/IO/CustomEnvironmentVariableVariableProvider.cs
+++ b/src/RepoM.Api.Common/IO/CustomEnvironmentVariableVariableProvider.cs
@@ -4,6 +4,7 @@ namespace RepoM.Api.Common.IO;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
+using ExpressionStringEvaluator.Methods;
using ExpressionStringEvaluator.VariableProviders;
using RepoM.Api.Common.IO.ExpressionEvaluator;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data;
@@ -114,7 +115,7 @@ public bool CanProvide(string key)
}
///
- public string Provide(string key, string? arg)
+ public CombinedTypeContainer Provide(string key, string? arg)
{
var prefixLength = PREFIX.Length;
var envKey = key.Substring(prefixLength, key.Length - prefixLength);
@@ -125,12 +126,12 @@ public string Provide(string key, string? arg)
{
if (scope == null)
{
- return string.Empty;
+ return CombinedTypeContainer.NullInstance;
}
if (TryGetValueFromScope(scope, envKey, out var result))
{
- return result;
+ return new CombinedTypeContainer(result);
}
scope = scope.Parent;
@@ -187,7 +188,7 @@ public bool CanProvide(string key)
return !string.IsNullOrWhiteSpace(envKey);
}
- public string Provide(RepositoryContext context, string key, string? arg)
+ public CombinedTypeContainer Provide(RepositoryContext context, string key, string? arg)
{
var prefixLength = PREFIX.Length;
var envKey = key.Substring(prefixLength, key.Length - prefixLength);
@@ -196,26 +197,26 @@ public string Provide(RepositoryContext context, string key, string? arg)
if (singleContext == null)
{
- return Environment.GetEnvironmentVariable(envKey) ?? string.Empty;
+ return new CombinedTypeContainer(Environment.GetEnvironmentVariable(envKey) ?? string.Empty);
}
Dictionary envVars = GetRepoEnvironmentVariables(singleContext);
if (envVars.ContainsKey(envKey))
{
- return envVars[envKey];
+ return new CombinedTypeContainer(envVars[envKey]);
}
- return Environment.GetEnvironmentVariable(envKey) ?? string.Empty;
+ return new CombinedTypeContainer(Environment.GetEnvironmentVariable(envKey) ?? string.Empty);
}
///
- public string Provide(string key, string? arg)
+ public CombinedTypeContainer Provide(string key, string? arg)
{
var prefixLength = PREFIX.Length;
var envKey = key.Substring(prefixLength, key.Length - prefixLength);
var result = Environment.GetEnvironmentVariable(envKey) ?? string.Empty;
- return result;
+ return new CombinedTypeContainer(result);
}
private static Dictionary GetRepoEnvironmentVariables(Repository repository)
diff --git a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionAssociateFileV1Deserializer.cs b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionAssociateFileV1Deserializer.cs
index e3d7a0fe..723c59ba 100644
--- a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionAssociateFileV1Deserializer.cs
+++ b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionAssociateFileV1Deserializer.cs
@@ -1,6 +1,7 @@
namespace RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers;
using System;
+using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data.Actions;
@@ -12,13 +13,13 @@ bool IActionDeserializer.CanDeserialize(string type)
return "associate-file@1".Equals(type, StringComparison.CurrentCultureIgnoreCase);
}
- RepositoryAction? IActionDeserializer.Deserialize(JToken jToken, ActionDeserializerComposition actionDeserializer)
+ RepositoryAction? IActionDeserializer.Deserialize(JToken jToken, ActionDeserializerComposition actionDeserializer, JsonSerializer jsonSerializer)
{
- return Deserialize(jToken);
+ return Deserialize(jToken, jsonSerializer);
}
- private static RepositoryActionAssociateFileV1? Deserialize(JToken jToken)
+ private static RepositoryActionAssociateFileV1? Deserialize(JToken jToken, JsonSerializer jsonSerializer)
{
- return jToken.ToObject();
+ return jToken.ToObject(jsonSerializer);
}
}
\ No newline at end of file
diff --git a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionBrowseRepositoryV1Deserializer.cs b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionBrowseRepositoryV1Deserializer.cs
index 83bc2255..91440bbc 100644
--- a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionBrowseRepositoryV1Deserializer.cs
+++ b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionBrowseRepositoryV1Deserializer.cs
@@ -1,6 +1,7 @@
namespace RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers;
using System;
+using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data.Actions;
@@ -12,13 +13,13 @@ bool IActionDeserializer.CanDeserialize(string type)
return "browse-repository@1".Equals(type, StringComparison.CurrentCultureIgnoreCase);
}
- RepositoryAction? IActionDeserializer.Deserialize(JToken jToken, ActionDeserializerComposition actionDeserializer)
+ RepositoryAction? IActionDeserializer.Deserialize(JToken jToken, ActionDeserializerComposition actionDeserializer, JsonSerializer jsonSerializer)
{
- return Deserialize(jToken);
+ return Deserialize(jToken, jsonSerializer);
}
- private static RepositoryActionBrowseRepositoryV1? Deserialize(JToken jToken)
+ private static RepositoryActionBrowseRepositoryV1? Deserialize(JToken jToken, JsonSerializer jsonSerializer)
{
- return jToken.ToObject();
+ return jToken.ToObject(jsonSerializer);
}
}
\ No newline at end of file
diff --git a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionBrowserV1Deserializer.cs b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionBrowserV1Deserializer.cs
index 940f8daa..4429bb46 100644
--- a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionBrowserV1Deserializer.cs
+++ b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionBrowserV1Deserializer.cs
@@ -1,6 +1,7 @@
namespace RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers;
using System;
+using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data.Actions;
@@ -12,13 +13,13 @@ bool IActionDeserializer.CanDeserialize(string type)
return "browser@1".Equals(type, StringComparison.CurrentCultureIgnoreCase);
}
- RepositoryAction? IActionDeserializer.Deserialize(JToken jToken, ActionDeserializerComposition actionDeserializer)
+ RepositoryAction? IActionDeserializer.Deserialize(JToken jToken, ActionDeserializerComposition actionDeserializer, JsonSerializer jsonSerializer)
{
- return Deserialize(jToken);
+ return Deserialize(jToken, jsonSerializer);
}
- private static RepositoryActionBrowserV1? Deserialize(JToken jToken)
+ private static RepositoryActionBrowserV1? Deserialize(JToken jToken, JsonSerializer jsonSerializer)
{
- return jToken.ToObject();
+ return jToken.ToObject(jsonSerializer);
}
}
\ No newline at end of file
diff --git a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionCommandV1Deserializer.cs b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionCommandV1Deserializer.cs
index 6e2d4560..d6fdb603 100644
--- a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionCommandV1Deserializer.cs
+++ b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionCommandV1Deserializer.cs
@@ -1,6 +1,7 @@
namespace RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers;
using System;
+using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data.Actions;
@@ -12,13 +13,13 @@ bool IActionDeserializer.CanDeserialize(string type)
return "command@1".Equals(type, StringComparison.CurrentCultureIgnoreCase);
}
- RepositoryAction? IActionDeserializer.Deserialize(JToken jToken, ActionDeserializerComposition actionDeserializer)
+ RepositoryAction? IActionDeserializer.Deserialize(JToken jToken, ActionDeserializerComposition actionDeserializer, JsonSerializer jsonSerializer)
{
- return Deserialize(jToken);
+ return Deserialize(jToken, jsonSerializer);
}
- private static RepositoryActionCommandV1? Deserialize(JToken jToken)
+ private static RepositoryActionCommandV1? Deserialize(JToken jToken, JsonSerializer jsonSerializer)
{
- return jToken.ToObject();
+ return jToken.ToObject(jsonSerializer);
}
}
\ No newline at end of file
diff --git a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionDeserializerComposition.cs b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionDeserializerComposition.cs
index 6e0b2e40..31fb3d4e 100644
--- a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionDeserializerComposition.cs
+++ b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionDeserializerComposition.cs
@@ -3,6 +3,7 @@ namespace RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionDeserial
using System;
using System.Collections.Generic;
using System.Linq;
+using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data;
@@ -15,11 +16,11 @@ public ActionDeserializerComposition(IEnumerable deserializ
_deserializers = deserializers?.Where(x => x != null).ToArray() ?? throw new ArgumentNullException(nameof(deserializers));
}
- public RepositoryAction? DeserializeSingleAction(string type, JToken jToken)
+ public RepositoryAction? DeserializeSingleAction(string type, JToken jToken, JsonSerializer jsonSerializer)
{
IActionDeserializer? deserializer = _deserializers.FirstOrDefault(x => x.CanDeserialize(type));
- RepositoryAction? result = deserializer?.Deserialize(jToken, this);
+ RepositoryAction? result = deserializer?.Deserialize(jToken, this, jsonSerializer);
if (result == null)
{
@@ -30,11 +31,7 @@ public ActionDeserializerComposition(IEnumerable deserializ
if (multiSelectEnabledToken != null)
{
- var multiSelectEnabledValue = multiSelectEnabledToken.Value();
- if (!string.IsNullOrWhiteSpace(multiSelectEnabledValue))
- {
- result.MultiSelectEnabled = multiSelectEnabledValue!;
- }
+ result.MultiSelectEnabled = multiSelectEnabledToken.Value();
}
return result;
diff --git a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionExecutableV1Deserializer.cs b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionExecutableV1Deserializer.cs
index f8111943..8541ab43 100644
--- a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionExecutableV1Deserializer.cs
+++ b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionExecutableV1Deserializer.cs
@@ -3,6 +3,7 @@ namespace RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionDeserial
using System;
using System.Collections.Generic;
using System.Linq;
+using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data.Actions;
@@ -14,14 +15,14 @@ bool IActionDeserializer.CanDeserialize(string type)
return "executable@1".Equals(type, StringComparison.CurrentCultureIgnoreCase);
}
- RepositoryAction? IActionDeserializer.Deserialize(JToken jToken, ActionDeserializerComposition actionDeserializer)
+ RepositoryAction? IActionDeserializer.Deserialize(JToken jToken, ActionDeserializerComposition actionDeserializer, JsonSerializer jsonSerializer)
{
- return Deserialize(jToken);
+ return Deserialize(jToken, jsonSerializer);
}
- private static RepositoryActionExecutableV1? Deserialize(JToken jToken)
+ private static RepositoryActionExecutableV1? Deserialize(JToken jToken, JsonSerializer jsonSerializer)
{
- RepositoryActionExecutableV1? result = jToken.ToObject();
+ RepositoryActionExecutableV1? result = jToken.ToObject(jsonSerializer);
if (result == null)
{
diff --git a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionFolderV1Deserializer.cs b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionFolderV1Deserializer.cs
index f87c1c2f..037f333b 100644
--- a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionFolderV1Deserializer.cs
+++ b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionFolderV1Deserializer.cs
@@ -3,6 +3,7 @@ namespace RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionDeserial
using System;
using System.Collections.Generic;
using System.Linq;
+using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data.Actions;
@@ -14,12 +15,12 @@ bool IActionDeserializer.CanDeserialize(string type)
return "folder@1".Equals(type, StringComparison.CurrentCultureIgnoreCase);
}
- RepositoryAction? IActionDeserializer.Deserialize(JToken jToken, ActionDeserializerComposition actionDeserializer)
+ RepositoryAction? IActionDeserializer.Deserialize(JToken jToken, ActionDeserializerComposition actionDeserializer, JsonSerializer jsonSerializer)
{
- return Deserialize(jToken, actionDeserializer);
+ return Deserialize(jToken, actionDeserializer, jsonSerializer);
}
- private static RepositoryActionFolderV1? Deserialize(JToken token, ActionDeserializerComposition actionDeserializer)
+ private static RepositoryActionFolderV1? Deserialize(JToken token, ActionDeserializerComposition actionDeserializer, JsonSerializer jsonSerializer)
{
RepositoryActionFolderV1? result = token.ToObject();
@@ -62,7 +63,7 @@ bool IActionDeserializer.CanDeserialize(string type)
continue;
}
- RepositoryAction? customAction = actionDeserializer.DeserializeSingleAction(typeValue!, variable);
+ RepositoryAction? customAction = actionDeserializer.DeserializeSingleAction(typeValue!, variable, jsonSerializer);
if (customAction == null)
{
continue;
diff --git a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionGitCheckoutV1Deserializer.cs b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionGitCheckoutV1Deserializer.cs
index d3997bab..444e90c9 100644
--- a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionGitCheckoutV1Deserializer.cs
+++ b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionGitCheckoutV1Deserializer.cs
@@ -1,6 +1,7 @@
namespace RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers;
using System;
+using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data.Actions;
@@ -12,13 +13,13 @@ bool IActionDeserializer.CanDeserialize(string type)
return "git-checkout@1".Equals(type, StringComparison.CurrentCultureIgnoreCase);
}
- RepositoryAction? IActionDeserializer.Deserialize(JToken jToken, ActionDeserializerComposition actionDeserializer)
+ RepositoryAction? IActionDeserializer.Deserialize(JToken jToken, ActionDeserializerComposition actionDeserializer, JsonSerializer jsonSerializer)
{
- return Deserialize(jToken);
+ return Deserialize(jToken, jsonSerializer);
}
- private static RepositoryActionGitCheckoutV1? Deserialize(JToken jToken)
+ private static RepositoryActionGitCheckoutV1? Deserialize(JToken jToken, JsonSerializer jsonSerializer)
{
- return jToken.ToObject();
+ return jToken.ToObject(jsonSerializer);
}
}
\ No newline at end of file
diff --git a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionGitFetchV1Deserializer.cs b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionGitFetchV1Deserializer.cs
index 4743bc44..05d35627 100644
--- a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionGitFetchV1Deserializer.cs
+++ b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionGitFetchV1Deserializer.cs
@@ -1,6 +1,7 @@
namespace RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers;
using System;
+using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data.Actions;
@@ -12,13 +13,13 @@ bool IActionDeserializer.CanDeserialize(string type)
return "git-fetch@1".Equals(type, StringComparison.CurrentCultureIgnoreCase);
}
- RepositoryAction? IActionDeserializer.Deserialize(JToken jToken, ActionDeserializerComposition actionDeserializer)
+ RepositoryAction? IActionDeserializer.Deserialize(JToken jToken, ActionDeserializerComposition actionDeserializer, JsonSerializer jsonSerializer)
{
- return Deserialize(jToken);
+ return Deserialize(jToken, jsonSerializer);
}
- private static RepositoryActionGitFetchV1? Deserialize(JToken jToken)
+ private static RepositoryActionGitFetchV1? Deserialize(JToken jToken, JsonSerializer jsonSerializer)
{
- return jToken.ToObject();
+ return jToken.ToObject(jsonSerializer);
}
}
\ No newline at end of file
diff --git a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionGitPullV1Deserializer.cs b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionGitPullV1Deserializer.cs
index 94c8cdad..c3d7c3ae 100644
--- a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionGitPullV1Deserializer.cs
+++ b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionGitPullV1Deserializer.cs
@@ -1,6 +1,7 @@
namespace RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers;
using System;
+using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data.Actions;
@@ -12,13 +13,13 @@ bool IActionDeserializer.CanDeserialize(string type)
return "git-pull@1".Equals(type, StringComparison.CurrentCultureIgnoreCase);
}
- RepositoryAction? IActionDeserializer.Deserialize(JToken jToken, ActionDeserializerComposition actionDeserializer)
+ RepositoryAction? IActionDeserializer.Deserialize(JToken jToken, ActionDeserializerComposition actionDeserializer, JsonSerializer jsonSerializer)
{
- return Deserialize(jToken);
+ return Deserialize(jToken, jsonSerializer);
}
- private static RepositoryActionGitPullV1? Deserialize(JToken jToken)
+ private static RepositoryActionGitPullV1? Deserialize(JToken jToken, JsonSerializer jsonSerializer)
{
- return jToken.ToObject();
+ return jToken.ToObject(jsonSerializer);
}
}
\ No newline at end of file
diff --git a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionGitPushV1Deserializer.cs b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionGitPushV1Deserializer.cs
index 67779a68..43fdc55e 100644
--- a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionGitPushV1Deserializer.cs
+++ b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionGitPushV1Deserializer.cs
@@ -1,6 +1,7 @@
namespace RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers;
using System;
+using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data.Actions;
@@ -12,13 +13,13 @@ bool IActionDeserializer.CanDeserialize(string type)
return "git-push@1".Equals(type, StringComparison.CurrentCultureIgnoreCase);
}
- RepositoryAction? IActionDeserializer.Deserialize(JToken jToken, ActionDeserializerComposition actionDeserializer)
+ RepositoryAction? IActionDeserializer.Deserialize(JToken jToken, ActionDeserializerComposition actionDeserializer, JsonSerializer jsonSerializer)
{
- return Deserialize(jToken);
+ return Deserialize(jToken, jsonSerializer);
}
- private static RepositoryActionGitPushV1? Deserialize(JToken jToken)
+ private static RepositoryActionGitPushV1? Deserialize(JToken jToken, JsonSerializer jsonSerializer)
{
- return jToken.ToObject();
+ return jToken.ToObject(jsonSerializer);
}
}
\ No newline at end of file
diff --git a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionIgnoreRepositoriesV1Deserializer.cs b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionIgnoreRepositoriesV1Deserializer.cs
index 412ebc42..8e37d68e 100644
--- a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionIgnoreRepositoriesV1Deserializer.cs
+++ b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionIgnoreRepositoriesV1Deserializer.cs
@@ -1,6 +1,7 @@
namespace RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers;
using System;
+using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data.Actions;
@@ -12,13 +13,13 @@ bool IActionDeserializer.CanDeserialize(string type)
return "ignore-repositories@1".Equals(type, StringComparison.CurrentCultureIgnoreCase);
}
- RepositoryAction? IActionDeserializer.Deserialize(JToken jToken, ActionDeserializerComposition actionDeserializer)
+ RepositoryAction? IActionDeserializer.Deserialize(JToken jToken, ActionDeserializerComposition actionDeserializer, JsonSerializer jsonSerializer)
{
- return Deserialize(jToken);
+ return Deserialize(jToken, jsonSerializer);
}
- private static RepositoryActionIgnoreRepositoriesV1? Deserialize(JToken jToken)
+ private static RepositoryActionIgnoreRepositoriesV1? Deserialize(JToken jToken, JsonSerializer jsonSerializer)
{
- return jToken.ToObject();
+ return jToken.ToObject(jsonSerializer);
}
}
\ No newline at end of file
diff --git a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionSeparatorV1Deserializer.cs b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionSeparatorV1Deserializer.cs
index 96f05a07..b3b1d337 100644
--- a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionSeparatorV1Deserializer.cs
+++ b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionSeparatorV1Deserializer.cs
@@ -1,6 +1,7 @@
namespace RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers;
using System;
+using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data.Actions;
@@ -12,13 +13,13 @@ bool IActionDeserializer.CanDeserialize(string type)
return "separator@1".Equals(type, StringComparison.CurrentCultureIgnoreCase);
}
- RepositoryAction? IActionDeserializer.Deserialize(JToken jToken, ActionDeserializerComposition actionDeserializer)
+ RepositoryAction? IActionDeserializer.Deserialize(JToken jToken, ActionDeserializerComposition actionDeserializer, JsonSerializer jsonSerializer)
{
- return Deserialize(jToken);
+ return Deserialize(jToken, jsonSerializer);
}
- private static RepositoryActionSeparatorV1? Deserialize(JToken jToken)
+ private static RepositoryActionSeparatorV1? Deserialize(JToken jToken, JsonSerializer jsonSerializer)
{
- return jToken.ToObject();
+ return jToken.ToObject(jsonSerializer);
}
}
\ No newline at end of file
diff --git a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/Deserialization/BoolToStringJsonConverter.cs b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/Deserialization/BoolToStringJsonConverter.cs
new file mode 100644
index 00000000..e67f06cb
--- /dev/null
+++ b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/Deserialization/BoolToStringJsonConverter.cs
@@ -0,0 +1,37 @@
+namespace RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Deserialization;
+
+using System;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+
+internal class BoolToStringJsonConverter : JsonConverter
+{
+ public override bool CanConvert(Type objectType)
+ {
+ return typeof(string) == objectType;
+ }
+
+ public override object? ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer)
+ {
+ var token = JToken.Load(reader);
+ var str = token.Value();
+
+ if ("true".Equals(str, StringComparison.OrdinalIgnoreCase))
+ {
+ return "true";
+ }
+
+ if ("false".Equals(str, StringComparison.OrdinalIgnoreCase))
+ {
+ return "false";
+ }
+
+ return str;
+ }
+
+ public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
+ {
+ // intentionally
+ throw new NotImplementedException();
+ }
+}
\ No newline at end of file
diff --git a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/DynamicRepositoryActionDeserializer.cs b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/Deserialization/JsonDynamicRepositoryActionDeserializer.cs
similarity index 60%
rename from src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/DynamicRepositoryActionDeserializer.cs
rename to src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/Deserialization/JsonDynamicRepositoryActionDeserializer.cs
index 79438cb5..b14d4fd7 100644
--- a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/DynamicRepositoryActionDeserializer.cs
+++ b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/Deserialization/JsonDynamicRepositoryActionDeserializer.cs
@@ -1,21 +1,29 @@
-namespace RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider;
+namespace RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Deserialization;
using System;
using System.Collections.Generic;
using System.Linq;
+using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data;
-public class DynamicRepositoryActionDeserializer
+public class JsonDynamicRepositoryActionDeserializer
{
private readonly ActionDeserializerComposition _deserializers;
+ private static readonly JsonSerializer _jsonSerializer = new()
+ {
+ Converters =
+ {
+ new BoolToStringJsonConverter(),
+ },
+ };
private static readonly JsonLoadSettings _jsonLoadSettings = new()
{
CommentHandling = CommentHandling.Ignore,
};
- public DynamicRepositoryActionDeserializer(ActionDeserializerComposition deserializers)
+ public JsonDynamicRepositoryActionDeserializer(ActionDeserializerComposition deserializers)
{
_deserializers = deserializers ?? throw new ArgumentNullException(nameof(deserializers));
}
@@ -26,23 +34,29 @@ public RepositoryActionConfiguration Deserialize(string rawContent)
var configuration = new RepositoryActionConfiguration();
- JToken? token = jsonObject["redirect"];
- configuration.Redirect = DeserializeRedirect(token);
+ JToken? token = jsonObject["version"];
+ var version = DeserializeVersion(token);
+
+ if (version == 1)
+ {
+ token = jsonObject["redirect"];
+ configuration.Redirect = DeserializeRedirect(token);
- token = jsonObject["repository-specific-env-files"];
- configuration.RepositorySpecificEnvironmentFiles.AddRange(TryDeserializeEnumerable(token));
+ token = jsonObject["repository-specific-env-files"];
+ configuration.RepositorySpecificEnvironmentFiles.AddRange(TryDeserializeEnumerable(token));
- token = jsonObject["repository-specific-config-files"];
- configuration.RepositorySpecificConfigFiles.AddRange(TryDeserializeEnumerable(token));
+ token = jsonObject["repository-specific-config-files"];
+ configuration.RepositorySpecificConfigFiles.AddRange(TryDeserializeEnumerable(token));
- token = jsonObject["variables"];
- configuration.Variables.AddRange(TryDeserializeEnumerable(token));
+ token = jsonObject["variables"];
+ configuration.Variables.AddRange(TryDeserializeEnumerable(token));
- token = jsonObject["repository-tags"];
- DeserializeRepositoryTags(token, ref configuration);
+ token = jsonObject["repository-tags"];
+ DeserializeRepositoryTags(token, ref configuration);
- token = jsonObject["repository-actions"];
- DeserializeRepositoryActions(token, configuration);
+ token = jsonObject["repository-actions"];
+ DeserializeRepositoryActions(token, configuration);
+ }
return configuration;
}
@@ -77,7 +91,7 @@ private void DeserializeRepositoryActions(JToken? repositoryActionsToken, Reposi
continue;
}
- RepositoryAction? customAction = _deserializers.DeserializeSingleAction(typeValue!, variable);
+ RepositoryAction? customAction = _deserializers.DeserializeSingleAction(typeValue!, variable, _jsonSerializer);
if (customAction == null)
{
continue;
@@ -117,7 +131,7 @@ private static IEnumerable TryDeserializeEnumerable(JToken? token)
IList files = token.Children().ToList();
foreach (JToken file in files)
{
- T? obj = file.ToObject();
+ T? obj = file.ToObject(_jsonSerializer);
if (obj != null)
{
yield return obj;
@@ -134,7 +148,7 @@ private static IEnumerable TryDeserializeEnumerable(JToken? token)
if (redirectToken.Type != JTokenType.String)
{
- return redirectToken.ToObject();
+ return redirectToken.ToObject(_jsonSerializer);
}
var redirectValue = redirectToken.Value();
@@ -144,4 +158,37 @@ private static IEnumerable TryDeserializeEnumerable(JToken? token)
Filename = redirectValue ?? string.Empty,
};
}
+
+ private static int DeserializeVersion(JToken? versionToken)
+ {
+ const int DEFAULT_VERSION = 1;
+ if (versionToken == null)
+ {
+ return DEFAULT_VERSION;
+ }
+
+ var version = DEFAULT_VERSION;
+
+ if (versionToken.Type == JTokenType.Integer)
+ {
+ version = versionToken.Value();
+ return version < 1 ? DEFAULT_VERSION : version;
+ }
+
+ if (versionToken.Type == JTokenType.String)
+ {
+ var versionString = versionToken.Value();
+ if (string.IsNullOrWhiteSpace(versionString))
+ {
+ return DEFAULT_VERSION;
+ }
+
+ if (int.TryParse(versionString, out version))
+ {
+ return version < 1 ? DEFAULT_VERSION : version;
+ }
+ }
+
+ return DEFAULT_VERSION;
+ }
}
\ No newline at end of file
diff --git a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/Deserialization/YamlDynamicRepositoryActionDeserializer.cs b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/Deserialization/YamlDynamicRepositoryActionDeserializer.cs
new file mode 100644
index 00000000..266be778
--- /dev/null
+++ b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/Deserialization/YamlDynamicRepositoryActionDeserializer.cs
@@ -0,0 +1,32 @@
+namespace RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Deserialization;
+
+using System;
+using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data;
+using YamlDotNet.Serialization;
+
+public class YamlDynamicRepositoryActionDeserializer
+{
+ private readonly JsonDynamicRepositoryActionDeserializer _jsonDynamicRepositoryActionDeserializer;
+ private readonly IDeserializer _deserializer;
+ private readonly ISerializer _serializer;
+
+ public YamlDynamicRepositoryActionDeserializer(JsonDynamicRepositoryActionDeserializer jsonDynamicRepositoryActionDeserializer)
+ {
+ _jsonDynamicRepositoryActionDeserializer = jsonDynamicRepositoryActionDeserializer ?? throw new ArgumentNullException(nameof(jsonDynamicRepositoryActionDeserializer));
+ _deserializer = new DeserializerBuilder().Build();
+ _serializer = new SerializerBuilder().JsonCompatible().Build();
+ }
+
+ public RepositoryActionConfiguration Deserialize(string rawContent)
+ {
+ var yamlObject = _deserializer.Deserialize(rawContent, typeof(object));
+ if (yamlObject == null)
+ {
+ // todo, log, throw?, ..
+ return _jsonDynamicRepositoryActionDeserializer.Deserialize(rawContent);
+ }
+
+ var json = _serializer.Serialize(yamlObject);
+ return _jsonDynamicRepositoryActionDeserializer.Deserialize(json);
+ }
+}
\ No newline at end of file
diff --git a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/Exceptions/ConfigurationFileNotFoundException.cs b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/Exceptions/ConfigurationFileNotFoundException.cs
new file mode 100644
index 00000000..1c53af21
--- /dev/null
+++ b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/Exceptions/ConfigurationFileNotFoundException.cs
@@ -0,0 +1,29 @@
+namespace RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Exceptions;
+
+using System;
+using System.Runtime.Serialization;
+
+public class ConfigurationFileNotFoundException : Exception
+{
+ public ConfigurationFileNotFoundException(string filename)
+ {
+ Filename = filename;
+ }
+
+ protected ConfigurationFileNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ Filename = string.Empty; //todo
+ }
+
+ public ConfigurationFileNotFoundException(string filename, string message) : base(message)
+ {
+ Filename = filename;
+ }
+
+ public ConfigurationFileNotFoundException(string filename, string message, Exception innerException) : base(message, innerException)
+ {
+ Filename = filename;
+ }
+
+ public string Filename { get; private set; }
+}
\ No newline at end of file
diff --git a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/Exceptions/InvalidConfigurationException.cs b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/Exceptions/InvalidConfigurationException.cs
new file mode 100644
index 00000000..86ee516d
--- /dev/null
+++ b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/Exceptions/InvalidConfigurationException.cs
@@ -0,0 +1,29 @@
+namespace RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Exceptions;
+
+using System;
+using System.Runtime.Serialization;
+
+public class InvalidConfigurationException : Exception
+{
+ public InvalidConfigurationException(string filename)
+ {
+ Filename = filename;
+ }
+
+ protected InvalidConfigurationException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ Filename = string.Empty; //todo
+ }
+
+ public InvalidConfigurationException(string filename, string message) : base(message)
+ {
+ Filename = filename;
+ }
+
+ public InvalidConfigurationException(string filename, string message, Exception innerException) : base(message, innerException)
+ {
+ Filename = filename;
+ }
+
+ public string Filename { get; private set; }
+}
\ No newline at end of file
diff --git a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/IActionDeserializer.cs b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/IActionDeserializer.cs
index 3a5fba04..774980e1 100644
--- a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/IActionDeserializer.cs
+++ b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/IActionDeserializer.cs
@@ -1,5 +1,6 @@
namespace RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider;
+using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data;
@@ -8,5 +9,5 @@ public interface IActionDeserializer
{
bool CanDeserialize(string type);
- RepositoryAction? Deserialize(JToken jToken, ActionDeserializerComposition actionDeserializer);
+ RepositoryAction? Deserialize(JToken jToken, ActionDeserializerComposition actionDeserializer, JsonSerializer jsonSerializer);
}
\ No newline at end of file
diff --git a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/RepositorySpecificConfiguration.cs b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/RepositorySpecificConfiguration.cs
index 0aaa85b4..292e00df 100644
--- a/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/RepositorySpecificConfiguration.cs
+++ b/src/RepoM.Api.Common/IO/ModuleBasedRepositoryActionProvider/RepositorySpecificConfiguration.cs
@@ -5,7 +5,6 @@ namespace RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider;
using System.IO;
using System.IO.Abstractions;
using System.Linq;
-using System.Runtime.Serialization;
using System.Text;
using DotNetEnv;
using RepoM.Api.Common;
@@ -13,83 +12,57 @@ namespace RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider;
using RepoM.Api.Common.IO.ExpressionEvaluator;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionMappers;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data;
+using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Deserialization;
+using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Exceptions;
using RepoM.Api.Git;
using RepoM.Api.IO;
using Repository = RepoM.Api.Git.Repository;
using RepositoryAction = RepoM.Api.Git.RepositoryAction;
-public class ConfigurationFileNotFoundException : Exception
-{
- public ConfigurationFileNotFoundException(string filename)
- {
- Filename = filename;
- }
-
- protected ConfigurationFileNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context)
- {
- Filename = string.Empty; //todo
- }
-
- public ConfigurationFileNotFoundException(string filename, string message) : base(message)
- {
- Filename = filename;
- }
-
- public ConfigurationFileNotFoundException(string filename, string message, Exception innerException) : base(message, innerException)
- {
- Filename = filename;
- }
-
- public string Filename { get; private set; }
-}
-
-public class InvalidConfigurationException : Exception
-{
- public InvalidConfigurationException(string filename)
- {
- Filename = filename;
- }
-
- protected InvalidConfigurationException(SerializationInfo info, StreamingContext context) : base(info, context)
- {
- Filename = string.Empty; //todo
- }
-
- public InvalidConfigurationException(string filename, string message) : base(message)
- {
- Filename = filename;
- }
-
- public InvalidConfigurationException(string filename, string message, Exception innerException) : base(message, innerException)
- {
- Filename = filename;
- }
-
- public string Filename { get; private set; }
-}
-
public class RepositoryConfigurationReader
{
private readonly IAppDataPathProvider _appDataPathProvider;
private readonly IFileSystem _fileSystem;
- private readonly DynamicRepositoryActionDeserializer _appSettingsDeserializer;
+ private readonly JsonDynamicRepositoryActionDeserializer _jsonAppSettingsDeserializer;
+ private readonly YamlDynamicRepositoryActionDeserializer _yamlAppSettingsDeserializer;
private readonly RepositoryExpressionEvaluator _repoExpressionEvaluator;
- public const string FILENAME = "RepositoryActionsV2.json";
+ private const string FILENAME = "RepositoryActions.";
+ public const string FILENAME_JSON = FILENAME + "json";
public RepositoryConfigurationReader(
IAppDataPathProvider appDataPathProvider,
IFileSystem fileSystem,
- DynamicRepositoryActionDeserializer appsettingsDeserializer,
- RepositoryExpressionEvaluator repoExpressionEvaluator
- )
+ JsonDynamicRepositoryActionDeserializer jsonAppsettingsDeserializer,
+ YamlDynamicRepositoryActionDeserializer yamlAppSettingsDeserializer,
+ RepositoryExpressionEvaluator repoExpressionEvaluator)
{
_appDataPathProvider = appDataPathProvider ?? throw new ArgumentNullException(nameof(appDataPathProvider));
_fileSystem = fileSystem ?? throw new ArgumentNullException(nameof(fileSystem));
- _appSettingsDeserializer = appsettingsDeserializer ?? throw new ArgumentNullException(nameof(appsettingsDeserializer));
+ _jsonAppSettingsDeserializer = jsonAppsettingsDeserializer ?? throw new ArgumentNullException(nameof(jsonAppsettingsDeserializer));
+ _yamlAppSettingsDeserializer = yamlAppSettingsDeserializer ?? throw new ArgumentNullException(nameof(yamlAppSettingsDeserializer));
_repoExpressionEvaluator = repoExpressionEvaluator ?? throw new ArgumentNullException(nameof(repoExpressionEvaluator));
}
+ private string GetRepositoryActionsFilename(string basePath)
+ {
+ var exts = new [] { "yml", "yaml", "json", };
+
+ var path = Path.Combine(basePath, FILENAME);
+ foreach (var ext in exts)
+ {
+ var filename = path + ext;
+ if (_fileSystem.File.Exists(filename))
+ {
+ return filename;
+ }
+ }
+
+ var f = path + "{" + string.Join(",",exts)+ "}";
+
+ throw new ConfigurationFileNotFoundException(f);
+ }
+
public (Dictionary? envVars, List? Variables, List? actions, List? tags) Get(params Repository[] repositories)
{
if (!repositories.Any())
@@ -114,7 +87,7 @@ RepositoryExpressionEvaluator repoExpressionEvaluator
RepositoryActionConfiguration? rootFile = null;
RepositoryActionConfiguration? repoSpecificConfig = null;
- var filename = Path.Combine(_appDataPathProvider.GetAppDataPath(), FILENAME);
+ var filename = GetRepositoryActionsFilename(_appDataPathProvider.GetAppDataPath());
if (!_fileSystem.File.Exists(filename))
{
throw new ConfigurationFileNotFoundException(filename);
@@ -123,7 +96,7 @@ RepositoryExpressionEvaluator repoExpressionEvaluator
try
{
var content = _fileSystem.File.ReadAllText(filename, Encoding.UTF8);
- rootFile = _appSettingsDeserializer.Deserialize(content);
+ rootFile = Deserialize(Path.GetExtension(filename), content);
}
catch (Exception e)
{
@@ -141,7 +114,7 @@ RepositoryExpressionEvaluator repoExpressionEvaluator
try
{
var content = _fileSystem.File.ReadAllText(filename, Encoding.UTF8);
- rootFile = _appSettingsDeserializer.Deserialize(content);
+ rootFile = Deserialize(Path.GetExtension(filename), content);
}
catch (Exception e)
{
@@ -240,7 +213,7 @@ List EvaluateVariables(IEnumerable? vars)
try
{
var content = _fileSystem.File.ReadAllText(f, Encoding.UTF8);
- repoSpecificConfig = _appSettingsDeserializer.Deserialize(content);
+ repoSpecificConfig = Deserialize(Path.GetExtension(f), content);
}
catch (Exception)
{
@@ -285,6 +258,26 @@ private bool IsEnabled(string? booleanExpression, bool defaultWhenNullOrEmpty, R
? defaultWhenNullOrEmpty
: _repoExpressionEvaluator.EvaluateBooleanExpression(booleanExpression!, repository);
}
+
+ private RepositoryActionConfiguration Deserialize(string extension, string rawContent)
+ {
+ if (extension.StartsWith("."))
+ {
+ extension = extension.Substring(1);
+ }
+
+ if ("json".Equals(extension, StringComparison.CurrentCultureIgnoreCase))
+ {
+ return _jsonAppSettingsDeserializer.Deserialize(rawContent);
+ }
+
+ if ("yaml".Equals(extension, StringComparison.CurrentCultureIgnoreCase) || "yml".Equals(extension, StringComparison.CurrentCultureIgnoreCase))
+ {
+ return _yamlAppSettingsDeserializer.Deserialize(rawContent);
+ }
+
+ throw new NotImplementedException("Unknown extension");
+ }
}
public class RepositoryTagsConfigurationFactory : IRepositoryTagsFactory
diff --git a/src/RepoM.Api.Common/IO/RepositoryVariableProvider.cs b/src/RepoM.Api.Common/IO/RepositoryVariableProvider.cs
index aac13a57..4da31281 100644
--- a/src/RepoM.Api.Common/IO/RepositoryVariableProvider.cs
+++ b/src/RepoM.Api.Common/IO/RepositoryVariableProvider.cs
@@ -2,6 +2,7 @@ namespace RepoM.Api.Common.IO;
using System;
using System.Linq;
+using ExpressionStringEvaluator.Methods;
using ExpressionStringEvaluator.VariableProviders;
using RepoM.Api.Common.IO.ExpressionEvaluator;
using RepoM.Api.Git;
@@ -13,7 +14,17 @@ public bool CanProvide(string key)
return !string.IsNullOrWhiteSpace(key) && key.StartsWith("Repository.", StringComparison.CurrentCultureIgnoreCase);
}
- public string Provide(RepositoryContext context, string key, string? arg)
+ public CombinedTypeContainer? Provide(string key, string? arg)
+ {
+ throw new NotImplementedException();
+ }
+
+ public CombinedTypeContainer? Provide(RepositoryContext context, string key, string? arg)
+ {
+ return new CombinedTypeContainer(ProvideInner(context, key, arg));
+ }
+
+ private string ProvideInner(RepositoryContext context, string key, string? arg)
{
Repository? repository = context.Repositories.SingleOrDefault();
if (repository == null)
@@ -66,9 +77,4 @@ public string Provide(RepositoryContext context, string key, string? arg)
throw new NotImplementedException();
}
-
- public string Provide(string key, string? arg)
- {
- throw new NotImplementedException();
- }
}
\ No newline at end of file
diff --git a/src/RepoM.Api.Common/RepoM.Api.Common.csproj b/src/RepoM.Api.Common/RepoM.Api.Common.csproj
index 51ebd714..228a1979 100644
--- a/src/RepoM.Api.Common/RepoM.Api.Common.csproj
+++ b/src/RepoM.Api.Common/RepoM.Api.Common.csproj
@@ -5,11 +5,12 @@
-
+
+
diff --git a/src/RepoM.Api.Win/RepoM.Api.Win.csproj b/src/RepoM.Api.Win/RepoM.Api.Win.csproj
index b95dc44f..d2af263a 100644
--- a/src/RepoM.Api.Win/RepoM.Api.Win.csproj
+++ b/src/RepoM.Api.Win/RepoM.Api.Win.csproj
@@ -5,7 +5,7 @@
-
+
diff --git a/src/RepoM.App/App.xaml.cs b/src/RepoM.App/App.xaml.cs
index 47259f21..a655a3a6 100644
--- a/src/RepoM.App/App.xaml.cs
+++ b/src/RepoM.App/App.xaml.cs
@@ -26,18 +26,18 @@ namespace RepoM.App;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionMappers;
+using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Deserialization;
using RepoM.Api.Git;
using RepoM.Api.IO;
using RepoM.Api.Win.IO;
using RepoM.App.i18n;
using RepoM.Ipc;
using SimpleInjector;
-using Repository = RepoM.Ipc.Repository;
///
/// Interaction logic for App.xaml
///
-public partial class App : Application, IRepositorySource
+public partial class App : Application
{
private static Timer? _updateTimer;
private HotKey? _hotkey;
@@ -74,7 +74,7 @@ protected override void OnStartup(StartupEventArgs e)
UseRepositoryMonitor(_container);
_container.Verify(VerificationOption.VerifyAndDiagnose);
- _updateTimer = new Timer(async state => await CheckForUpdatesAsync(), null, 5000, Timeout.Infinite);
+ _updateTimer = new Timer(async _ => await CheckForUpdatesAsync(), null, 5000, Timeout.Infinite);
// We noticed that the hotkey registration causes a high CPU utilization if the window was not shown before.
// To fix this, we need to make the window visible in EnsureWindowHandle() but we set the opacity to 0.0 to prevent flickering
@@ -132,9 +132,9 @@ protected override void OnExit(ExitEventArgs e)
base.OnExit(e);
}
- private void RegisterServices(Container container)
+ private static void RegisterServices(Container container)
{
- container.RegisterInstance(this);
+ container.Register(Lifestyle.Singleton);
container.Register(Lifestyle.Singleton);
container.Register(Lifestyle.Singleton);
@@ -208,7 +208,8 @@ private void RegisterServices(Container container)
Lifestyle.Singleton);
- container.Register(Lifestyle.Singleton);
+ container.Register(Lifestyle.Singleton);
+ container.Register(Lifestyle.Singleton);
container.Register(Lifestyle.Singleton);
@@ -270,19 +271,5 @@ private static void OnHotKeyPressed()
(Application.Current.MainWindow as MainWindow)?.ShowAndActivate();
}
- public Repository[] GetMatchingRepositories(string repositoryNamePattern)
- {
- IRepositoryInformationAggregator aggregator = _container.GetInstance();
- return aggregator.Repositories
- .Where(r => r.MatchesRegexFilter(repositoryNamePattern))
- .Select(r => new Repository(r.Name)
- {
- BranchWithStatus = r.BranchWithStatus,
- HasUnpushedChanges = r.HasUnpushedChanges,
- Path = r.Path,
- })
- .ToArray();
- }
-
public static string? AvailableUpdate { get; private set; }
}
\ No newline at end of file
diff --git a/src/RepoM.App/Converters/UtcToHumanizedLocalDateTimeConverter.cs b/src/RepoM.App/Converters/UtcToHumanizedLocalDateTimeConverter.cs
index 3ee78ffe..1df7363d 100644
--- a/src/RepoM.App/Converters/UtcToHumanizedLocalDateTimeConverter.cs
+++ b/src/RepoM.App/Converters/UtcToHumanizedLocalDateTimeConverter.cs
@@ -7,21 +7,21 @@ namespace RepoM.App.Converters;
public class UtcToHumanizedLocalDateTimeConverter : IValueConverter
{
+ private readonly IHumanizer _humanizer;
+
public UtcToHumanizedLocalDateTimeConverter()
{
- Humanizer = new HardcodededMiniHumanizer();
+ _humanizer = new HardcodededMiniHumanizer();
}
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
DateTime date = DateTime.SpecifyKind(DateTime.Parse(value.ToString() ?? string.Empty), DateTimeKind.Utc).ToLocalTime();
- return Humanizer.HumanizeTimestamp(date);
+ return _humanizer.HumanizeTimestamp(date);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
-
- public IHumanizer Humanizer { get; }
}
\ No newline at end of file
diff --git a/src/RepoM.App/RepoM.App.csproj b/src/RepoM.App/RepoM.App.csproj
index 57074bc6..cc54f032 100644
--- a/src/RepoM.App/RepoM.App.csproj
+++ b/src/RepoM.App/RepoM.App.csproj
@@ -39,7 +39,7 @@
-
+
diff --git a/src/RepoM.Ipc/RepositorySource.cs b/src/RepoM.Ipc/RepositorySource.cs
new file mode 100644
index 00000000..96775ba9
--- /dev/null
+++ b/src/RepoM.Ipc/RepositorySource.cs
@@ -0,0 +1,28 @@
+namespace RepoM.Ipc;
+
+using System.Linq;
+using RepoM.Api.Git;
+
+public class RepositorySource : IRepositorySource
+{
+ private readonly IRepositoryInformationAggregator _repositoryInformationAggregator;
+
+ public RepositorySource(IRepositoryInformationAggregator repositoryInformationAggregator)
+ {
+ _repositoryInformationAggregator = repositoryInformationAggregator;
+ }
+
+ public Repository[] GetMatchingRepositories(string repositoryNamePattern)
+ {
+ return _repositoryInformationAggregator
+ .Repositories
+ .Where(r => r.MatchesRegexFilter(repositoryNamePattern))
+ .Select(r => new Repository(r.Name)
+ {
+ BranchWithStatus = r.BranchWithStatus,
+ HasUnpushedChanges = r.HasUnpushedChanges,
+ Path = r.Path,
+ })
+ .ToArray();
+ }
+}
\ No newline at end of file
diff --git a/src/RepoM.Plugin.WindowsExplorerGitInfo/WindowExplorerBarGitInfoModule.cs b/src/RepoM.Plugin.WindowsExplorerGitInfo/WindowExplorerBarGitInfoModule.cs
index a8366bcc..f51d09e3 100644
--- a/src/RepoM.Plugin.WindowsExplorerGitInfo/WindowExplorerBarGitInfoModule.cs
+++ b/src/RepoM.Plugin.WindowsExplorerGitInfo/WindowExplorerBarGitInfoModule.cs
@@ -22,7 +22,6 @@ public WindowExplorerBarGitInfoModule(WindowsExplorerHandler explorerHandler)
public Task StartAsync()
{
_explorerUpdateTimer.Change(1000, Timeout.Infinite);
- // _explorerUpdateTimer = new Timer(RefreshTimerCallback, null, 1000, Timeout.Infinite);
return Task.CompletedTask;
}
diff --git a/tests/RepoM.Api.Common.Tests/DynamicRepositoryActionDeserializerFactory.cs b/tests/RepoM.Api.Common.Tests/DynamicRepositoryActionDeserializerFactory.cs
index ed8f8ec0..b209eb66 100644
--- a/tests/RepoM.Api.Common.Tests/DynamicRepositoryActionDeserializerFactory.cs
+++ b/tests/RepoM.Api.Common.Tests/DynamicRepositoryActionDeserializerFactory.cs
@@ -2,12 +2,13 @@ namespace RepoM.Api.Common.Tests;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers;
+using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Deserialization;
internal static class DynamicRepositoryActionDeserializerFactory
{
- public static DynamicRepositoryActionDeserializer Create()
+ public static JsonDynamicRepositoryActionDeserializer Create()
{
- return new DynamicRepositoryActionDeserializer(
+ return new JsonDynamicRepositoryActionDeserializer(
new ActionDeserializerComposition(
new IActionDeserializer[]
{
@@ -26,8 +27,8 @@ public static DynamicRepositoryActionDeserializer Create()
}));
}
- public static DynamicRepositoryActionDeserializer CreateWithDeserializer(IActionDeserializer actionDeserializer)
+ public static JsonDynamicRepositoryActionDeserializer CreateWithDeserializer(IActionDeserializer actionDeserializer)
{
- return new DynamicRepositoryActionDeserializer(new ActionDeserializerComposition(new IActionDeserializer[] { actionDeserializer, }));
+ return new JsonDynamicRepositoryActionDeserializer(new ActionDeserializerComposition(new IActionDeserializer[] { actionDeserializer, }));
}
}
\ No newline at end of file
diff --git a/tests/RepoM.Api.Common.Tests/IO/DefaultRepositoryActionProviderTest.cs b/tests/RepoM.Api.Common.Tests/IO/DefaultRepositoryActionProviderTest.cs
index 47d5ada5..9c8ea68d 100644
--- a/tests/RepoM.Api.Common.Tests/IO/DefaultRepositoryActionProviderTest.cs
+++ b/tests/RepoM.Api.Common.Tests/IO/DefaultRepositoryActionProviderTest.cs
@@ -19,6 +19,7 @@ namespace RepoM.Api.Common.Tests.IO;
using RepoM.Api.Common.IO;
using RepoM.Api.Common.IO.ExpressionEvaluator;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider;
+using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Deserialization;
using RepoM.Api.Common.Tests;
using RepoM.Api.Common.Tests.IO.ModuleBasedRepositoryActionProvider;
using RepoM.Api.Git;
@@ -98,50 +99,4 @@ public DefaultRepositoryActionProviderTest()
new SubstringMethod(),
};
}
-
- [Fact(Skip = "refactor")]
- public async Task GetPrimaryAction_ShouldReturnFirstActiveAction_WhenConfigIsValid()
- {
- // arrange
- var repositoryExpressionEvaluator = new RepositoryExpressionEvaluator(_providers, _methods);
- DynamicRepositoryActionDeserializer dynamicRepositoryActionDeserializer = DynamicRepositoryActionDeserializerFactory.Create();
- var sut = new DefaultRepositoryActionProvider(
- _fileSystem,
- new RepositorySpecificConfiguration(
- _fileSystem,
- repositoryExpressionEvaluator,
- ActionMapperCompositionFactory.Create(
- repositoryExpressionEvaluator,
- _translationService,
- _errorHandler,
- _fileSystem,
- _repositoryWriter,
- _repositoryMonitor),
- _translationService,
- _errorHandler,
- new RepositoryConfigurationReader(
- _appDataPathProvider,
- _fileSystem,
- dynamicRepositoryActionDeserializer,
- repositoryExpressionEvaluator)));
- // await using Stream stream = await EasyTestFile.LoadAsStream();
- var repository = new Repository()
- {
- Path = "C:\\",
- Branches = new[] { "develop", "main", },
- LocalBranches = new[] { "develop", },
- RemoteUrls = new[] { "https://github.com/coenm/Repo.git", },
- };
-
- // act
- RepositoryActionBase? result = sut.GetPrimaryAction(repository)!;
-
- // assert
- A.CallTo(_errorHandler).MustNotHaveHappened();
- await Verifier.Verify(new
- {
- result.CanExecute,
- result.ExecutionCausesSynchronizing,
- }).ModifySerialization(s => s.DontIgnoreFalse());
- }
}
\ No newline at end of file
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/AssociateFileV1Test.cs b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/AssociateFileV1Test.cs
index 8aca9d37..9037d291 100644
--- a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/AssociateFileV1Test.cs
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/AssociateFileV1Test.cs
@@ -7,6 +7,7 @@ namespace RepoM.Api.Common.Tests.IO.ModuleBasedRepositoryActionProvider.Action;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data.Actions;
+using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Deserialization;
using VerifyTests;
using VerifyXunit;
using Xunit;
@@ -15,7 +16,7 @@ namespace RepoM.Api.Common.Tests.IO.ModuleBasedRepositoryActionProvider.Action;
[UsesVerify]
public class AssociateFileV1Test
{
- private readonly DynamicRepositoryActionDeserializer _sut;
+ private readonly JsonDynamicRepositoryActionDeserializer _sut;
private readonly EasyTestFileSettings _testFileSettings;
private readonly VerifySettings _verifySettings;
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/BrowseRepositoryV1Test.cs b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/BrowseRepositoryV1Test.cs
index 58baa428..0d7d8afe 100644
--- a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/BrowseRepositoryV1Test.cs
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/BrowseRepositoryV1Test.cs
@@ -7,6 +7,7 @@ namespace RepoM.Api.Common.Tests.IO.ModuleBasedRepositoryActionProvider.Action;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data.Actions;
+using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Deserialization;
using VerifyTests;
using VerifyXunit;
using Xunit;
@@ -15,7 +16,7 @@ namespace RepoM.Api.Common.Tests.IO.ModuleBasedRepositoryActionProvider.Action;
[UsesVerify]
public class BrowseRepositoryV1Test
{
- private readonly DynamicRepositoryActionDeserializer _sut;
+ private readonly JsonDynamicRepositoryActionDeserializer _sut;
private readonly EasyTestFileSettings _testFileSettings;
private readonly VerifySettings _verifySettings;
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/BrowserV1Test.cs b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/BrowserV1Test.cs
index 090e19ba..f4de52e0 100644
--- a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/BrowserV1Test.cs
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/BrowserV1Test.cs
@@ -7,6 +7,7 @@ namespace RepoM.Api.Common.Tests.IO.ModuleBasedRepositoryActionProvider.Action;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data.Actions;
+using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Deserialization;
using VerifyTests;
using VerifyXunit;
using Xunit;
@@ -15,7 +16,7 @@ namespace RepoM.Api.Common.Tests.IO.ModuleBasedRepositoryActionProvider.Action;
[UsesVerify]
public class BrowserV1Test
{
- private readonly DynamicRepositoryActionDeserializer _sut;
+ private readonly JsonDynamicRepositoryActionDeserializer _sut;
private readonly EasyTestFileSettings _testFileSettings;
private readonly VerifySettings _verifySettings;
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/CommandV1Test.cs b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/CommandV1Test.cs
index 3d6b091f..d7933009 100644
--- a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/CommandV1Test.cs
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/CommandV1Test.cs
@@ -7,6 +7,7 @@ namespace RepoM.Api.Common.Tests.IO.ModuleBasedRepositoryActionProvider.Action;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data.Actions;
+using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Deserialization;
using VerifyTests;
using VerifyXunit;
using Xunit;
@@ -15,7 +16,7 @@ namespace RepoM.Api.Common.Tests.IO.ModuleBasedRepositoryActionProvider.Action;
[UsesVerify]
public class CommandV1Test
{
- private readonly DynamicRepositoryActionDeserializer _sut;
+ private readonly JsonDynamicRepositoryActionDeserializer _sut;
private readonly EasyTestFileSettings _testFileSettings;
private readonly VerifySettings _verifySettings;
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/ExecutableV1Test.cs b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/ExecutableV1Test.cs
index 20353681..f167c41a 100644
--- a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/ExecutableV1Test.cs
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/ExecutableV1Test.cs
@@ -7,6 +7,7 @@ namespace RepoM.Api.Common.Tests.IO.ModuleBasedRepositoryActionProvider.Action;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data.Actions;
+using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Deserialization;
using VerifyTests;
using VerifyXunit;
using Xunit;
@@ -15,7 +16,7 @@ namespace RepoM.Api.Common.Tests.IO.ModuleBasedRepositoryActionProvider.Action;
[UsesVerify]
public class ExecutableV1Test
{
- private readonly DynamicRepositoryActionDeserializer _sut;
+ private readonly JsonDynamicRepositoryActionDeserializer _sut;
private readonly EasyTestFileSettings _testFileSettings;
private readonly VerifySettings _verifySettings;
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/FolderV1Test.cs b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/FolderV1Test.cs
index 6967b7b8..ea60a270 100644
--- a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/FolderV1Test.cs
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/FolderV1Test.cs
@@ -7,6 +7,7 @@ namespace RepoM.Api.Common.Tests.IO.ModuleBasedRepositoryActionProvider.Action;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data.Actions;
+using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Deserialization;
using VerifyTests;
using VerifyXunit;
using Xunit;
@@ -15,7 +16,7 @@ namespace RepoM.Api.Common.Tests.IO.ModuleBasedRepositoryActionProvider.Action;
[UsesVerify]
public class FolderV1Test
{
- private readonly DynamicRepositoryActionDeserializer _sut;
+ private readonly JsonDynamicRepositoryActionDeserializer _sut;
private readonly EasyTestFileSettings _testFileSettings;
private readonly VerifySettings _verifySettings;
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/GitCheckoutV1Test.cs b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/GitCheckoutV1Test.cs
index 4976ff16..0a770d6d 100644
--- a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/GitCheckoutV1Test.cs
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/GitCheckoutV1Test.cs
@@ -7,6 +7,7 @@ namespace RepoM.Api.Common.Tests.IO.ModuleBasedRepositoryActionProvider.Action;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data.Actions;
+using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Deserialization;
using VerifyTests;
using VerifyXunit;
using Xunit;
@@ -15,7 +16,7 @@ namespace RepoM.Api.Common.Tests.IO.ModuleBasedRepositoryActionProvider.Action;
[UsesVerify]
public class GitCheckoutV1Test
{
- private readonly DynamicRepositoryActionDeserializer _sut;
+ private readonly JsonDynamicRepositoryActionDeserializer _sut;
private readonly EasyTestFileSettings _testFileSettings;
private readonly VerifySettings _verifySettings;
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/GitFetchV1Test.cs b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/GitFetchV1Test.cs
index c064834a..0a458c55 100644
--- a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/GitFetchV1Test.cs
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/GitFetchV1Test.cs
@@ -7,6 +7,7 @@ namespace RepoM.Api.Common.Tests.IO.ModuleBasedRepositoryActionProvider.Action;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data.Actions;
+using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Deserialization;
using VerifyTests;
using VerifyXunit;
using Xunit;
@@ -15,7 +16,7 @@ namespace RepoM.Api.Common.Tests.IO.ModuleBasedRepositoryActionProvider.Action;
[UsesVerify]
public class GitFetchV1Test
{
- private readonly DynamicRepositoryActionDeserializer _sut;
+ private readonly JsonDynamicRepositoryActionDeserializer _sut;
private readonly EasyTestFileSettings _testFileSettings;
private readonly VerifySettings _verifySettings;
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/GitPullV1Test.cs b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/GitPullV1Test.cs
index ea31e99b..9b717012 100644
--- a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/GitPullV1Test.cs
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/GitPullV1Test.cs
@@ -7,6 +7,7 @@ namespace RepoM.Api.Common.Tests.IO.ModuleBasedRepositoryActionProvider.Action;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data.Actions;
+using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Deserialization;
using VerifyTests;
using VerifyXunit;
using Xunit;
@@ -15,7 +16,7 @@ namespace RepoM.Api.Common.Tests.IO.ModuleBasedRepositoryActionProvider.Action;
[UsesVerify]
public class GitPullV1Test
{
- private readonly DynamicRepositoryActionDeserializer _sut;
+ private readonly JsonDynamicRepositoryActionDeserializer _sut;
private readonly EasyTestFileSettings _testFileSettings;
private readonly VerifySettings _verifySettings;
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/GitPushV1Test.cs b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/GitPushV1Test.cs
index 7c47fb14..1aed9849 100644
--- a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/GitPushV1Test.cs
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/GitPushV1Test.cs
@@ -7,6 +7,7 @@ namespace RepoM.Api.Common.Tests.IO.ModuleBasedRepositoryActionProvider.Action;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data.Actions;
+using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Deserialization;
using VerifyTests;
using VerifyXunit;
using Xunit;
@@ -15,7 +16,7 @@ namespace RepoM.Api.Common.Tests.IO.ModuleBasedRepositoryActionProvider.Action;
[UsesVerify]
public class GitPushV1Test
{
- private readonly DynamicRepositoryActionDeserializer _sut;
+ private readonly JsonDynamicRepositoryActionDeserializer _sut;
private readonly EasyTestFileSettings _testFileSettings;
private readonly VerifySettings _verifySettings;
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/IgnoreRepositoriesV1Test.cs b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/IgnoreRepositoriesV1Test.cs
index 9f32f4f9..0b0ff0d9 100644
--- a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/IgnoreRepositoriesV1Test.cs
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/IgnoreRepositoriesV1Test.cs
@@ -7,6 +7,7 @@ namespace RepoM.Api.Common.Tests.IO.ModuleBasedRepositoryActionProvider.Action;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data.Actions;
+using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Deserialization;
using VerifyTests;
using VerifyXunit;
using Xunit;
@@ -15,7 +16,7 @@ namespace RepoM.Api.Common.Tests.IO.ModuleBasedRepositoryActionProvider.Action;
[UsesVerify]
public class IgnoreRepositoriesV1Test
{
- private readonly DynamicRepositoryActionDeserializer _sut;
+ private readonly JsonDynamicRepositoryActionDeserializer _sut;
private readonly EasyTestFileSettings _testFileSettings;
private readonly VerifySettings _verifySettings;
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/SeparatorV1Test.cs b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/SeparatorV1Test.cs
index 58b8c5a5..55086b2c 100644
--- a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/SeparatorV1Test.cs
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/SeparatorV1Test.cs
@@ -7,6 +7,7 @@ namespace RepoM.Api.Common.Tests.IO.ModuleBasedRepositoryActionProvider.Action;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data.Actions;
+using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Deserialization;
using VerifyTests;
using VerifyXunit;
using Xunit;
@@ -15,7 +16,7 @@ namespace RepoM.Api.Common.Tests.IO.ModuleBasedRepositoryActionProvider.Action;
[UsesVerify]
public class SeparatorV1Test
{
- private readonly DynamicRepositoryActionDeserializer _sut;
+ private readonly JsonDynamicRepositoryActionDeserializer _sut;
private readonly EasyTestFileSettings _testFileSettings;
private readonly VerifySettings _verifySettings;
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/Verified/AssociateFileV1Test.Deserialize_AssociateFile1.verified.txt b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/Verified/AssociateFileV1Test.Deserialize_AssociateFile1.verified.txt
index 606d426c..58818c52 100644
--- a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/Verified/AssociateFileV1Test.Deserialize_AssociateFile1.verified.txt
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/Verified/AssociateFileV1Test.Deserialize_AssociateFile1.verified.txt
@@ -9,7 +9,7 @@
Arguments: a b c,
Type: associate-file@1,
Name: Goto google.com,
- Active: False
+ Active: false
}
]
}
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/Verified/BrowseRepositoryV1Test.Deserialize_ActionBrowseRepositoryRepositoryV1.verified.txt b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/Verified/BrowseRepositoryV1Test.Deserialize_ActionBrowseRepositoryRepositoryV1.verified.txt
index 54c1cd1d..f6a29837 100644
--- a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/Verified/BrowseRepositoryV1Test.Deserialize_ActionBrowseRepositoryRepositoryV1.verified.txt
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/Verified/BrowseRepositoryV1Test.Deserialize_ActionBrowseRepositoryRepositoryV1.verified.txt
@@ -4,13 +4,13 @@
Actions: [
{
$type: RepositoryActionBrowseRepositoryV1,
- FirstOnly: True,
+ FirstOnly: true,
Type: browse-repository@1,
Name: fo true
},
{
$type: RepositoryActionBrowseRepositoryV1,
- FirstOnly: False,
+ FirstOnly: false,
Type: browse-repository@1,
Name: fo false
},
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/Verified/BrowserV1Test.Deserialize_ActionBrowserV1.verified.txt b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/Verified/BrowserV1Test.Deserialize_ActionBrowserV1.verified.txt
index f2425980..b9a44865 100644
--- a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/Verified/BrowserV1Test.Deserialize_ActionBrowserV1.verified.txt
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Action/Verified/BrowserV1Test.Deserialize_ActionBrowserV1.verified.txt
@@ -7,7 +7,7 @@
Url: https://google.com,
Type: browser@1,
Name: Goto google.com,
- Active: False
+ Active: false
}
]
}
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/DynamicRepositoryActionDeserializerTest.cs b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/DynamicRepositoryActionDeserializerTest.cs
index d82fb8b7..fb43ca2d 100644
--- a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/DynamicRepositoryActionDeserializerTest.cs
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/DynamicRepositoryActionDeserializerTest.cs
@@ -1,28 +1,37 @@
namespace RepoM.Api.Common.Tests.IO.ModuleBasedRepositoryActionProvider;
using System;
+using System.Dynamic;
using System.Threading.Tasks;
using EasyTestFile;
using EasyTestFileXunit;
using FluentAssertions;
using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Data;
+using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Deserialization;
using VerifyTests;
using VerifyXunit;
using Xunit;
+using Xunit.Abstractions;
+using XunitEnumMemberData;
[UsesEasyTestFile]
[UsesVerify]
public class DynamicRepositoryActionDeserializerTest
{
- private readonly DynamicRepositoryActionDeserializer _sut;
+ private readonly ITestOutputHelper _outputHelper;
+ private readonly JsonDynamicRepositoryActionDeserializer _sutJson;
private readonly EasyTestFileSettings _testFileSettings;
private readonly VerifySettings _verifySettings;
+ private readonly YamlDynamicRepositoryActionDeserializer _sutYaml;
- public DynamicRepositoryActionDeserializerTest()
+ public DynamicRepositoryActionDeserializerTest(ITestOutputHelper outputHelper)
{
- _sut = DynamicRepositoryActionDeserializerFactory.Create();
+ _outputHelper = outputHelper ?? throw new ArgumentNullException(nameof(outputHelper));
+ _sutJson = DynamicRepositoryActionDeserializerFactory.Create();
+ _sutYaml = new YamlDynamicRepositoryActionDeserializer(_sutJson);
_testFileSettings = new EasyTestFileSettings();
_testFileSettings.UseDirectory("TestFiles");
@@ -32,242 +41,309 @@ public DynamicRepositoryActionDeserializerTest()
_verifySettings.UseDirectory("Verified");
}
- [Fact]
- public async Task Deserialize_ShouldReturnEmptyObject_WhenContentIsEmptyJson()
+ private RepositoryActionConfiguration SutDeserialize(string rawContent, SerializationType type)
+ {
+ if (type == SerializationType.Json)
+ {
+ var expConverter = new ExpandoObjectConverter();
+ dynamic deserializedObject = JsonConvert.DeserializeObject(rawContent, expConverter)!;
+
+ var serializer = new YamlDotNet.Serialization.Serializer();
+ string yaml = serializer.Serialize(deserializedObject);
+
+ _outputHelper.WriteLine(string.Empty);
+ _outputHelper.WriteLine("----------------------------------------");
+ _outputHelper.WriteLine(rawContent);
+ _outputHelper.WriteLine("----------------------------------------");
+ _outputHelper.WriteLine(string.Empty);
+ _outputHelper.WriteLine("----------------------------------------");
+ _outputHelper.WriteLine(yaml);
+ _outputHelper.WriteLine("----------------------------------------");
+ _outputHelper.WriteLine(string.Empty);
+ }
+
+ return type switch
+ {
+ SerializationType.Json => _sutJson.Deserialize(rawContent),
+ SerializationType.Yaml => _sutYaml.Deserialize(rawContent),
+ _ => throw new ArgumentOutOfRangeException(nameof(type), type, null)
+ };
+ }
+
+ [Theory]
+ [EnumMemberData(typeof(SerializationType))]
+ public async Task Deserialize_ShouldReturnEmptyObject_WhenContentIsEmpty(SerializationType type)
{
// arrange
- _testFileSettings.UseFileName("EmptyJson");
- var content = await EasyTestFile.LoadAsText(_testFileSettings);
+ _testFileSettings.UseFileName("Empty");
+ var content = await EasyTestFile.LoadAsText(_testFileSettings.SetExtension(type));
// act
- var result = _sut.Deserialize(content);
+ RepositoryActionConfiguration result = SutDeserialize(content, type);
// assert
- await Verifier.Verify(result, _verifySettings);
+ await Verifier.Verify(result, _verifySettings).IgnoreParametersForVerified(type);
}
- [Fact]
- public async Task Deserialize_ShouldReturnObjectWithVariables_WhenContentIsVariablesOnly()
+ [Theory]
+ [EnumMemberData(typeof(SerializationType))]
+ public async Task Deserialize_ShouldReturnEmptyObject_WhenVersionIsUnknown(SerializationType type)
+ {
+ // arrange
+ _testFileSettings.UseFileName("Version100");
+ var content = await EasyTestFile.LoadAsText(_testFileSettings.SetExtension(type));
+
+ // act
+ RepositoryActionConfiguration result = SutDeserialize(content, type);
+
+ // assert
+ await Verifier.Verify(result, _verifySettings).IgnoreParametersForVerified(type);
+ }
+
+ [Theory]
+ [EnumMemberData(typeof(SerializationType))]
+ public async Task Deserialize_ShouldReturnObjectWithVariables_WhenContentIsVariablesOnly(SerializationType type)
{
// arrange
_testFileSettings.UseFileName("VariablesOnly1");
- var content = await EasyTestFile.LoadAsText(_testFileSettings);
+ var content = await EasyTestFile.LoadAsText(_testFileSettings.SetExtension(type));
// act
- var result = _sut.Deserialize(content);
+ RepositoryActionConfiguration result = SutDeserialize(content, type);
// assert
- await Verifier.Verify(result, _verifySettings);
+ await Verifier.Verify(result, _verifySettings).IgnoreParametersForVerified(type);
}
- [Fact]
- public async Task Deserialize_ShouldReturnObjectWithRepositoryTags_WhenContentIsRepositoryTags1()
+ [Theory]
+ [EnumMemberData(typeof(SerializationType))]
+ public async Task Deserialize_ShouldReturnObjectWithRepositoryTags_WhenContentIsRepositoryTags1(SerializationType type)
{
// arrange
_testFileSettings.UseFileName("RepositoryTags1");
- var content = await EasyTestFile.LoadAsText(_testFileSettings);
+ var content = await EasyTestFile.LoadAsText(_testFileSettings.SetExtension(type));
// act
- var result = _sut.Deserialize(content);
+ RepositoryActionConfiguration result = SutDeserialize(content, type);
// assert
- await Verifier.Verify(result, _verifySettings);
+ await Verifier.Verify(result, _verifySettings).IgnoreParametersForVerified(type);
}
- [Fact]
- public async Task Deserialize_ShouldReturnObjectWithLatestTags_WhenContentHasDoubleTags()
+ [Theory]
+ [EnumMemberData(typeof(SerializationType))]
+ public async Task Deserialize_ShouldReturnObjectWithLatestTags_WhenContentHasDoubleTags(SerializationType type)
{
// arrange
_testFileSettings.UseFileName("RepositoryTagsDouble");
- var content = await EasyTestFile.LoadAsText(_testFileSettings);
+ var content = await EasyTestFile.LoadAsText(_testFileSettings.SetExtension(type));
// act
- var result = _sut.Deserialize(content);
+ RepositoryActionConfiguration result = SutDeserialize(content, type);
// assert
- await Verifier.Verify(result, _verifySettings);
+ await Verifier.Verify(result, _verifySettings).IgnoreParametersForVerified(type);
}
- [Fact]
- public async Task Deserialize_ShouldReturnObjectWithRepositoryTags_WhenContentIsRepositoryTags2()
+ [Theory]
+ [EnumMemberData(typeof(SerializationType))]
+ public async Task Deserialize_ShouldReturnObjectWithRepositoryTags_WhenContentIsRepositoryTags2(SerializationType type)
{
// arrange
_testFileSettings.UseFileName("RepositoryTags2");
- var content = await EasyTestFile.LoadAsText(_testFileSettings);
+ var content = await EasyTestFile.LoadAsText(_testFileSettings.SetExtension(type));
// act
- var result = _sut.Deserialize(content);
+ RepositoryActionConfiguration result = SutDeserialize(content, type);
// assert
- await Verifier.Verify(result, _verifySettings).UseMethodName(nameof(Deserialize_ShouldReturnObjectWithRepositoryTags_WhenContentIsRepositoryTags1));
+ await Verifier.Verify(result, _verifySettings)
+ .UseMethodName(nameof(Deserialize_ShouldReturnObjectWithRepositoryTags_WhenContentIsRepositoryTags1))
+ .IgnoreParametersForVerified(type);
}
- [Fact]
- public async Task Deserialize_ShouldReturnObjectWithRepositoryTags_WhenContentIsRepositoryTags3()
+ [Theory]
+ [EnumMemberData(typeof(SerializationType))]
+ public async Task Deserialize_ShouldReturnObjectWithRepositoryTags_WhenContentIsRepositoryTags3(SerializationType type)
{
// arrange
_testFileSettings.UseFileName("RepositoryTags3");
- var content = await EasyTestFile.LoadAsText(_testFileSettings);
+ var content = await EasyTestFile.LoadAsText(_testFileSettings.SetExtension(type));
// act
- var result = _sut.Deserialize(content);
+ RepositoryActionConfiguration result = SutDeserialize(content, type);
// assert
- await Verifier.Verify(result, _verifySettings);
+ await Verifier.Verify(result, _verifySettings).IgnoreParametersForVerified(type);
}
- [Fact]
- public async Task Deserialize_ShouldReturnObjectWithRepositoryActions_WhenContentIsRepositoryActions1()
+ [Theory]
+ [EnumMemberData(typeof(SerializationType))]
+ public async Task Deserialize_ShouldReturnObjectWithRepositoryActions_WhenContentIsRepositoryActions1(SerializationType type)
{
// arrange
_testFileSettings.UseFileName("RepositoryActions1");
- var content = await EasyTestFile.LoadAsText(_testFileSettings);
+ var content = await EasyTestFile.LoadAsText(_testFileSettings.SetExtension(type));
// act
- var result = _sut.Deserialize(content);
+ RepositoryActionConfiguration result = SutDeserialize(content, type);
// assert
- await Verifier.Verify(result, _verifySettings);
+ await Verifier.Verify(result, _verifySettings).IgnoreParametersForVerified(type);
}
- [Fact]
- public async Task Deserialize_ShouldReturnObjectWithRepositoryActions_WhenContentIsRepositoryActions2()
+ [Theory]
+ [EnumMemberData(typeof(SerializationType))]
+ public async Task Deserialize_ShouldReturnObjectWithRepositoryActions_WhenContentIsRepositoryActions2(SerializationType type)
{
// arrange
_testFileSettings.UseFileName("RepositoryActions2");
- var content = await EasyTestFile.LoadAsText(_testFileSettings);
+ var content = await EasyTestFile.LoadAsText(_testFileSettings.SetExtension(type));
// act
- var result = _sut.Deserialize(content);
+ RepositoryActionConfiguration result = SutDeserialize(content, type);
// assert
- await Verifier.Verify(result, _verifySettings).UseMethodName(nameof(Deserialize_ShouldReturnObjectWithRepositoryActions_WhenContentIsRepositoryActions1));
+ await Verifier.Verify(result, _verifySettings)
+ .IgnoreParametersForVerified(type)
+ .UseMethodName(nameof(Deserialize_ShouldReturnObjectWithRepositoryActions_WhenContentIsRepositoryActions1));
}
-
- [Fact]
- public async Task Deserialize_ShouldReturnObjectWithRepositoryActions_WhenContentIsRepositoryActions3()
+
+ [Theory]
+ [EnumMemberData(typeof(SerializationType))]
+ public async Task Deserialize_ShouldReturnObjectWithRepositoryActions_WhenContentIsRepositoryActions3(SerializationType type)
{
// arrange
_testFileSettings.UseFileName("RepositoryActions3");
- var content = await EasyTestFile.LoadAsText(_testFileSettings);
+ var content = await EasyTestFile.LoadAsText(_testFileSettings.SetExtension(type));
// act
- var result = _sut.Deserialize(content);
+ RepositoryActionConfiguration result = SutDeserialize(content, type);
// assert
- await Verifier.Verify(result, _verifySettings);
+ await Verifier.Verify(result, _verifySettings).IgnoreParametersForVerified(type);
}
- [Fact]
- public async Task Deserialize_ShouldReturnObjectWithRedirect_WhenContentIsRedirect1()
+ [Theory]
+ [EnumMemberData(typeof(SerializationType))]
+ public async Task Deserialize_ShouldReturnObjectWithRedirect_WhenContentIsRedirect1(SerializationType type)
{
// arrange
_testFileSettings.UseFileName("Redirect1");
- var content = await EasyTestFile.LoadAsText(_testFileSettings);
+ var content = await EasyTestFile.LoadAsText(_testFileSettings.SetExtension(type));
// act
- var result = _sut.Deserialize(content);
+ RepositoryActionConfiguration result = SutDeserialize(content, type);
// assert
- await Verifier.Verify(result, _verifySettings);
+ await Verifier.Verify(result, _verifySettings).IgnoreParametersForVerified(type);
}
- [Fact]
- public async Task Deserialize_ShouldReturnObjectWithRedirect_WhenContentIsRedirect2()
+ [Theory]
+ [EnumMemberData(typeof(SerializationType))]
+ public async Task Deserialize_ShouldReturnObjectWithRedirect_WhenContentIsRedirect2(SerializationType type)
{
// arrange
_testFileSettings.UseFileName("Redirect2");
- var content = await EasyTestFile.LoadAsText(_testFileSettings);
+ var content = await EasyTestFile.LoadAsText(_testFileSettings.SetExtension(type));
// act
- var result = _sut.Deserialize(content);
+ RepositoryActionConfiguration result = SutDeserialize(content, type);
// assert
- await Verifier.Verify(result, _verifySettings).UseMethodName(nameof(Deserialize_ShouldReturnObjectWithRedirect_WhenContentIsRedirect1));
+ await Verifier.Verify(result, _verifySettings)
+ .IgnoreParametersForVerified(type)
+ .UseMethodName(nameof(Deserialize_ShouldReturnObjectWithRedirect_WhenContentIsRedirect1));
}
- [Fact]
- public async Task Deserialize_ShouldReturnObjectWithRedirect_WhenContentIsRedirect3()
+ [Theory]
+ [EnumMemberData(typeof(SerializationType))]
+ public async Task Deserialize_ShouldReturnObjectWithRedirect_WhenContentIsRedirect3(SerializationType type)
{
// arrange
_testFileSettings.UseFileName("Redirect3");
- var content = await EasyTestFile.LoadAsText(_testFileSettings);
+ var content = await EasyTestFile.LoadAsText(_testFileSettings.SetExtension(type));
// act
- var result = _sut.Deserialize(content);
+ RepositoryActionConfiguration result = SutDeserialize(content, type);
// assert
- await Verifier.Verify(result, _verifySettings);
+ await Verifier.Verify(result, _verifySettings).IgnoreParametersForVerified(type);
}
- [Fact]
- public async Task Deserialize_ShouldReturnObject_WhenContentIsRepositorySpecificEnvFile1()
+ [Theory]
+ [EnumMemberData(typeof(SerializationType))]
+ public async Task Deserialize_ShouldReturnObject_WhenContentIsRepositorySpecificEnvFile1(SerializationType type)
{
// arrange
_testFileSettings.UseFileName("RepositorySpecificEnvFile1");
- var content = await EasyTestFile.LoadAsText(_testFileSettings);
+ var content = await EasyTestFile.LoadAsText(_testFileSettings.SetExtension(type));
// act
- var result = _sut.Deserialize(content);
+ RepositoryActionConfiguration result = SutDeserialize(content, type);
// assert
- await Verifier.Verify(result, _verifySettings);
+ await Verifier.Verify(result, _verifySettings).IgnoreParametersForVerified(type);
}
- [Fact]
- public async Task Deserialize_ShouldReturnObject_WhenContentIsRepositorySpecificConfigFile1()
+ [Theory]
+ [EnumMemberData(typeof(SerializationType))]
+ public async Task Deserialize_ShouldReturnObject_WhenContentIsRepositorySpecificConfigFile1(SerializationType type)
{
// arrange
_testFileSettings.UseFileName("RepositorySpecificConfigFile1");
- var content = await EasyTestFile.LoadAsText(_testFileSettings);
+ var content = await EasyTestFile.LoadAsText(_testFileSettings.SetExtension(type));
// act
- var result = _sut.Deserialize(content);
+ RepositoryActionConfiguration result = SutDeserialize(content, type);
// assert
- await Verifier.Verify(result, _verifySettings);
+ await Verifier.Verify(result, _verifySettings).IgnoreParametersForVerified(type);
}
- [Fact]
- public async Task Deserialize_Sample1()
+ [Theory]
+ [EnumMemberData(typeof(SerializationType))]
+ public async Task Deserialize_Sample1(SerializationType type)
{
// arrange
_testFileSettings.UseFileName("Sample1");
- var content = await EasyTestFile.LoadAsText(_testFileSettings);
+ var content = await EasyTestFile.LoadAsText(_testFileSettings.SetExtension(type));
// act
- var result = _sut.Deserialize(content);
+ RepositoryActionConfiguration result = SutDeserialize(content, type);
// assert
- await Verifier.Verify(result, _verifySettings);
+ await Verifier.Verify(result, _verifySettings).IgnoreParametersForVerified(type);
}
- [Fact]
- public async Task Deserialize_Sample2()
+ [Theory]
+ [EnumMemberData(typeof(SerializationType))]
+ public async Task Deserialize_Sample2(SerializationType type)
{
// arrange
_testFileSettings.UseFileName("Sample2");
- var content = await EasyTestFile.LoadAsText(_testFileSettings);
+ var content = await EasyTestFile.LoadAsText(_testFileSettings.SetExtension(type));
// act
- var result = _sut.Deserialize(content);
+ RepositoryActionConfiguration result = SutDeserialize(content, type);
// assert
- await Verifier.Verify(result, _verifySettings);
+ await Verifier.Verify(result, _verifySettings).IgnoreParametersForVerified(type);
}
- [Fact]
- public async Task Deserialize_Sample3()
+ [Theory]
+ [EnumMemberData(typeof(SerializationType))]
+ public async Task Deserialize_Sample3(SerializationType type)
{
// arrange
_testFileSettings.UseFileName("Sample3");
- var content = await EasyTestFile.LoadAsText(_testFileSettings);
+ var content = await EasyTestFile.LoadAsText(_testFileSettings.SetExtension(type));
// act
- var result = _sut.Deserialize(content);
+ RepositoryActionConfiguration result = SutDeserialize(content, type);
// assert
- await Verifier.Verify(result, _verifySettings);
+ await Verifier.Verify(result, _verifySettings).IgnoreParametersForVerified(type);
}
[Fact]
@@ -276,7 +352,7 @@ public void EmptyFile_ShouldThrow()
// arrange
// act
- Func act = () => _ = _sut.Deserialize(string.Empty);
+ Func act = () => _ = _sutJson.Deserialize(string.Empty);
// assert
_ = act.Should().Throw().WithMessage("Error reading JObject from JsonReader. Path '', line 0, position 0.");
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/EasyTestFileSettingsExtensions.cs b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/EasyTestFileSettingsExtensions.cs
new file mode 100644
index 00000000..8a2702eb
--- /dev/null
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/EasyTestFileSettingsExtensions.cs
@@ -0,0 +1,25 @@
+namespace RepoM.Api.Common.Tests.IO.ModuleBasedRepositoryActionProvider;
+
+using EasyTestFile;
+
+internal static class EasyTestFileSettingsExtensions
+{
+ public static EasyTestFileSettings SetExtension(this EasyTestFileSettings @this, SerializationType type)
+ {
+ var result = new EasyTestFileSettings(@this);
+ switch (type)
+ {
+ case SerializationType.Json:
+ result.UseExtension("json");
+ break;
+ case SerializationType.Yaml:
+ result.UseExtension("yaml");
+ break;
+ default:
+ // do nothing
+ break;
+ }
+
+ return result;
+ }
+}
\ No newline at end of file
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/RepositorySpecificConfigurationTest.cs b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/RepositorySpecificConfigurationTest.cs
index bc69896c..2b18381b 100644
--- a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/RepositorySpecificConfigurationTest.cs
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/RepositorySpecificConfigurationTest.cs
@@ -24,6 +24,7 @@ namespace RepoM.Api.Common.Tests.IO.ModuleBasedRepositoryActionProvider;
using RepoM.Api.Common.IO.ExpressionEvaluator;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider;
using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.ActionMappers;
+using RepoM.Api.Common.IO.ModuleBasedRepositoryActionProvider.Deserialization;
using RepoM.Api.Git;
using RepoM.Api.IO;
using VerifyTests;
@@ -36,7 +37,8 @@ public class RepositorySpecificConfigurationTest
{
private readonly IAppDataPathProvider _appDataPathProvider;
private readonly MockFileSystem _fileSystem;
- private readonly DynamicRepositoryActionDeserializer _appsettingsDeserializer;
+ private readonly JsonDynamicRepositoryActionDeserializer _jsonAppsettingsDeserializer;
+ private readonly YamlDynamicRepositoryActionDeserializer _yamlAppsettingsDeserializer;
private readonly EasyTestFileSettings _testFileSettings;
private readonly VerifySettings _verifySettings;
private readonly string _tempPath;
@@ -60,7 +62,8 @@ public RepositorySpecificConfigurationTest()
_appDataPathProvider = A.Fake();
A.CallTo(() => _appDataPathProvider.GetAppDataPath()).Returns(_tempPath);
- _appsettingsDeserializer = DynamicRepositoryActionDeserializerFactory.Create();
+ _jsonAppsettingsDeserializer = DynamicRepositoryActionDeserializerFactory.Create();
+ _yamlAppsettingsDeserializer = new YamlDynamicRepositoryActionDeserializer(_jsonAppsettingsDeserializer);
var dateTimeTimeVariableProviderOptions = new DateTimeVariableProviderOptions()
{
@@ -136,7 +139,7 @@ public async Task Create_ShouldRespectMultiSelectRepos()
// arrange
_testFileSettings.UseFileName("RepositoryActionsMultiSelect");
var content = await EasyTestFile.LoadAsText(_testFileSettings);
- _fileSystem.AddFile(Path.Combine(_tempPath, RepositoryConfigurationReader.FILENAME), new MockFileData(content, Encoding.UTF8));
+ _fileSystem.AddFile(Path.Combine(_tempPath, RepositoryConfigurationReader.FILENAME_JSON), new MockFileData(content, Encoding.UTF8));
var sut = new RepositorySpecificConfiguration(
_fileSystem,
_repositoryExpressionEvaluator,
@@ -146,7 +149,8 @@ public async Task Create_ShouldRespectMultiSelectRepos()
new RepositoryConfigurationReader(
_appDataPathProvider,
_fileSystem,
- _appsettingsDeserializer,
+ _jsonAppsettingsDeserializer,
+ _yamlAppsettingsDeserializer,
_repositoryExpressionEvaluator));
// act
@@ -162,7 +166,7 @@ public async Task Create_ShouldNotCareAboutMultiSelectRepos_WhenSingleRepo()
// arrange
_testFileSettings.UseFileName("RepositoryActionsMultiSelect");
var content = await EasyTestFile.LoadAsText(_testFileSettings);
- _fileSystem.AddFile(Path.Combine(_tempPath, RepositoryConfigurationReader.FILENAME), new MockFileData(content, Encoding.UTF8));
+ _fileSystem.AddFile(Path.Combine(_tempPath, RepositoryConfigurationReader.FILENAME_JSON), new MockFileData(content, Encoding.UTF8));
var sut = new RepositorySpecificConfiguration(
_fileSystem,
_repositoryExpressionEvaluator,
@@ -172,7 +176,8 @@ public async Task Create_ShouldNotCareAboutMultiSelectRepos_WhenSingleRepo()
new RepositoryConfigurationReader(
_appDataPathProvider,
_fileSystem,
- _appsettingsDeserializer,
+ _jsonAppsettingsDeserializer,
+ _yamlAppsettingsDeserializer,
_repositoryExpressionEvaluator));
// act
@@ -188,7 +193,7 @@ public async Task Create_ShouldOnlyProcessActiveItems()
// arrange
_testFileSettings.UseFileName("RepositoryActions1");
var content = await EasyTestFile.LoadAsText(_testFileSettings);
- _fileSystem.AddFile(Path.Combine(_tempPath, RepositoryConfigurationReader.FILENAME), new MockFileData(content, Encoding.UTF8));
+ _fileSystem.AddFile(Path.Combine(_tempPath, RepositoryConfigurationReader.FILENAME_JSON), new MockFileData(content, Encoding.UTF8));
var sut = new RepositorySpecificConfiguration(
_fileSystem,
_repositoryExpressionEvaluator,
@@ -198,7 +203,8 @@ public async Task Create_ShouldOnlyProcessActiveItems()
new RepositoryConfigurationReader(
_appDataPathProvider,
_fileSystem,
- _appsettingsDeserializer,
+ _jsonAppsettingsDeserializer,
+ _yamlAppsettingsDeserializer,
_repositoryExpressionEvaluator));
// act
@@ -214,7 +220,7 @@ public async Task Create_ShouldProcessSeparator1()
// arrange
_testFileSettings.UseFileName("RepositoryActionsWithSeparator1");
var content = await EasyTestFile.LoadAsText(_testFileSettings);
- _fileSystem.AddFile(Path.Combine(_tempPath, RepositoryConfigurationReader.FILENAME), new MockFileData(content, Encoding.UTF8));
+ _fileSystem.AddFile(Path.Combine(_tempPath, RepositoryConfigurationReader.FILENAME_JSON), new MockFileData(content, Encoding.UTF8));
var sut = new RepositorySpecificConfiguration(
_fileSystem,
_repositoryExpressionEvaluator,
@@ -224,7 +230,8 @@ public async Task Create_ShouldProcessSeparator1()
new RepositoryConfigurationReader(
_appDataPathProvider,
_fileSystem,
- _appsettingsDeserializer,
+ _jsonAppsettingsDeserializer,
+ _yamlAppsettingsDeserializer,
_repositoryExpressionEvaluator));
// act
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/SerializationType.cs b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/SerializationType.cs
new file mode 100644
index 00000000..86d6a5e9
--- /dev/null
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/SerializationType.cs
@@ -0,0 +1,8 @@
+namespace RepoM.Api.Common.Tests.IO.ModuleBasedRepositoryActionProvider;
+
+public enum SerializationType
+{
+ Json,
+
+ Yaml,
+}
\ No newline at end of file
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/EmptyJson.testfile.json b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Empty.testfile.json
similarity index 100%
rename from tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/EmptyJson.testfile.json
rename to tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Empty.testfile.json
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Empty.testfile.yaml b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Empty.testfile.yaml
new file mode 100644
index 00000000..7a73a41b
--- /dev/null
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Empty.testfile.yaml
@@ -0,0 +1,2 @@
+{
+}
\ No newline at end of file
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Redirect1.testfile.yaml b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Redirect1.testfile.yaml
new file mode 100644
index 00000000..06c365e5
--- /dev/null
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Redirect1.testfile.yaml
@@ -0,0 +1 @@
+redirect: filename.txt
\ No newline at end of file
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Redirect2.testfile.yaml b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Redirect2.testfile.yaml
new file mode 100644
index 00000000..479ccf09
--- /dev/null
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Redirect2.testfile.yaml
@@ -0,0 +1,2 @@
+redirect:
+ filename: filename.txt
\ No newline at end of file
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Redirect3.testfile.yaml b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Redirect3.testfile.yaml
new file mode 100644
index 00000000..e98b0504
--- /dev/null
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Redirect3.testfile.yaml
@@ -0,0 +1,3 @@
+redirect:
+ filename: filename.txt
+ enabled: true
\ No newline at end of file
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/RepositoryActions1.testfile.yaml b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/RepositoryActions1.testfile.yaml
new file mode 100644
index 00000000..ea55212b
--- /dev/null
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/RepositoryActions1.testfile.yaml
@@ -0,0 +1,11 @@
+repository-actions:
+- type: browser@1
+ name: '{OpenIn} Windows File Explorer'
+ active: false
+ multi-select-enabled: true
+ variables:
+ - name: name
+ value: '{StringContains({Repository.SafePath}, "abc")}'
+- type: browser@1
+ name: '{OpenIn} Windows File Explorer'
+ active: false
\ No newline at end of file
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/RepositoryActions2.testfile.yaml b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/RepositoryActions2.testfile.yaml
new file mode 100644
index 00000000..6dbe2288
--- /dev/null
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/RepositoryActions2.testfile.yaml
@@ -0,0 +1,12 @@
+repository-actions:
+ actions:
+ - type: browser@1
+ name: '{OpenIn} Windows File Explorer'
+ active: false
+ multi-select-enabled: true
+ variables:
+ - name: name
+ value: '{StringContains({Repository.SafePath}, "abc")}'
+ - type: browser@1
+ name: '{OpenIn} Windows File Explorer'
+ active: false
\ No newline at end of file
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/RepositoryActions3.testfile.yaml b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/RepositoryActions3.testfile.yaml
new file mode 100644
index 00000000..2a67f791
--- /dev/null
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/RepositoryActions3.testfile.yaml
@@ -0,0 +1,20 @@
+repository-actions:
+ variables:
+ - name: work_repo
+ value: '{StringContains({Repository.SafePath}, "work")}'
+ enabled: true
+ - name: work_repo_1
+ value: true
+ enabled: false
+ actions:
+ - type: browser@1
+ name: '{OpenIn} Windows File Explorer'
+ active: false
+ multi-select-enabled: true
+ variables:
+ - name: name
+ value: '{StringContains({Repository.SafePath}, "abc")}'
+ url: https://google.com
+ - type: browser@1
+ name: '{OpenIn} Windows File Explorer'
+ active: false
\ No newline at end of file
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/RepositorySpecificConfigFile1.testfile.yaml b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/RepositorySpecificConfigFile1.testfile.yaml
new file mode 100644
index 00000000..cb154b9f
--- /dev/null
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/RepositorySpecificConfigFile1.testfile.yaml
@@ -0,0 +1,4 @@
+repository-specific-config-files:
+- filename: ab1.env
+ when: false
+- filename: ab.env
\ No newline at end of file
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/RepositorySpecificEnvFile1.testfile.yaml b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/RepositorySpecificEnvFile1.testfile.yaml
new file mode 100644
index 00000000..e317e805
--- /dev/null
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/RepositorySpecificEnvFile1.testfile.yaml
@@ -0,0 +1,4 @@
+repository-specific-env-files:
+- filename: ab1.env
+ when: false
+- filename: ab.env
\ No newline at end of file
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/RepositoryTags1.testfile.yaml b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/RepositoryTags1.testfile.yaml
new file mode 100644
index 00000000..898d5f1f
--- /dev/null
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/RepositoryTags1.testfile.yaml
@@ -0,0 +1,6 @@
+repository-tags:
+- tag: work
+ when: '{StringContains({Repository.SafePath}, "work")}'
+- tag: private
+ when: '{StringContains({Repository.SafePath}, "Private")}'
+- tag: always-tag
\ No newline at end of file
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/RepositoryTags2.testfile.yaml b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/RepositoryTags2.testfile.yaml
new file mode 100644
index 00000000..a6246136
--- /dev/null
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/RepositoryTags2.testfile.yaml
@@ -0,0 +1,7 @@
+repository-tags:
+ tags:
+ - tag: work
+ when: '{StringContains({Repository.SafePath}, "work")}'
+ - tag: private
+ when: '{StringContains({Repository.SafePath}, "Private")}'
+ - tag: always-tag
\ No newline at end of file
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/RepositoryTags3.testfile.yaml b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/RepositoryTags3.testfile.yaml
new file mode 100644
index 00000000..7a8dda2f
--- /dev/null
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/RepositoryTags3.testfile.yaml
@@ -0,0 +1,14 @@
+repository-tags:
+ tags:
+ - tag: work
+ when: '{StringContains({Repository.SafePath}, "work")}'
+ - tag: private
+ when: '{StringContains({Repository.SafePath}, "Private")}'
+ - tag: always-tag
+ variables:
+ - name: work_repo
+ value: '{StringContains({Repository.SafePath}, "work")}'
+ enabled: true
+ - name: work_repo_1
+ value: true
+ enabled: false
\ No newline at end of file
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/RepositoryTagsDouble.testfile.yaml b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/RepositoryTagsDouble.testfile.yaml
new file mode 100644
index 00000000..8bfcae0d
--- /dev/null
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/RepositoryTagsDouble.testfile.yaml
@@ -0,0 +1,6 @@
+repository-tags:
+- tag: work1
+ when: '{StringContains({Repository.SafePath}, "work")}'
+- tag: private1
+ when: '{StringContains({Repository.SafePath}, "Private")}'
+- tag: always-tag1
\ No newline at end of file
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Sample1.testfile.json b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Sample1.testfile.json
index 3c30b6b5..7f782965 100644
--- a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Sample1.testfile.json
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Sample1.testfile.json
@@ -1,4 +1,5 @@
{
+ "version": 1,
"repository-tags": {
"tags": [
{
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Sample1.testfile.yaml b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Sample1.testfile.yaml
new file mode 100644
index 00000000..1b23a486
--- /dev/null
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Sample1.testfile.yaml
@@ -0,0 +1,30 @@
+version: 1
+repository-tags:
+ tags:
+ - tag: work
+ when: '{StringContains({Repository.SafePath}, "work")}'
+ - tag: private
+ when: '{StringContains({Repository.SafePath}, "Private")}'
+ - tag: always-tag
+ variables:
+ - name: work_repo
+ value: '{StringContains({Repository.SafePath}, "work")}'
+ enabled: true
+ - name: work_repo_1
+ value: true
+ enabled: false
+variables:
+- name: work_repo
+ value: '{StringContains({Repository.SafePath}, "work")}'
+ enabled: true
+- name: work_repo_1
+ value: true
+ enabled: false
+- name: work_repo_2
+ value: '{StringContains({Repository.SafePath}, "work")}'
+ enabled: false
+- name: is_private_repo
+ value: false
+- name: x
+ value: y
+ dummy: value
\ No newline at end of file
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Sample2.testfile.yaml b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Sample2.testfile.yaml
new file mode 100644
index 00000000..9ca11829
--- /dev/null
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Sample2.testfile.yaml
@@ -0,0 +1,48 @@
+repository-tags:
+ tags:
+ - tag: work
+ when: '{StringContains({Repository.SafePath}, "work")}'
+ - tag: private
+ when: '{StringContains({Repository.SafePath}, "Private")}'
+ - tag: always-tag
+ variables:
+ - name: work_repo
+ value: '{StringContains({Repository.SafePath}, "work")}'
+ enabled: true
+ - name: work_repo_1
+ value: true
+ enabled: false
+variables:
+- name: work_repo
+ value: '{StringContains({Repository.SafePath}, "work")}'
+ enabled: true
+- name: work_repo_1
+ value: true
+ enabled: false
+- name: work_repo_2
+ value: '{StringContains({Repository.SafePath}, "work")}'
+ enabled: false
+- name: is_private_repo
+ value: false
+- name: x
+ value: y
+ dummy: value
+repository-actions:
+ variables:
+ - name: work_repo
+ value: '{StringContains({Repository.SafePath}, "work")}'
+ enabled: true
+ - name: work_repo_1
+ value: true
+ enabled: false
+ actions:
+ - type: browser@1
+ name: '{OpenIn} Windows File Explorer'
+ active: false
+ multi-select-enabled: true
+ variables:
+ - name: name
+ value: '{StringContains({Repository.SafePath}, "abc")}'
+ - type: browser@1
+ name: '{OpenIn} Windows File Explorer'
+ active: false
\ No newline at end of file
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Sample3.testfile.yaml b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Sample3.testfile.yaml
new file mode 100644
index 00000000..6f88e964
--- /dev/null
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Sample3.testfile.yaml
@@ -0,0 +1,57 @@
+variables:
+- name: work_repo
+ value: '{StringContains({Repository.SafePath}, "work")}'
+ enabled: true
+- name: work_repo_1
+ value: true
+ enabled: false
+- name: work_repo_2
+ value: '{StringContains({Repository.SafePath}, "work")}'
+ enabled: false
+- name: is_private_repo
+ value: false
+- name: x
+ value: y
+ dummy: value
+repository-specific-config-files:
+- filename: '{Repostitory.Path}\RepositoryActions.json'
+ when: false
+- filename: '{Repostitory.Path}\.git\RepositoryActions.json'
+repository-specific-env-files:
+- filename: ab1.env
+ when: false
+- filename: ab.env
+repository-tags:
+ tags:
+ - tag: work
+ # optional, default true
+ when: '{StringContains({Repository.SafePath}, "work")}'
+ - tag: private
+ when: '{StringContains({Repository.SafePath}, "Private")}'
+ - tag: always-tag
+ variables:
+ - name: work_repo
+ value: '{StringContains({Repository.SafePath}, "work")}'
+ enabled: true
+ - name: work_repo_1
+ value: true
+ enabled: false
+repository-actions:
+ variables:
+ - name: work_repo
+ value: '{StringContains({Repository.SafePath}, "work")}'
+ enabled: true
+ - name: work_repo_1
+ value: true
+ enabled: false
+ actions:
+ - type: browser@1
+ name: '{OpenIn} Windows File Explorer'
+ active: false
+ multi-select-enabled: true
+ variables:
+ - name: name
+ value: '{StringContains({Repository.SafePath}, "abc")}'
+ - type: browser@1
+ name: '{OpenIn} Windows File Explorer'
+ active: false
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/VariablesOnly1.testfile.yaml b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/VariablesOnly1.testfile.yaml
new file mode 100644
index 00000000..649d70e9
--- /dev/null
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/VariablesOnly1.testfile.yaml
@@ -0,0 +1,15 @@
+variables:
+- name: work_repo
+ value: '{StringContains({Repository.SafePath}, "work")}'
+ enabled: true
+- name: work_repo_1
+ value: true
+ enabled: false
+- name: work_repo_2
+ value: '{StringContains({Repository.SafePath}, "work")}'
+ enabled: false
+- name: is_private_repo
+ value: false
+- name: x
+ value: y
+ dummy: value
\ No newline at end of file
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Version100.testfile.json b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Version100.testfile.json
new file mode 100644
index 00000000..239445c0
--- /dev/null
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Version100.testfile.json
@@ -0,0 +1,63 @@
+{
+ // unknown version:
+ "version": 100,
+ "repository-tags": {
+ "tags": [
+ {
+ "tag": "work",
+ "when": "{StringContains({Repository.SafePath}, \"work\")}"
+ },
+ {
+ "tag": "private",
+ "when": "{StringContains({Repository.SafePath}, \"Private\")}"
+ },
+ {
+ "tag": "always-tag"
+ }
+ ],
+ "variables": [
+ {
+ "name": "work_repo",
+ "value": "{StringContains({Repository.SafePath}, \"work\")}",
+ "enabled": true
+ },
+ // comment ar stripped
+ {
+ "name": "work_repo_1",
+ "value": "true",
+ // boolean to string works
+ "enabled": false
+ }
+ ]
+ },
+ "variables": [
+ {
+ "name": "work_repo",
+ "value": "{StringContains({Repository.SafePath}, \"work\")}",
+ "enabled": true
+ },
+ // comment ar stripped
+ {
+ "name": "work_repo_1",
+ "value": "true",
+ // boolean to string works
+ "enabled": false
+ },
+ {
+ "name": "work_repo_2",
+ // single quote works
+ "value": "{StringContains({Repository.SafePath}, \"work\")}",
+ "enabled": "false"
+ },
+ {
+ "name": "is_private_repo",
+ "value": "false"
+ },
+ {
+ "name": "x",
+ "value": "y",
+ // this value is ignored
+ "dummy": "value"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Version100.testfile.yaml b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Version100.testfile.yaml
new file mode 100644
index 00000000..b589d016
--- /dev/null
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/TestFiles/Version100.testfile.yaml
@@ -0,0 +1,30 @@
+version: 100
+repository-tags:
+ tags:
+ - tag: work
+ when: '{StringContains({Repository.SafePath}, "work")}'
+ - tag: private
+ when: '{StringContains({Repository.SafePath}, "Private")}'
+ - tag: always-tag
+ variables:
+ - name: work_repo
+ value: '{StringContains({Repository.SafePath}, "work")}'
+ enabled: true
+ - name: work_repo_1
+ value: true
+ enabled: false
+variables:
+- name: work_repo
+ value: '{StringContains({Repository.SafePath}, "work")}'
+ enabled: true
+- name: work_repo_1
+ value: true
+ enabled: false
+- name: work_repo_2
+ value: '{StringContains({Repository.SafePath}, "work")}'
+ enabled: false
+- name: is_private_repo
+ value: false
+- name: x
+ value: y
+ dummy: value
\ No newline at end of file
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_Sample1.verified.txt b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_Sample1.verified.txt
index 8a1cfa0b..00e57bae 100644
--- a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_Sample1.verified.txt
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_Sample1.verified.txt
@@ -3,12 +3,12 @@
{
Name: work_repo,
Value: {StringContains({Repository.SafePath}, "work")},
- Enabled: True
+ Enabled: true
},
{
Name: work_repo_1,
Value: true,
- Enabled: False
+ Enabled: false
},
{
Name: work_repo_2,
@@ -29,12 +29,12 @@
{
Name: work_repo,
Value: {StringContains({Repository.SafePath}, "work")},
- Enabled: True
+ Enabled: true
},
{
Name: work_repo_1,
Value: true,
- Enabled: False
+ Enabled: false
}
],
Tags: [
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_Sample1Yaml.verified.txt b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_Sample1Yaml.verified.txt
new file mode 100644
index 00000000..5f282702
--- /dev/null
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_Sample1Yaml.verified.txt
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_Sample2.verified.txt b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_Sample2.verified.txt
index e6f173dd..e5b5fe5f 100644
--- a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_Sample2.verified.txt
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_Sample2.verified.txt
@@ -3,12 +3,12 @@
{
Name: work_repo,
Value: {StringContains({Repository.SafePath}, "work")},
- Enabled: True
+ Enabled: true
},
{
Name: work_repo_1,
Value: true,
- Enabled: False
+ Enabled: false
},
{
Name: work_repo_2,
@@ -29,12 +29,12 @@
{
Name: work_repo,
Value: {StringContains({Repository.SafePath}, "work")},
- Enabled: True
+ Enabled: true
},
{
Name: work_repo_1,
Value: true,
- Enabled: False
+ Enabled: false
}
],
Tags: [
@@ -56,12 +56,12 @@
{
Name: work_repo,
Value: {StringContains({Repository.SafePath}, "work")},
- Enabled: True
+ Enabled: true
},
{
Name: work_repo_1,
Value: true,
- Enabled: False
+ Enabled: false
}
],
Actions: [
@@ -82,7 +82,7 @@
$type: RepositoryActionBrowserV1,
Type: browser@1,
Name: {OpenIn} Windows File Explorer,
- Active: False
+ Active: false
}
]
}
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_Sample3.verified.txt b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_Sample3.verified.txt
index 90af8853..13296a66 100644
--- a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_Sample3.verified.txt
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_Sample3.verified.txt
@@ -21,12 +21,12 @@
{
Name: work_repo,
Value: {StringContains({Repository.SafePath}, "work")},
- Enabled: True
+ Enabled: true
},
{
Name: work_repo_1,
Value: true,
- Enabled: False
+ Enabled: false
},
{
Name: work_repo_2,
@@ -47,12 +47,12 @@
{
Name: work_repo,
Value: {StringContains({Repository.SafePath}, "work")},
- Enabled: True
+ Enabled: true
},
{
Name: work_repo_1,
Value: true,
- Enabled: False
+ Enabled: false
}
],
Tags: [
@@ -74,12 +74,12 @@
{
Name: work_repo,
Value: {StringContains({Repository.SafePath}, "work")},
- Enabled: True
+ Enabled: true
},
{
Name: work_repo_1,
Value: true,
- Enabled: False
+ Enabled: false
}
],
Actions: [
@@ -100,7 +100,7 @@
$type: RepositoryActionBrowserV1,
Type: browser@1,
Name: {OpenIn} Windows File Explorer,
- Active: False
+ Active: false
}
]
}
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_ShouldReturnEmptyObject_WhenContentIsEmpty.verified.txt b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_ShouldReturnEmptyObject_WhenContentIsEmpty.verified.txt
new file mode 100644
index 00000000..6e1bf88b
--- /dev/null
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_ShouldReturnEmptyObject_WhenContentIsEmpty.verified.txt
@@ -0,0 +1,4 @@
+{
+ TagsCollection: {},
+ ActionsCollection: {}
+}
\ No newline at end of file
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_ShouldReturnEmptyObject_WhenContentIsEmptyJsonx.verified.txt b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_ShouldReturnEmptyObject_WhenContentIsEmptyJsonx.verified.txt
new file mode 100644
index 00000000..6e1bf88b
--- /dev/null
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_ShouldReturnEmptyObject_WhenContentIsEmptyJsonx.verified.txt
@@ -0,0 +1,4 @@
+{
+ TagsCollection: {},
+ ActionsCollection: {}
+}
\ No newline at end of file
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_ShouldReturnEmptyObject_WhenVersionIsUnknown.verified.txt b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_ShouldReturnEmptyObject_WhenVersionIsUnknown.verified.txt
new file mode 100644
index 00000000..6e1bf88b
--- /dev/null
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_ShouldReturnEmptyObject_WhenVersionIsUnknown.verified.txt
@@ -0,0 +1,4 @@
+{
+ TagsCollection: {},
+ ActionsCollection: {}
+}
\ No newline at end of file
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_ShouldReturnObjectWithRepositoryActions_WhenContentIsRepositoryActions1.verified.txt b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_ShouldReturnObjectWithRepositoryActions_WhenContentIsRepositoryActions1.verified.txt
index 28720545..03e41708 100644
--- a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_ShouldReturnObjectWithRepositoryActions_WhenContentIsRepositoryActions1.verified.txt
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_ShouldReturnObjectWithRepositoryActions_WhenContentIsRepositoryActions1.verified.txt
@@ -19,7 +19,7 @@
$type: RepositoryActionBrowserV1,
Type: browser@1,
Name: {OpenIn} Windows File Explorer,
- Active: False
+ Active: false
}
]
}
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_ShouldReturnObjectWithRepositoryActions_WhenContentIsRepositoryActions3.verified.txt b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_ShouldReturnObjectWithRepositoryActions_WhenContentIsRepositoryActions3.verified.txt
index 87419e00..9a38f9b1 100644
--- a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_ShouldReturnObjectWithRepositoryActions_WhenContentIsRepositoryActions3.verified.txt
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_ShouldReturnObjectWithRepositoryActions_WhenContentIsRepositoryActions3.verified.txt
@@ -5,12 +5,12 @@
{
Name: work_repo,
Value: {StringContains({Repository.SafePath}, "work")},
- Enabled: True
+ Enabled: true
},
{
Name: work_repo_1,
Value: true,
- Enabled: False
+ Enabled: false
}
],
Actions: [
@@ -32,7 +32,7 @@
$type: RepositoryActionBrowserV1,
Type: browser@1,
Name: {OpenIn} Windows File Explorer,
- Active: False
+ Active: false
}
]
}
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_ShouldReturnObjectWithRepositoryTags_WhenContentIsRepositoryTags3.verified.txt b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_ShouldReturnObjectWithRepositoryTags_WhenContentIsRepositoryTags3.verified.txt
index c9fa1da2..27bcaf7c 100644
--- a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_ShouldReturnObjectWithRepositoryTags_WhenContentIsRepositoryTags3.verified.txt
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_ShouldReturnObjectWithRepositoryTags_WhenContentIsRepositoryTags3.verified.txt
@@ -4,12 +4,12 @@
{
Name: work_repo,
Value: {StringContains({Repository.SafePath}, "work")},
- Enabled: True
+ Enabled: true
},
{
Name: work_repo_1,
Value: true,
- Enabled: False
+ Enabled: false
}
],
Tags: [
diff --git a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_ShouldReturnObjectWithVariables_WhenContentIsVariablesOnly.verified.txt b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_ShouldReturnObjectWithVariables_WhenContentIsVariablesOnly.verified.txt
index 4905619f..8887d590 100644
--- a/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_ShouldReturnObjectWithVariables_WhenContentIsVariablesOnly.verified.txt
+++ b/tests/RepoM.Api.Common.Tests/IO/ModuleBasedRepositoryActionProvider/Verified/DynamicRepositoryActionDeserializerTest.Deserialize_ShouldReturnObjectWithVariables_WhenContentIsVariablesOnly.verified.txt
@@ -3,12 +3,12 @@
{
Name: work_repo,
Value: {StringContains({Repository.SafePath}, "work")},
- Enabled: True
+ Enabled: true
},
{
Name: work_repo_1,
Value: true,
- Enabled: False
+ Enabled: false
},
{
Name: work_repo_2,
diff --git a/tests/RepoM.Api.Common.Tests/RepoM.Api.Common.Tests.csproj b/tests/RepoM.Api.Common.Tests/RepoM.Api.Common.Tests.csproj
index c06c2975..4e7fbd4e 100644
--- a/tests/RepoM.Api.Common.Tests/RepoM.Api.Common.Tests.csproj
+++ b/tests/RepoM.Api.Common.Tests/RepoM.Api.Common.Tests.csproj
@@ -20,6 +20,7 @@
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all