Skip to content

Commit

Permalink
feat: add sentry integration (#460)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuruk-mm authored Jan 19, 2023
1 parent cc60c57 commit 8f53340
Show file tree
Hide file tree
Showing 18 changed files with 802 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,20 @@ jobs:
checkout:
<<: *working_directory_root
docker:
- image: cimg/base:2021.04
- image: cimg/node:14.19.3-browsers
steps:
- run:
name: Prepare image
command: |
sudo apt-get update
sudo apt-get install -y jq
- checkout
- run:
name: Update sentry params
command: |
cd scripts
npm install
npm run inject-sentry-params
# persist to workspace to use in downstream jobs
- persist_to_workspace:
Expand Down
3 changes: 3 additions & 0 deletions ci-playmode-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ source ci-setup.sh

echo "Running playmode tests for $PROJECT_PATH"

# Disable Sentry
sed -i 's/<Enabled>k__BackingField: 1/<Enabled>k__BackingField: 0/' unity-renderer-desktop/Assets/Resources/Sentry/SentryOptions.asset

xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' $UNITY_PATH/Editor/Unity \
-batchmode \
-projectPath "$PROJECT_PATH" \
Expand Down
130 changes: 130 additions & 0 deletions scripts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
46 changes: 46 additions & 0 deletions scripts/download-and-generate-renderer-protocol.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env bash
set -e

install_proto()
{
PROTOC_PATH=node_modules/.bin/protobuf/bin/protoc
if [[ ! -f "$PROTOC_PATH" ]]; then # Check if is instaled
PROTOBUF_VERSION=3.20.1

if [[ "$OSTYPE" == "darwin"* ]]; then
PROTOBUF_ZIP=protoc-${PROTOBUF_VERSION}-osx-x86_64.zip
else
PROTOBUF_ZIP=protoc-${PROTOBUF_VERSION}-linux-x86_64.zip
fi
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/${PROTOBUF_ZIP}
mkdir -p node_modules/.bin/protobuf
unzip -o ${PROTOBUF_ZIP} -d node_modules/.bin/protobuf
rm ${PROTOBUF_ZIP}

chmod +x "${PROTOC_PATH}"
fi
echo "${PROTOC_PATH}" # Return protoc path
}

mkdir -p temp && cd temp
PROTOC=$(install_proto)
npm install @dcl/protocol@next
npm install protoc-gen-dclunity@next

RENDERER_PROTOCOL_PATH=node_modules/@dcl/protocol/renderer-protocol/
CODEGEN_PLUGIN_PATH=node_modules/protoc-gen-dclunity/dist/index.js
OUTPUT_PATH=unity-renderer/Assets/Scripts/MainScripts/DCL/WorldRuntime/KernelCommunication/RPC/GeneratedCode/
mkdir -p ${OUTPUT_PATH}


PROTOS=$(find "${RENDERER_PROTOCOL_PATH}" -name '*.proto' -print)

echo "Generating: "
echo ${PROTOS}

PROTOC \
--plugin=protoc-gen-dclunity="${CODEGEN_PLUGIN_PATH}" \
--dclunity_out="${OUTPUT_PATH}" \
--csharp_out="${OUTPUT_PATH}" \
--csharp_opt=file_extension=.gen.cs \
"${PROTOS}"
Loading

0 comments on commit 8f53340

Please sign in to comment.