Commit Graph

243 Commits

Author SHA1 Message Date
paul chipchase
cffa31070e Allow the VA failed payload pull dialog to be displayed if the pull occurred when generating content browser thumbnails.
#rb Per.Larsson
#rnx

- When generating content browser thumnails GIsRunningUnattendedScript will be set to true which prevents us from showing the VA payload pull failed dialog, so if a payload does fail during thumbnail generation the process will just terminate rather than asking the user if they would like to retry the operation.
- We no longer consider 'GIsRunningUnattendedScript' when checking if the process is interactive.
- If the dialog is being displayed from the GameThread we can force GIsRunningUnattendedScript to false safely allowing the dialog to be displayed. If we fail a payload pull on a background thread while the GameThread is generating a thumbnail we will not be able to safely change GIsRunningUnattendedScript (which does not have proper thread guarding) so we will just have to accept that the dialog will fail to show and the process will terminate.

[CL 29747059 by paul chipchase in ue5-main branch]
2023-11-15 10:51:51 -05:00
paul chipchase
172a1f046f Do not use/include the MessageLog module in the Virtualization module if the target is not building for slate.
#rb Per.Larsson
#jira UE-198807
#rnx

- We only needed the MessageLog module to setup a VA tab in the message log slate window which only matters if we are actually building for a target that uses slate.

[CL 29043098 by paul chipchase in ue5-main branch]
2023-10-24 07:26:08 -04:00
paul chipchase
edc22944d3 Improve error reporting with the new error flow in VA
#rb PJ.Kack
#jira UE-180383
#rnx

- With the new error flow we block the process on a failed pull and then quit the process if the connection cannot be recovered, this means that we never reach the code that reports which payloads failed.
- Added similar reporting to FVirtualizationManager::OnPayloadPullError so we can get a log of which payloads failed to pull.
-- A pull failure should not really be dependant on the payload itself so this info isn't that important but it can be useful to eliminate potential issues by allowing us to confirm that the payload does in fact exist in persistent storage and the user was just unable to access it.

[CL 28833473 by paul chipchase in ue5-main branch]
2023-10-17 03:58:43 -04:00
paul chipchase
c1e728c293 Prevent the VA error dialogs from being shown if the code is being run in a scenario where a user will not be present.
#rb Martin Ridgers
#jira UE-191791
#rnx

- Add a new ::IsProcessInteractive function to UE::Virtualization::Utils namespace that will return true if we think the current process is being run in a scenario where a user will be present and that it is okay to show an interactive error dialog.
- Use this new check to make sure that we do not try to display the "connection error" dialog on start up (even though as a slate dialog this will usually fail to display in non-interactive scenarios anyway)
- Use the new check to avoid displaying the "payload pull failure" dialog and default to the process shutting down instead.
-- Added some code comments to explain why we force the process to exit rather than logging a fatal error.

[CL 28183133 by paul chipchase in ue5-main branch]
2023-09-25 06:48:33 -04:00
josh adams
aeb5cb1347 - Restoring a backout after fixing the issue that causes the backout
[Backout] - CL27745134
[FYI] stan.hormell
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL27731288 - CIS / Build Errors
[FYI] Josh.Adams
Original CL Desc
-----------------------------------------------------------------
- Deprecated GetSectionPrivate and FindOrAddSection, and accessors in FConfigFile that could return a non-const FConfigSection (this is so we can track modifications to config values)
- Added AddToSection, RemoveKeyFromSection, etc to replace directly accessing a FConfigSection
- Fixed up Epic code for the deprecations (at least the majority, some projects that aren't built by Horde presubmit may have some that we will address going forward)
#jira UE-194955
#rb david.harvey and various others

[CL 27923017 by josh adams in ue5-main branch]
2023-09-15 13:39:02 -04:00
stan hormell
37bad2d07b [Backout] - CL27731288 - CIS / Build Errors
[FYI] Josh.Adams
Original CL Desc
-----------------------------------------------------------------
- Deprecated GetSectionPrivate and FindOrAddSection, and accessors in FConfigFile that could return a non-const FConfigSection (this is so we can track modifications to config values)
- Added AddToSection, RemoveKeyFromSection, etc to replace directly accessing a FConfigSection
- Fixed up Epic code for the deprecations (at least the majority, some projects that aren't built by Horde presubmit may have some that we will address going forward)
#jira UE-194955
#rb david.harvey and various others

[CL 27745141 by stan hormell in ue5-main branch]
2023-09-10 22:58:21 -04:00
josh adams
a8a9a0b759 - Deprecated GetSectionPrivate and FindOrAddSection, and accessors in FConfigFile that could return a non-const FConfigSection (this is so we can track modifications to config values)
- Added AddToSection, RemoveKeyFromSection, etc to replace directly accessing a FConfigSection
- Fixed up Epic code for the deprecations (at least the majority, some projects that aren't built by Horde presubmit may have some that we will address going forward)
#jira UE-194955
#rb david.harvey and various others

[CL 27731364 by josh adams in ue5-main branch]
2023-09-08 17:58:55 -04:00
louisphilippe seguin
36c722f3c4 Fix wrong printf parameters in checkf & ensuremsgf found in engine code
#rb Fabian.Giesen, Kirill.Zorin
#rnx

[CL 27519547 by louisphilippe seguin in ue5-main branch]
2023-08-31 08:56:30 -04:00
paul chipchase
b2e383fd7a Fix duplicate localization key
#rb trivial
#jira UE-193786
#rnx

- Also removed some commented out code and a pointless local variable as code cleanup while I was on.

[CL 27341309 by paul chipchase in ue5-main branch]
2023-08-24 10:37:05 -04:00
paul chipchase
b5f6e2fbd2 Update the source control backend reconnection dialog to show the connection errors.
#rb none
#jira UE-191791
#rnx

- When a connection attempt fails we now return the credentials used and the errors given by the system.
-- The credentials will be used to auto fill out the dialog, letting the user see what credentials were attempted in the last attempt.
-- The errors are shown in a box with red error text, letting them know what went wrong.
- We no longer let the revision control provider log errors when establishing a connection, so if the users correct info and successfully connects on a subsequent attempt they will not see an error in the logs.
-- If the connection completely fails we still log as before.

[CL 27302825 by paul chipchase in ue5-main branch]
2023-08-23 08:22:30 -04:00
paul chipchase
4bb2e66a88 Tweak the text in the VA revision control connection error dialog based on feedback.
#rb trivial
#jira UE-191791
#rnx


- Removed direct references to perforce from the dialog code, those strings are now passed in by the caller. This should make the dialog more usable by other revision control providers at some point.
- Make it more obvious that the dialog is related to virtualized assets.
- Add more references to the revision control provider name so that people realize which settings they are supposed to be entering.
- Removed some debug code for launching the dialog from a console command.
- Fixed a bug where clicking the button to reset the ini file settings and use the default connection would reset the settings but then not try to reconnect.
- Make better use of the dialog space by increasing the size of the input boxes at the expense of white space, so that longer server addresses can fit on screen.

[CL 26769098 by paul chipchase in ue5-main branch]
2023-08-02 08:57:07 -04:00
paul chipchase
e5f6579147 Demote some VA logging to verbose to clean up editor shutdown logs
#rb trivial
#rnx

[CL 26634386 by paul chipchase in ue5-main branch]
2023-07-27 03:27:10 -04:00
paul chipchase
6108ee0529 Add a new config option 'engine.ini:[Core.VirtualizationModule]:DisableLazyInitIfInteractive' that can be used to override LazyInitConnections if we want the VA module to be able to use slate dialogs safely.
#rb none

- If we want to use slate dialogs we cannot use LazyInitConnections, however slate dialogs only work on programs that a) support slate and b) are running in some interactive form. Commandline programs, or the editor runnning in unattended mode or running a commandlet cannot make use of the slate dialog.
- If this new flag 'DisableLazyInitIfInteractive' is set to true and 'LazyInitConnections' is set to true then the VA system will lazy init its connections unless we are running an interactive program that could make use of the slate dialogs, in which case 'LazyInitConnections' is disabled for safety.
- Ideally we'd merge these two values into a single enum but I am hoping that we can change how we connect in the near term in which case we will simple deprecate 'DisableLazyInitIfInteractive'. The use case is pretty niche at the moment so this will probably be easier for the next stage of work.

[CL 26230486 by paul chipchase in ue5-main branch]
2023-06-26 06:21:23 -04:00
paul chipchase
a01c680fd3 Fix incorrect localization key
#rb trivial
#rnx

[CL 26179388 by paul chipchase in ue5-main branch]
2023-06-22 08:05:00 -04:00
paul chipchase
21a9cf771e Add a command line '-VADisableDialog' that will prevent the revision control retry dialog from being disabled as an easy way for users to supress it if they need to do so.
#rb none
#rnx

[CL 26151818 by paul chipchase in ue5-main branch]
2023-06-21 11:53:01 -04:00
paul chipchase
472e260f3f Improve VA revision control dialog by adding better tool tips and support for turning the 'ConnectionHelpUrl' (if set for a project) into a clickable link for the user.
#rb none
#rnx

[CL 26144502 by paul chipchase in ue5-main branch]
2023-06-21 06:43:40 -04:00
paul chipchase
960a85797f Fix warning on editor startup introduced in CL 26115183
#rb trivial
#rnx

- Any new option added to engine.ini:[Core.ContentVirtualization] needs to also be added to an allowed list in FVirtualizationManager so that we do not flag it as a deprecated option. This is because we used to store the manager config values in that section as well.

[CL 26120522 by paul chipchase in ue5-main branch]
2023-06-20 09:12:28 -04:00
paul chipchase
46c360f493 Now if the VA source control backend fails to connect we can display a dialog to the user asking for the correct credentials directly. Currently disabled by default.
#rb none

### Dialog
- When the source control backend tries to connect and fails we will now show a dialog allowing the user to try new settings rather than let the editor continue and crash.
- The dialog will allow the user to enter the server address (P4PORT) and their username (P4USER).
- Once the dialog is displayed the user will have three options to continue.
-- "Reset To Defaults" which will remove all settings saved to the users local ini files and attempt to use the environment defaults to connect.
-- "Retry Connection" which will take the new address and username that the user provided and attempt to connect with those settings.
-- "Skip" no connection attempt will be made. This may cause instability later if the user needs data that they cannot access.
- If the connection succeeds after the user has reset to defaults or provided new settings, then they will be saved in the local ini file for future sessions.
- The dialog will not show if:
-- Slate is disabled for the current processor has not yet initialized
-- The error is found not on the game thread. This means that lazy init will not currently work well with this dialog. Attempts to mashal the error to the game thread have been spotty at best and there is a high chance of thread locking so attempts were abandoned.
-- If the -unattended flag is set on the process.
-- If the dialog is disabled via the config file when setting up the backend (UseRetryConnectionDialog=False)
-- If  'engine.ini:[Core.VirtualizationModule]:UseLocalIniFileSettings' is false as future sessions would not be able to use the new settings and would become tiresome. In these cases the environment settings will need to be fixed.
- If the dialog is now shown then the backend is marked as unconnected and will not work.

### Known Issues
- We currently cannot get the settings that the failed p4 connection used, nor the error message dueto how the API works. So for now we just display an empty server address and username edit box. This will be fixed when the API is changed.
- There is currently no good way to inform the user where their settings come from.
- There is no easy way to reset the settings once saved. To allow the user to change the server address to a better proxy for example.

### Initialization
- In order to allow a slate dialog to be used, the initialization of the VA system has been moved later in pre init, to the first avaliable point after slate has initialized and its shaders have been built. This in theory should not cause a a problem as engine content cannot be virtualized.
-- Added a new option 'engine.ini:[Core.ContentVirtualization]:InitPreSlate' with a default of false. When set to true the VA system will initialize in the original, earlier portion of engine pre init. This is only included in case an existing virtualized project encounters a problem with the new ordering.

[CL 26115392 by paul chipchase in ue5-main branch]
2023-06-20 04:26:06 -04:00
kirill zorin
b6ee3a6c64 Fix UE_LOG callsites that have format string-related UB
#rb trivial
#preflight 647107780a6634dbb236a0a6

[CL 25651638 by kirill zorin in ue5-main branch]
2023-05-26 15:52:39 -04:00
paul chipchase
502c1315c5 Small optimization when rehydrating packages containing multiple payloads.
#rb none
#jira UE-177159
#preflight 646395d32d446eac964c5318

- Reduced time taken to hydrate a 16GB test project by ~20%.
-- Still more work to do, this was just very easy low hanging fruit.
- Only really helps if packages contain multiple virtualized payloads.

[CL 25489907 by paul chipchase in ue5-main branch]
2023-05-16 11:08:09 -04:00
bryan sefcik
da92084a12 Optimized out more private modules includes and dependencies.
#preflight 64627c382965f6ea8ea83bd6

[CL 25479683 by bryan sefcik in ue5-main branch]
2023-05-15 16:26:12 -04:00
paul chipchase
0a9f2e615e Change TryCopyPackageWithoutTrailer to take the length of the trailer to remove rather than the trailer structure itself.
#rb trivial
#jira none
#'rnx
#preflight 646218cb2965f6ea8e87db6e

[CL 25471700 by paul chipchase in ue5-main branch]
2023-05-15 07:55:37 -04:00
paul chipchase
7cd5e648dd Allow an optional url to be shown along side VA connection errors to make it easier for users to find the help that they need.
#rb none
#rnx
#preflight 645c95abaa3c584c0b1c91f0

- A url can now be provided via 'ini:Engine:[Core.VirtualizationModule]:ConnectionHelpUrl=""' that will be added to various connection errors. If the error message is via FMessageLog then the user will be able to click the url to go straight to the link.
- This sort of help will be very company specific, this url will allow teams to build up their own FAQ for their users.
- Currently used by the source control backend if the initial connection fails but will be expanded to other areas.
- The url is currently parsed and owned by the virtualization manager but at the moment the connection error is issued by each backend. So right now there is a static accessor allowing backends to get the value to use. This would not work properly for 3rd party backends and will  be changed in the near term.

[CL 25424000 by paul chipchase in ue5-main branch]
2023-05-11 06:35:58 -04:00
paul chipchase
6a1a0551da Enable UnsafeTypeCastWarningLevel errors for the virtualization module
#rb trivial
#jira none
#rnx
#preflight 6458e2596c35ad81e60f2fa9

- I thought I had already done this but I see nothing in the p4 history, so it is likely that I forgot to actually submit the change.
- Fix some additional warnings found under clang (C5219)

[CL 25370075 by paul chipchase in ue5-main branch]
2023-05-08 09:40:17 -04:00
paul chipchase
fef4f75edc Do not assign payloads downloaded from source control if they did not actually download.
#rb trivial
#jira none
#rnx
#preflight 6447d1954052d26a5a8c36cc

- Ends up pretty much the same,as FCompressedBuffer::FromCompressed will return a Null FCompressedBuffer if the provided data is null, but adding the check makes it clear when reading FSourceControlBackend::PullData that payloads might not be found and we are not setting them in that case.

[CL 25179230 by paul chipchase in ue5-main branch]
2023-04-25 09:32:46 -04:00