Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
PSCall does not work for script created at application level
-
Hi,
When trying to add a PowerShell Script Asset defined at the application level to a BuildMaster OtterScript(Plan)PSCall PSDemo ( YourName: Paul );
I'm getting an error :
"PSDemo.ps1" is not a valid Script identifier for the "global" scope.
The Visual Mode Designer will also not allow drag and drop of the script.The same script defined at the Global Level works
PSCall global::PSDemo1 ( YourName: Paul );
BuildMaster 7.0.3 (Build 1)
Full Stack Trace Message
An error occurred in the web application: "PSDemo.ps1" is not a valid Script identifier for the "global" scope.Full Stack Trace Details
URL: http://server:8622/0x44/BuildMaster.WebApplication/Inedo.BuildMaster.WebApplication.Pages.Plans.Editor.PlanEditorPage/RebuildStatement
Referrer: http://server:8622/plans/edit?planId=Default::Test::DeploymentPlan::Deploy
User: Admin
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36 Edg/91.0.864.59
Stack trace: at Inedo.BuildMaster.Rafts.RaftItemId.Parse(RaftItemType itemType, ApplicationId applicationId, String appRelativeId)
at Inedo.BuildMaster.BuildMasterSdkConfig.Config.GetRaftItem(RaftItemType type, String itemId, Object context)
at Inedo.Extensions.Scripting.PowerShell.PowerShellScriptInfo.TryLoad(LooselyQualifiedName scriptName)
at Inedo.Extensions.Scripting.Operations.PowerShell.PSCallOperation.GetDescription(IOperationConfiguration config)
at Inedo.Extensibility.Operations.Operation.GetDescription(Type operationType, ActionStatement statement)
at Inedo.BuildMaster.PlanEditor.TsStatement.FromDynamicStatement(ActionStatement statement)
at Inedo.BuildMaster.PlanEditor.TsStatement.FromStatement(Statement statement)Thanks,
Paul
-
Hi @paul-reeves_6112 ,
I was able to track down this error; it's a regression introduced into v7, and only impacts the OtterScript editor.
If you upgrade the
Scripting
extension (Admin > Extensions) to 1.10.4 then it should work :)Cheers,
Alana
-
@atripp Hi Alana,
I've installed that updated Extension and I now get a message "An unexpected error occurred while posting to the server"
"Internal Server ErrorYou should try to save your work if possible."
If I try and drag the Local Application Script in the GUI.I manually downloaded the extension and copied onto the server and restarted both BuildMaster and the Web services.
Thanks,
Paul
-
@paul-reeves_6112 I'm thinking I didn't fix the regression after all
Can you go to Admin > Diagnostic Center and share the stack trace that resulted from the message? It should be logged in the case of an editor crash like that. I suspect it's related, but I only used a very simple/quick script test.
-
@atripp Hi Alana,
On Extension 1.10.3 the stack trace on my original post was from the Diagnostic Centre.On 1.10.4 its just an error that is displayed on the GUI; it doesn't log the message into the Diagnostic Center.
So you have 'fixed' something :-)This is the error when just dragging a PowerShell script defined in the Application.
Dragging the PSCall global::PSDemo1 works perfectly as this is defined in the Global Script respository.
I've tried simple scripts with and without parameters...
These are my two test Powershell Scripts which are cut down from your Otter demo..<# .SYNOPSIS Demo Script .PARAMETER YourName When specified #> param([string]$YourName) if ($YourName){ Write-Output @" Hello $YourName "@ } else { Write-Output @" Hello from PowerShell ! "@ }
<# .SYNOPSIS Demo Script #> Write-Output @" Hello from PowerShell ! "@
One further thing I have noticed, if I edit my Otterscript in Text Mode, I can add the local application powershell by prefixing the application name i.e.
# General { PSCall Test::PSPaul1 ( YourName: Paul ); }
Therefore the issue seems to be the GUI is okay with either
PSCall Global::PSPaul1
or
PSCall Application::PSPaul1
But doesn't like the short name
PSCall PSPaul1
Which from my screenshot you can see if how the local Application Scripts are defined.
I've also tried creating a new test script under v1.10.4 in case this wasn't saving something properly, but this is also broken.
Hope this helps,
Thanks,
Paul
-
Hi @paul-reeves_6112 ,
Thanks for all the detailed information; it was a bit of a rush due to US holiday yesterday, and I didn't look so carefully. That patch to Scripting (1.10.4) seems to fix text mode, but the editor is clearly still broken unless you prepend the application name (which you figured out).
The application name should not be required like this, and I've logged a product change to fix this (BM-3707 and SDK-74). This will get fixed in the next maintenance release of BuildMaster, which is scheduled for Friday.
We may ship it sooner, because this regression is quite annoying.
Cheers,
Alana
-
Hi @paul-reeves_6112 ,
I ended up fixing this in the extension after all - can you try 1.10.5?
We will still want to make the SDK change, but it was more involved than I thought. So the team wants to wait to do that later... especially since we could quickly fix it in the extension.
Cheers,
Alana
-
@atripp Hi Alana,
Sorry for the delay; I had not checked in as I was watching for the v7.0.5 release..
Extension v1.10.5 looks good to me in solving this problem; thank you.Regards,
Paul