Skip to content

Commit

Permalink
feat(godot): Add godot onboarding
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiborza committed Aug 21, 2024
1 parent 9edbb44 commit 814e0ee
Show file tree
Hide file tree
Showing 9 changed files with 142 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/sentry/models/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"go-iris",
"go-martini",
"go-negroni",
"godot",
"ionic",
"java",
"java-log4j2",
Expand Down
1 change: 1 addition & 0 deletions src/sentry/utils/platform_categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
"dotnet-wpf",
"electron",
"flutter",
"godot",
"java",
"javascript-electron",
"kotlin",
Expand Down
1 change: 1 addition & 0 deletions static/app/data/platformPickerCategories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ const desktop: Set<PlatformKey> = new Set([
'dotnet-wpf',
'electron',
'flutter',
'godot',
'java',
'kotlin',
'minidump',
Expand Down
7 changes: 7 additions & 0 deletions static/app/data/platforms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,13 @@ export const platforms: PlatformIntegration[] = [
name: 'Negroni',
language: 'go',
},
{
link: 'https://docs.sentry.io/platforms/godot/',
type: 'framework',
id: 'godot',
name: 'Godot',
language: 'godot',
},
{
id: 'ionic',
name: 'Ionic',
Expand Down
18 changes: 18 additions & 0 deletions static/app/gettingStartedDocs/godot/godot.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import {renderWithOnboardingLayout} from 'sentry-test/onboarding/renderWithOnboardingLayout';
import {screen} from 'sentry-test/reactTestingLibrary';

import docs from './godot';

describe('getting started with unreal', function () {
it('renders docs correctly', function () {
renderWithOnboardingLayout(docs);

// Renders main headings
expect(screen.getByRole('heading', {name: 'Install'})).toBeInTheDocument();
expect(screen.getByRole('heading', {name: 'Configure SDK'})).toBeInTheDocument();
expect(screen.getByRole('heading', {name: 'Verify'})).toBeInTheDocument();
expect(
screen.getByRole('heading', {name: 'Upload Debug Symbols'})
).toBeInTheDocument();
});
});
113 changes: 113 additions & 0 deletions static/app/gettingStartedDocs/godot/godot.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
import {Fragment} from 'react';
import styled from '@emotion/styled';

import createSentryNode from 'sentry-images/onboarding/godot/create-sentry-node.png';
import sentryNodePropertyEditor from 'sentry-images/onboarding/godot/sentry-node-property-editor.png';

import ExternalLink from 'sentry/components/links/externalLink';
import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
import type {
Docs,
OnboardingConfig,
} from 'sentry/components/onboarding/gettingStartedDoc/types';
import {t, tct} from 'sentry/locale';
import {space} from 'sentry/styles/space';

const getVerifySnippet = () => `
SentrySdk.capture_message("Test event")
`;

const onboarding: OnboardingConfig = {
install: () => [
{
type: StepType.INSTALL,
description: tct(
"Install the SDK by downloading the [releasesLink:latest release] and placing the GDExtension into your project's bin directory.",
{
releasesLink: (
<ExternalLink href="https://github.com/getsentry/sentry-godot/releases" />
),
}
),
additionalInfo: tct(
'See the [godotSDKDocumentationLink:Godot SDK Documentation] for additional information.',
{
godotSDKDocumentationLink: (
<ExternalLink href="https://docs.sentry.io/platforms/godot/" />
),
}
),
},
],
configure: params => [
{
type: StepType.CONFIGURE,
description: (
<Fragment>
<p>
{tct(
'Create a [code:SentryNode] and make it the root of your project. If you have an existing project, change the root type of your project to [code:SentryNode]. Alternatively, if you cannot change the type of your root node, add a [code:SentryNode] as high up in your scene tree as possible.',
{code: <code />}
)}
</p>
<Image src={createSentryNode} />
<p>
{tct(
'Configure the Sentry SDK directly on the [code:SentryNode] in the property editor. Read about the available options in the [link:Sentry SDK Documentation].',
{
code: <code />,
link: (
<ExternalLink href="https://docs.sentry.io/platforms/native/configuration/options/" />
),
}
)}
</p>
<Image src={sentryNodePropertyEditor} />
<p>
{tct('Enter the following DSN for the [code:Dsn] option.', {code: <code />})}
</p>
</Fragment>
),
configurations: [
{
language: 'url',
code: params.dsn.public,
},
],
additionalInfo: t(
"And that's it! Now you can use Sentry to capture messages and other data."
),
},
],
verify: () => [
{
type: StepType.VERIFY,
description: t(
'Once the SDK is configured with the DSN you can call the SDK from anywhere:'
),
configurations: [
{
language: 'c',
code: getVerifySnippet(),
},
],
},
],
};

const docs: Docs = {
onboarding,
};

export default docs;

export const Image = styled('img')`
height: 720px;
margin-bottom: ${space(4)};
/** override styles in less files */
max-width: 1280px !important;
box-shadow: none !important;
border: 0 !important;
border-radius: 0 !important;
`;
1 change: 1 addition & 0 deletions static/app/types/project.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export type PlatformKey =
| 'go-iris'
| 'go-martini'
| 'go-negroni'
| 'godot'
| 'groovy'
| 'ionic'
| 'java'
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 814e0ee

Please sign in to comment.