Skip to content

Commit

Permalink
Adding Sentry config (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
sree-cfa authored Feb 28, 2024
1 parent 6ec47a6 commit b8981d2
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

- name: Run and Build Application
run: ./gradlew build
run: ./gradlew build -x sentryBundleSourcesJava
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/deploy-to-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ jobs:
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.APTIBLE_SSH_PRIVATE_KEY }}
- name: Generate Sentry release name from sha
id: generate-release
run: echo "::set-output name=RELEASE::$(git rev-parse HEAD)"
- name: Deploy Using Aptible CLI
run: |
ssh-keyscan beta.aptible.com >> ~/.ssh/known_hosts
Expand All @@ -42,7 +45,18 @@ jobs:
'SPRING_DATASOURCE_USERNAME=${{ secrets.SPRING_DATASOURCE_USERNAME }}' \
'SPRING_DATASOURCE_PASSWORD=${{ secrets.SPRING_DATASOURCE_PASSWORD }}' \
'SPRING_PROFILES_ACTIVE=staging' \
'SENTRY_DSN=${{ secrets.SENTRY_DSN }}' \
'SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}' \
'SENTRY_ENVIRONMENT=staging' \
'CLAMAV_URL=${{ vars.CLAMAV_URL }}'
- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: codeforamerica
SENTRY_PROJECT: il-gcc
with:
environment: staging
- name: Announce on Slack when deploy fails
uses: ravsamhq/notify-slack-action@v2
with:
Expand Down
22 changes: 22 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ plugins {
id 'jacoco'
id "org.flywaydb.flyway" version "[9.+,10.0["
id 'io.miret.etienne.sass' version '1.5.0'
id "io.sentry.jvm.gradle" version "4.3.0"
}

jacoco {
Expand Down Expand Up @@ -150,6 +151,19 @@ def sassConfiguration = { CompileSass task ->
task.outputDir = project.file("${projectDir}/generated/main/resources/static/assets/css")
}

test {
useJUnitPlatform {
JUnitPlatformOptions options ->
options.excludeTags("a11y")
}
}


tasks.withType(Test).configureEach {
environment("SENTRY_DSN", "")
environment("MIXPANEL_API_KEY", "this-is-a-dummy-key-for-tests")
}

tasks.named('compileSass', CompileSass).configure { task ->
group 'cfa-uswds'
description = 'Compile Sass files into CSS.'
Expand Down Expand Up @@ -221,6 +235,14 @@ processResources {
}
}

sentry {
includeSourceContext = true

org = "codeforamerica"
projectName = "il-gcc"
authToken = System.getenv("SENTRY_AUTH_TOKEN")
}

jar {
enabled false
}
3 changes: 3 additions & 0 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ logging:
level:
root: INFO
org.springframework.web: ERROR
sentry:
dsn: ${SENTRY_DSN}
traces-sample-rate: 0.6
server:
tomcat:
max-http-form-post-size: ${form-flow.uploads.max-file-size}MB
Expand Down

0 comments on commit b8981d2

Please sign in to comment.