Skip to content

Commit

Permalink
#115 Debugging a CI build issue regarding client vs server timezones,…
Browse files Browse the repository at this point in the history
… seemingly default CultureInfo cannot TryParse our database format, added explicit format
  • Loading branch information
ddemeyer committed Sep 28, 2021
1 parent 8a4e134 commit 0904e36
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Doc/TheExecution-ISHRemote-7.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ Publishing problem perhaps, as copying %USER%\.nuget\packages\system.servicemode
4. Is `CertificateValidationHelper.cs` and `ServicePointManagerHelper.cs` still the way to do certificate bypass? Not according to https://github.com/dotnet/runtime/issues/26048 perhaps needs platform-pragma between Windows PowerShell and PowerShell (Core). Nope solved it via `#115 Enabling Tls13 and IshSession based IgnoreSslPolicyErrors overwrite by switching to ChannelFactor instead of SoapClient. Crosslinking #102 on Tls13 and #22 as IshSession control Ssl-overwrite instead of AppDomain`
> In .NET Core, ServicePointManager affects only HttpWebRequest. It does not affect HttpClient. You should be able to use HttpClientHandler.ServerCertificateValidationCallback to achieve the same.
In .NET Framework, the built-in HttpClient is built on top of HttpWebRequest, therefore ServicePointManager settings will apply to it.
1. Next is add all SoapClient proxies
## Next
1. `New-IshSession -WsBaseUrl .../ISHWS/ -IshUserName ... -IshPassword -Protocol [AsmxAuthenticationContext (default) | OpenApiBasicAuthentication | OpenApiOpenConnectId]` so Protocol as a parameter to use in Switch-cases in every cmdlet on how to route the code
Expand All @@ -86,7 +87,6 @@ In .NET Framework, the built-in HttpClient is built on top of HttpWebRequest, th
4. Folder25.GetMetadataByIshFolderRef -> API30.GetFolder (ready)
5. Folder25.GetMetadata -> API30.GetFolderByFolderPath, perhaps GetRootFolderList (NotPlanned)
6. Folder25.GetSubFoldersByIshFolderRef -> API30.GetFolderObjectList (ready)
1. Next is add all SoapClient proxies
2. Should we add a `\Cmdlets\_TestEnvironment\Prerequisites.Tests.ps1` that gives hints on what you did wrong, how to correct it
1. You can use `...debug.ps1` to override languages if the current language or resolution does not exist in DLANGAUGES over Get-IshLovValues
2. You should have initial state Draft by element name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ namespace Trisoft.ISHRemote.HelperClasses
// . https://docs.microsoft.com/en-us/dotnet/api/system.management.automation.psvariable?view=powershellsdk-1.1.0
internal class NameHelper
{
private readonly CultureInfo _cultureInfoEnUs = new CultureInfo("en-US");
private readonly IshSession _ishSession;
private readonly string _levelNameValueTypeSeparator = "_"; // Not that many special characters allowed in Properties, e.g. '=' is assignment
// TODO [Could] NameHelper PSNoteProperty generator could benefit of fast-lookup dictionary to store DataType and PropertyName as almost all IshObjects start from the same requested metadata request...
Expand Down Expand Up @@ -105,6 +106,11 @@ public PSNoteProperty GetPSNoteProperty(Enumerations.ISHType[] ishTypes, IshMeta
{
propertyValue = dateTime.ToString("s");
}
//seemingly Github Actions CI/CD is running a CultureInfo which makes the above generic TryParse fail, so trying an explicit one
else if (DateTime.TryParseExact(ishField.Value, "dd/MM/yyy HH:mm:ss", _cultureInfoEnUs, DateTimeStyles.None, out dateTime))
{
propertyValue = dateTime.ToString("s");
}
else
{
propertyValue = ishField.Value;
Expand Down

0 comments on commit 0904e36

Please sign in to comment.