Unreal SubmitTool and Horde Preflight tests

I’m attempting to get Horde set up to run preflights.

I’m attempting to integrate it with SubmitTool to launch said preflights.

I have the Horde server set up. I don’t know the exact URL format to cause it to launch a preflight.

I assumed the SubmitTool would have that data, but it apparently needs a Tag to function. I don’t know what’s all required here but it seems like a Boolean flag, but I’m missing “Values”.

The SubmitTool.Horde settings. I found the definitions of which settings exist, but I dont know what the format of each should be.

Steps to Reproduce
-

Hey Jerek, here’s an example config for preflight support in submit tool, you need a tag that has an InputSubtype=“Preflight”, specifying Horde urls and preflight template definitions and provide the path and args to the OIDCToken in order to allow communication with Horde

`[Tags.Preflight]
TagId=“#preflight
TagLabel=“Preflight”
InputType=“FreeText”
InputSubType=“Preflight”
AllowedSpecialCharacters=“-:/.”
OrdinalOverride=1
MinValues=1
MaxValues=5
Validation=(
bIsMandatory=“false”,\ ; by default, tag is not mandatory
RegexValidation=“^((https://)?[\w.]+/job/)?[0-9a-f]{24}$|^skip$|^none$”,
RegexErrorMessage=“Preflight tag valid values are the full preflight URL (https://…/job/{jobid}), just the job id (24 hexadecimal characters), ‘skip’ or ‘none’”
)
ValidationOverrides=(\ ; this is optional
(
RegexPath=“Regex”,\ ; if at least one file matches the regex use this validation instead (make it mandatory)
ConfigOverride=(
bIsMandatory=“true”,
RegexValidation=“^((https://)?[\w.]+/job/)?[0-9a-f]{24}$|^skip$|^none$”,
RegexErrorMessage=“Preflight tag valid values are the full preflight URL (https://…/job/{jobid}), just the job id (24 hexadecimal characters), ‘skip’ or ‘none’”
)
)
)

[SubmitTool.Horde]
HordeServerAddress=“BASE URL PATH” ; base url to your horde server
StartPreflightURLFormat=“{URL}preflight?stream={Stream}&change={CLID}&templateId={Template}&version=2{AdditionalTasks}”
FindSinglePreflightURLFormat=“{URL}api/v1/jobs/{PreflightId}”
FindPreflightURLFormat=“{URL}api/v1/jobs?includePreflight=true&preflightOnly=true&preflightChange={CLID}”
DefaultPreflightTemplate=“PF template name” ; template to use when starting a preflight that doesn’t match any of the Definitions below
Definitions=(\ ; this is a list of preflights templates that can be suggested according to the file contents of the CL, the list returns the first match, reverting back to the DefaultPreflightTemplate, complex logic of AND/OR are not supported outside of Regex testing atm
(
RegexPath=“Regex
Template=“code PF template name
)
)

[SubmitTool.OAuthToken]
OAuthTokenTool=“$(root)/Engine/Binaries/DotNET/OidcToken/win-x64/OidcToken.exe” ; this is windows-only if you need Linux/Mac support you’ll need to override this property in LinuxSubmitTool.ini and MacSubmitTool.ini
OAuthArgs=“–Mode GetToken --Service Service Name* --ResultToConsole true”`

What submit tool does is get the non-virtual stream and sends that to the Horde request, this is not a very developed part of the program since we have implemented what we needed for Epic internal development setup, AFAIK we don’t use virtual streams internally for Horde setup, all streams we have in horde are real stream.

To clarify, the stream that Horde needs is the same one that is shown in the dashboard of your project. it should also match the text in the url of the CI/jobs page yourhordeurl.com/stream/stream-name-with-dashes?tab=nameoftab but with the //Stream/name/with/dashes format

You might want to look into finding what your setup requires in Engine\Source\Programs\SubmitTool\Private\Logic\PreflightService.cpp around line ~530 the StartPreflight() method figures out which stream name to send to Horde.

Submit Tool has information about the streams, the current code currently uses SCCService->GetRootStreamName() which is the base real stream, and then overrides the stream in special cases. if your horde config needs the virtual stream, you might want to test setting StreamName = SCCService->GetCurrentStreamName() just before the line pasted below. If that works for you, the real solution would be to include {VirtualStream} as a property mapped to that in GetFormatParameters() and change the config to use that instead

FString StartPreflightUrl = FString::Format(*Definition.StartPreflightURLFormat, GetFormatParameters());if that doesn’t work you’ll need to debug your specific situation in that area. SubmitToolPerforce.h has a StreamHierarchy with the stream data that is fetched from your CL, it’d be a good place to start looking for the stream that matches Horde.

Ah, last question, I think

How do I configure Horde to support multiple p4 branches and will the agents stream swap or require completely new workspaces

I’m afraid I can’t really help a lot with that question since Horde falls a bit outside my domain, you’re probably better off creating a new post/request that gets triaged to the Horde team

Are the template names from the BuildGraphs that the HordeServer has?

Nevermind. I got the SubmitTool to invoke the horde server page

I’m now getting an error “Unable to resolve stream with name”

due to a mismatch between my stream and the virtual stream on the Horde server.

In the Horde dashboard Preflight.tsx there’s a projectStore.streamByFullname and special handling for a stream name with -VS, which I’ll assume is the naming convention.

if (!stream) {

 stream \= projectStore.streamByFullname(streamName \+ "\-VS");

}

How do I reconcile the various virtual streams and which stream the Horde server is running with?

Ah nice. Yeah it was easier to modify what SubmitTool was sending to match what Horde was expecting to receive than update HordeServer.

Thanks

Thanks for the help!

I’ve got at least the Mainline functional now.