Merge branch 'main' into carlitosan-beta-fixes

This commit is contained in:
chcurran
2021-04-29 18:21:09 -07:00
20 changed files with 160 additions and 66 deletions
+16 -16
View File
@@ -25,7 +25,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
TEST_SUITE main
TEST_SERIAL
PATH ${CMAKE_CURRENT_LIST_DIR}/physics/TestSuite_Main.py
TIMEOUT 3600
TIMEOUT 1500
RUNTIME_DEPENDENCIES
Legacy::Editor
Legacy::CryRenderNULL
@@ -39,7 +39,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
TEST_SUITE periodic
TEST_SERIAL
PATH ${CMAKE_CURRENT_LIST_DIR}/physics/TestSuite_Periodic.py
TIMEOUT 3600
TIMEOUT 1500
RUNTIME_DEPENDENCIES
Legacy::Editor
Legacy::CryRenderNULL
@@ -71,7 +71,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
TEST_SUITE periodic
TEST_SERIAL
PATH ${CMAKE_CURRENT_LIST_DIR}/scripting/TestSuite_Active.py
TIMEOUT 3600
TIMEOUT 1500
RUNTIME_DEPENDENCIES
Legacy::Editor
Legacy::CryRenderNULL
@@ -85,7 +85,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
TEST_SUITE sandbox
TEST_SERIAL
PATH ${CMAKE_CURRENT_LIST_DIR}/scripting/TestSuite_Sandbox.py
TIMEOUT 3600
TIMEOUT 1500
RUNTIME_DEPENDENCIES
Legacy::Editor
Legacy::CryRenderNULL
@@ -101,7 +101,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
TEST_SUITE main
TEST_SERIAL
PATH ${CMAKE_CURRENT_LIST_DIR}/WhiteBox/TestSuite_Active.py
TIMEOUT 3600
TIMEOUT 1500
RUNTIME_DEPENDENCIES
Legacy::Editor
Legacy::CryRenderNULL
@@ -120,7 +120,7 @@ endif()
# TEST_SUITE main
# TEST_SERIAL
# PATH ${CMAKE_CURRENT_LIST_DIR}/NvCloth/TestSuite_Active.py
# TIMEOUT 3600
# TIMEOUT 1500
# RUNTIME_DEPENDENCIES
# Legacy::Editor
# Legacy::CryRenderNULL
@@ -136,7 +136,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
TEST_SUITE sandbox
TEST_SERIAL
PATH ${CMAKE_CURRENT_LIST_DIR}/EditorPythonBindings
TIMEOUT 3600
TIMEOUT 1500
RUNTIME_DEPENDENCIES
Legacy::Editor
Legacy::CryRenderNULL
@@ -154,7 +154,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
TEST_SUITE periodic
TEST_SERIAL
PATH ${CMAKE_CURRENT_LIST_DIR}/PythonAssetBuilder
TIMEOUT 3600
TIMEOUT 1500
RUNTIME_DEPENDENCIES
Legacy::Editor
Legacy::CryRenderNULL
@@ -173,7 +173,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
TEST_SUITE main
TEST_SERIAL TRUE
PATH ${CMAKE_CURRENT_LIST_DIR}/Blast/TestSuite_Active.py
TIMEOUT 3600
TIMEOUT 1500
RUNTIME_DEPENDENCIES
Legacy::Editor
AZ::AssetProcessor
@@ -196,7 +196,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
TEST_SUITE main
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg
PYTEST_MARKS "not SUITE_sandbox and not SUITE_periodic and not SUITE_benchmark"
TIMEOUT 36000
TIMEOUT 1500
RUNTIME_DEPENDENCIES
AZ::AssetProcessor
Legacy::Editor
@@ -212,7 +212,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
TEST_SUITE sandbox
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg
PYTEST_MARKS "SUITE_sandbox"
TIMEOUT 36000
TIMEOUT 1500
RUNTIME_DEPENDENCIES
AZ::AssetProcessor
Legacy::Editor
@@ -228,7 +228,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
TEST_SUITE periodic
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg
PYTEST_MARKS "SUITE_periodic"
TIMEOUT 3600
TIMEOUT 1500
RUNTIME_DEPENDENCIES
AZ::AssetProcessor
Legacy::Editor
@@ -244,7 +244,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
TEST_SUITE main
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/landscape_canvas
PYTEST_MARKS "not SUITE_sandbox and not SUITE_periodic and not SUITE_benchmark"
TIMEOUT 3600
TIMEOUT 1500
RUNTIME_DEPENDENCIES
AZ::AssetProcessor
Legacy::Editor
@@ -259,7 +259,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
TEST_SUITE periodic
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/landscape_canvas
PYTEST_MARKS "SUITE_periodic"
TIMEOUT 3600
TIMEOUT 1500
RUNTIME_DEPENDENCIES
AZ::AssetProcessor
Legacy::Editor
@@ -274,7 +274,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
TEST_SERIAL
TEST_SUITE periodic
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/gradient_signal
TIMEOUT 3600
TIMEOUT 1500
RUNTIME_DEPENDENCIES
AZ::AssetProcessor
Legacy::Editor
@@ -292,7 +292,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
TEST_SUITE periodic
TEST_SERIAL
PATH ${CMAKE_CURRENT_LIST_DIR}/editor
TIMEOUT 3600
TIMEOUT 1500
RUNTIME_DEPENDENCIES
Legacy::Editor
Legacy::CryRenderNULL
@@ -100,7 +100,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
PATH ${CMAKE_CURRENT_LIST_DIR}/asset_bundler_batch_tests.py
EXCLUDE_TEST_RUN_TARGET_FROM_IDE
TEST_SERIAL
TIMEOUT 3600
TIMEOUT 1500
TEST_SUITE periodic
RUNTIME_DEPENDENCIES
AZ::AssetProcessor
@@ -123,7 +123,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
PATH ${CMAKE_CURRENT_LIST_DIR}/missing_dependency_tests.py
EXCLUDE_TEST_RUN_TARGET_FROM_IDE
TEST_SERIAL
TIMEOUT 3600
TIMEOUT 1500
TEST_SUITE periodic
RUNTIME_DEPENDENCIES
AZ::AssetProcessorBatch
@@ -699,6 +699,10 @@ Data::AssetHandler::LoadResult ScriptSystemComponent::LoadAssetData(
script->m_scriptBuffer.resize(scriptDataLength);
stream->Read(scriptDataLength, script->m_scriptBuffer.data());
// Clear cached references in the event of a successful load. This function has to be queued on
// AssetBus where NotifyAssetReloaded is also queued, to ensure its execution before NotifyAssetReloaded
Data::AssetBus::QueueFunction(&ScriptSystemComponent::ClearAssetReferences, this, asset.GetId());
return Data::AssetHandler::LoadResult::LoadComplete;
}
@@ -769,12 +769,12 @@ namespace AzToolsFramework
template<typename Vertex>
void EditorVertexSelectionBase<Vertex>::DisplayViewport2d(
const AzFramework::ViewportInfo& /*viewportInfo*/,
const AzFramework::ViewportInfo& viewportInfo,
AzFramework::DebugDisplayRequests& debugDisplay)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
m_editorBoxSelect.Display2d(debugDisplay);
m_editorBoxSelect.Display2d(viewportInfo, debugDisplay);
}
template<typename Vertex>
@@ -13,6 +13,7 @@
#include "EditorBoxSelect.h"
#include <AzFramework/Entity/EntityDebugDisplayBus.h>
#include <AzToolsFramework/ViewportSelection/EditorSelectionUtil.h>
#include <QApplication>
@@ -72,7 +73,7 @@ namespace AzToolsFramework
m_previousModifiers = mouseInteraction.m_mouseInteraction.m_keyboardModifiers;
}
void EditorBoxSelect::Display2d(AzFramework::DebugDisplayRequests& debugDisplay)
void EditorBoxSelect::Display2d(const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
@@ -82,12 +83,15 @@ namespace AzToolsFramework
debugDisplay.SetLineWidth(s_boxSelectLineWidth);
debugDisplay.SetColor(s_boxSelectColor);
debugDisplay.DrawWireBox(
AZ::Vector3(
static_cast<float>(m_boxSelectRegion->x()), static_cast<float>(m_boxSelectRegion->y()), 0.0f),
AZ::Vector3(
static_cast<float>(m_boxSelectRegion->x()) + static_cast<float>(m_boxSelectRegion->width()),
static_cast<float>(m_boxSelectRegion->y()) + static_cast<float>(m_boxSelectRegion->height()), 0.0f));
AZ::Vector2 viewportSize = AzToolsFramework::GetCameraState(viewportInfo.m_viewportId).m_viewportSize;
debugDisplay.DrawWireQuad2d(
AZ::Vector2(
aznumeric_cast<float>(m_boxSelectRegion->x()), aznumeric_cast<float>(m_boxSelectRegion->y())) / viewportSize,
AZ::Vector2(
aznumeric_cast<float>(m_boxSelectRegion->x()) + aznumeric_cast<float>(m_boxSelectRegion->width()),
aznumeric_cast<float>(m_boxSelectRegion->y()) + aznumeric_cast<float>(m_boxSelectRegion->height())) / viewportSize,
0.f);
debugDisplay.DepthTestOn();
@@ -42,7 +42,7 @@ namespace AzToolsFramework
const ViewportInteraction::MouseInteractionEvent& mouseInteraction);
/// Responsible for drawing the 2d box representing the selection in screen space.
void Display2d(AzFramework::DebugDisplayRequests& debugDisplay);
void Display2d(const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay);
/// Custom drawing behavior to happen during a box select.
void DisplayScene(
@@ -3494,7 +3494,7 @@ namespace AzToolsFramework
DrawAxisGizmo(viewportInfo, debugDisplay);
m_boxSelect.Display2d(debugDisplay);
m_boxSelect.Display2d(viewportInfo, debugDisplay);
}
void EditorTransformComponentSelection::RefreshSelectedEntityIds()
@@ -10,6 +10,7 @@
"type": "Compute"
}
]
}
},
"DisabledRHIBackends": ["metal"]
}
@@ -12,6 +12,7 @@
"type": "Compute"
}
]
}
},
"DisabledRHIBackends": ["metal"]
}
@@ -731,11 +731,12 @@ namespace AZ
}
}
}
// Remove unnecessary camera views in shadow properties
for (uint16_t lightIndex = 0; lightIndex < aznumeric_cast<uint16_t>(m_shadowProperties.GetDataCount()); ++lightIndex)
auto& shadowPropertiesVector = m_shadowProperties.GetDataVector();
for (ShadowProperty& shadowProperty : shadowPropertiesVector)
{
AZStd::unordered_map<const RPI::View*, AZStd::fixed_vector<CascadeSegment, Shadow::MaxNumberOfCascades>>& cascades = m_shadowProperties.GetData(lightIndex).m_segments;
auto& cascades = shadowProperty.m_segments;
for (auto it = cascades.begin(); it != cascades.end();)
{
if (AZStd::find(cameraViews.begin(), cameraViews.end(), it->first) != cameraViews.end())
@@ -31,6 +31,11 @@
#include <AzFramework/StringFunc/StringFunc.h>
#include <AzCore/Preprocessor/EnumReflectUtils.h>
#include <AzCore/Console/Console.h>
#if defined(OPEN_IMAGE_IO_ENABLED)
#include <OpenImageIO/imageio.h>
#endif
namespace AZ
{
@@ -38,6 +43,41 @@ namespace AZ
{
AZ_ENUM_DEFINE_REFLECT_UTILITIES(FrameCaptureResult);
#if defined(OPEN_IMAGE_IO_ENABLED)
AZ_CVAR(unsigned int,
r_pngCompressionLevel,
3, // A compression level of 3 seems like the best default in terms of file size and saving speeds
nullptr,
ConsoleFunctorFlags::Null,
"Sets the compression level for saving png screenshots. Valid values are from 0 to 8"
);
FrameCaptureOutputResult PngFrameCaptureOutput(
const AZStd::string& outputFilePath, const AZ::RPI::AttachmentReadback::ReadbackResult& readbackResult)
{
using namespace OIIO;
AZStd::unique_ptr<ImageOutput> out = ImageOutput::create(outputFilePath.c_str());
if (out)
{
ImageSpec spec(
readbackResult.m_imageDescriptor.m_size.m_width,
readbackResult.m_imageDescriptor.m_size.m_height,
AZ::RHI::GetFormatComponentCount(readbackResult.m_imageDescriptor.m_format)
);
spec.attribute("png:compressionLevel", r_pngCompressionLevel);
if (out->open(outputFilePath.c_str(), spec))
{
out->write_image(TypeDesc::UINT8, readbackResult.m_dataBuffer->data());
out->close();
return FrameCaptureOutputResult{FrameCaptureResult::Success, AZStd::nullopt};
}
}
return FrameCaptureOutputResult{FrameCaptureResult::InternalError, "Unable to save frame capture output to " + outputFilePath};
}
#endif
FrameCaptureOutputResult DdsFrameCaptureOutput(
const AZStd::string& outputFilePath, const AZ::RPI::AttachmentReadback::ReadbackResult& readbackResult)
{
@@ -377,7 +417,6 @@ namespace AZ
if (readbackResult.m_attachmentType == AZ::RHI::AttachmentType::Buffer)
{
// write buffer data to the data file
AZ::IO::FileIOStream fileStream(m_outputFilePath.c_str(), AZ::IO::OpenMode::ModeWrite | AZ::IO::OpenMode::ModeCreatePath);
if (fileStream.IsOpen())
{
@@ -418,6 +457,18 @@ namespace AZ
m_result = ddsFrameCapture.m_result;
m_latestCaptureInfo = ddsFrameCapture.m_errorMessage.value_or("");
}
#if defined(OPEN_IMAGE_IO_ENABLED)
else if (extension == "png")
{
AZStd::string folderPath;
AzFramework::StringFunc::Path::GetFolderPath(m_outputFilePath.c_str(), folderPath);
AZ::IO::SystemFile::CreateDir(folderPath.c_str());
const auto frameCaptureResult = PngFrameCaptureOutput(m_outputFilePath, readbackResult);
m_result = frameCaptureResult.m_result;
m_latestCaptureInfo = frameCaptureResult.m_errorMessage.value_or("");
}
#endif
else
{
m_latestCaptureInfo = AZStd::string::format("Only supports saving image to ppm or dds files");
@@ -9,3 +9,14 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
set(LY_BUILD_DEPENDENCIES
PRIVATE
3rdParty::OpenImageIO
3rdParty::ilmbase
)
# [GFX-TODO] Add macro defintion in OpenImageIO 3rd party find cmake file
set(LY_COMPILE_DEFINITIONS
PRIVATE
OPEN_IMAGE_IO_ENABLED
)
@@ -416,9 +416,7 @@ namespace AtomToolsFramework
}
AzFramework::ScreenPoint position = AzFramework::WorldToScreen(
worldPosition,
currentView->GetViewToWorldMatrix(),
currentView->GetViewToClipMatrix(),
AZ::Vector2{aznumeric_cast<float>(width()), aznumeric_cast<float>(height())}
GetCameraState()
);
return {position.m_x, position.m_y};
}
@@ -29,7 +29,7 @@ namespace Multiplayer
{
public:
AZ_CLASS_ALLOCATOR(NetworkPrefabProcessor, AZ::SystemAllocator, 0);
AZ_RTTI(NetworkPrefabProcessor, "{AF6C36DA-CBB9-4DF4-AE2D-7BC6CCE65176}", PrefabProcessor);
AZ_RTTI(Multiplayer::NetworkPrefabProcessor, "{AF6C36DA-CBB9-4DF4-AE2D-7BC6CCE65176}", PrefabProcessor);
~NetworkPrefabProcessor() override = default;
@@ -9,14 +9,17 @@
{
"Stack":
{
"PlayInEditor":
[
{ "$type": "AzToolsFramework::Prefab::PrefabConversionUtils::EditorInfoRemover" },
{ "$type": "Multiplayer::NetworkPrefabProcessor" },
{ "$type": "AzToolsFramework::Prefab::PrefabConversionUtils::PrefabCatchmentProcessor" }
],
"GameObjectCreation":
[
{ "$type": "AzToolsFramework::Prefab::PrefabConversionUtils::EditorInfoRemover" },
{ "$type": "{AF6C36DA-CBB9-4DF4-AE2D-7BC6CCE65176}" },
{
"$type": "AzToolsFramework::Prefab::PrefabConversionUtils::PrefabCatchmentProcessor",
"SerializationFormat": "Text" // Options are "Binary" (default) or "Text". Prefer "Binary" for performance.
}
{ "$type": "Multiplayer::NetworkPrefabProcessor" },
{ "$type": "AzToolsFramework::Prefab::PrefabConversionUtils::PrefabCatchmentProcessor" }
]
}
}
+1 -1
View File
@@ -168,7 +168,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
ly_add_googlebenchmark(
NAME Gem::PhysX.Benchmarks
TARGET Gem::PhysX.Tests
TIMEOUT 2400 #40mins
TIMEOUT 1500 #25mins
)
list(APPEND testTargets PhysX.Tests)
+4 -2
View File
@@ -24,8 +24,8 @@ ly_set(LY_PYTEST_EXECUTABLE ${LY_PYTHON_CMD} -B -m pytest -v --tb=short --show-c
ly_set(LY_TEST_GLOBAL_KNOWN_SUITE_NAMES "smoke" "main" "periodic" "benchmark" "sandbox")
ly_set(LY_TEST_GLOBAL_KNOWN_REQUIREMENTS "gpu")
# Set default to 20 minutes
ly_set(LY_TEST_DEFAULT_TIMEOUT 1200)
# Set default test aborts to 25 minutes, avoids hitting the CI pipeline inactivity timeout usually set to 30 minutes
ly_set(LY_TEST_DEFAULT_TIMEOUT 1500)
# Add the CMake Test targets for each suite if testing is supported
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
@@ -115,6 +115,8 @@ function(ly_add_test)
# Set default test module timeout
if(NOT ly_add_test_TIMEOUT)
set(ly_add_test_TIMEOUT ${LY_TEST_DEFAULT_TIMEOUT})
elseif(ly_add_test_TIMEOUT GREATER LY_TEST_DEFAULT_TIMEOUT)
message(WARNING "TIMEOUT for test ${ly_add_test_NAME} set at ${ly_add_test_TIMEOUT} seconds which is longer than the default of ${LY_TEST_DEFAULT_TIMEOUT}. Allowing a single module to run exceedingly long creates problems in a CI pipeline.")
endif()
if(NOT ly_add_test_TEST_COMMAND)
+13 -6
View File
@@ -159,15 +159,15 @@ function(ly_generate_target_config_file NAME)
elseif(target_type STREQUAL MODULE_LIBRARY)
string(APPEND target_location "\"\${LY_ROOT_FOLDER}/${library_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG>/${target_library_output_subdirectory}/$<TARGET_FILE_NAME:${NAME}>\"")
elseif(target_type STREQUAL SHARED_LIBRARY)
string(APPEND target_location "\"\${LY_ROOT_FOLDER}/${archive_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG>/$<TARGET_LINKER_FILE_NAME:${NAME}>\"")
string(APPEND target_location "\"\${LY_ROOT_FOLDER}/${archive_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG>/$<TARGET_LINKER_FILE_NAME:${NAME}>\"")
string(APPEND target_file_contents "ly_add_dependencies(${NAME} \"\${LY_ROOT_FOLDER}/${library_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG>/${target_library_output_subdirectory}/$<TARGET_FILE_NAME:${NAME}>\")\n")
else() # STATIC_LIBRARY, OBJECT_LIBRARY, INTERFACE_LIBRARY
string(APPEND target_location "\"\${LY_ROOT_FOLDER}/${archive_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG>/$<TARGET_LINKER_FILE_NAME:${NAME}>\"")
endif()
string(APPEND target_file_contents
string(APPEND target_file_contents
"set(target_location ${target_location})
set_target_properties(${NAME}
set_target_properties(${NAME}
PROPERTIES
$<$<CONFIG:profile>:IMPORTED_LOCATION \"\${target_location}\">
IMPORTED_LOCATION_$<UPPER_CASE:$<CONFIG>> \"\${target_location}\"
@@ -327,11 +327,18 @@ function(ly_setup_others)
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
# Gem Source Assets
# Gem Source Assets and Registry
# Find all gem directories relative to the CMake Source Dir
file(GLOB_RECURSE gems_assets_path RELATIVE ${CMAKE_SOURCE_DIR} "Gems/*/Assets")
foreach (gem_assets_path ${gems_assets_path})
file(
GLOB_RECURSE
gems_assets_path
LIST_DIRECTORIES TRUE
RELATIVE "${CMAKE_SOURCE_DIR}/"
"Gems/*"
)
list(FILTER gems_assets_path INCLUDE REGEX "/(Assets|Registry)$")
foreach (gem_assets_path ${gems_assets_path})
set(gem_abs_assets_path ${CMAKE_SOURCE_DIR}/${gem_assets_path}/)
if (EXISTS ${gem_abs_assets_path})
# The trailing slash is IMPORTANT here as that is needed to prevent
@@ -80,6 +80,10 @@ def create_response(status, success=0, failure=0, repository_name=None, branch_n
'statusCode': 401,
'body': 'Unauthorized',
'isBase64Encoded': 'false'
},
'unsupported': {
'statusCode': 204,
'isBase64Encoded': 'false'
}
}
return response[status]
@@ -90,17 +94,24 @@ def lambda_handler(event, context):
if event.get('resource', '') == '/delete-github-branch-ebs':
headers = event['headers']
payload = event['body']
if headers['X-GitHub-Event'] == 'delete':
# Validate github webhook request here since request body cannot be passed to API Gateway lambda authorizer.
if verify_signature(headers, payload):
# Convert payload from string type to json to get repository name and branch name
payload = json.loads(payload)
repository_name = payload['repository']['full_name']
# Validate github webhook request here since request body cannot be passed to API Gateway lambda authorizer.
if verify_signature(headers, payload):
# Convert payload from string type to json to get repository name and branch name
payload = json.loads(payload)
repository_name = payload['repository']['full_name']
if headers['X-GitHub-Event'] == 'delete':
# On Github branch/tag delete event
branch_name = payload['ref']
(success, failure) = delete_volumes(repository_name, branch_name)
if not failure:
return create_response('success', success, failure, repository_name, branch_name)
else:
return create_response('failure', success, failure, repository_name, branch_name)
elif headers['X-GitHub-Event'] == 'pull_request' and payload['action'] == 'closed':
# On Github pull request closed event
pull_request_number = payload['number']
branch_name = f'PR-{pull_request_number}'
else:
return create_response('unauthorized')
return create_response('unsupported')
(success, failure) = delete_volumes(repository_name, branch_name)
if not failure:
return create_response('success', success, failure, repository_name, branch_name)
else:
return create_response('failure', success, failure, repository_name, branch_name)
else:
return create_response('unauthorized')
+1 -1
View File
@@ -55,7 +55,7 @@ def get_shader_list(project_path, asset_platform, shader_type, shader_platform,
parser = argparse.ArgumentParser(description='Gets the shader list for a specific platform from the current shader compiler server')
parser.add_argument('-g', 'project-path', type=pathlib.Path, required=True, help="Path to the project")
parser.add_argument('-g', '--project-path', type=pathlib.Path, required=True, help="Path to the project")
parser.add_argument('asset-platform', type=str, help="The asset cache sub folder to use for shader generation")
parser.add_argument('shader-type', type=str, help="The shader type to use")
parser.add_argument('-p', '--shader_platform', type=str, required=False, default='', help="The target platform to generate shaders for.")