Commit Graph

238 Commits

Author SHA1 Message Date
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
paul chipchase
107e71c495 Add a way for VA backends to supply additional errors for failed pull operations when calling FVirtualizationManager::OnPayloadPullError
#rb none
#jira UE-181418
#rnx
#preflight 6447c5482804595a04d1e375

- Each pull operation now takes a FText that can be filled in with additional info about any failures that will cause the new error dialog to be displayed.
-- At the moment we only have info to provide from the source control backend if the connection itself failed.
-- In the future we might want to completely overhaul our error logging and display all messages to the user but our logging system is not really built for that level of redirection at the moment.
- Only pass on the error if it came from a persistent backend, we don't need to worry the user about cached backends which are allowed to fail.

[CL 25178752 by paul chipchase in ue5-main branch]
2023-04-25 08:47:06 -04:00
paul chipchase
1400b2ddc4 Remove duplicate package entries from the list of packages to virtualize/rehydrate.
#rb none
#jira UE-183776
#rnx
#preflight 6441439073470c177c0ce09c

- One crash was reported where a user has somehow managed to try to submit a list of packages containing duplicate entries. This means we try to strip the trailer from that package multiple times which would cause the file system to assert during a call to truncate.
- This is technically the fault of higher level systems outside the control of VA but we should still handle it properly.
- Now duplicate entries are detected and removed so that each package is only processed once.
- If duplicates are detected we log a warning.

[CL 25127877 by paul chipchase in ue5-main branch]
2023-04-20 11:05:45 -04:00
paul chipchase
447771b1a7 Remove debug code accidently submitted in CL 25066347
#rb trivial
#jira none
#rnx
#preflight 643d4f59930b3b84922485c2

[CL 25067672 by paul chipchase in ue5-main branch]
2023-04-17 10:15:35 -04:00
paul chipchase
a8717da576 Do not record VA caching statistics if no payload was actually cached because they were already present in the backend.
#rb trivial
#jira UE-182205
#rnx
#preflight 643d3249a35280ed4fca3097

- If all payloads were already in the backend we would still record the time taken to query but do not increment the number of hits nor the size of the payloads. Without a stat for "payloads skipped" which we do not currently have any interest in adding, recording the time taken to query where no transfer takes place just ends up being misleading and looks like a bug.

[CL 25066475 by paul chipchase in ue5-main branch]
2023-04-17 08:06:12 -04:00
paul chipchase
2fd6372116 Add a new config option 'ForceCachingOnPull' to VA that when true will force backends to re-upload payloads when caching.
#rb none
#jira UE-182205
#preflight 643d2901c947f6523a2f5845

- Most backends support some form of existence check which is run before a push to prevent uploading data that is already there. Sometimes we want to ignore that check (bugs in the backend etc) and need a way to force that to happen.
- The new config option [Core.VirtualizationModule]:ForceCachingOnPull (default false) will do this when set to true.
- The file and DDC backends will respect the flag but for now the source control backend will continue to check to avoid accidental pointless revisions being added.

[CL 25066347 by paul chipchase in ue5-main branch]
2023-04-17 07:45:19 -04:00