diff --git a/.github/workflows/deploy-naos.yml b/.github/workflows/deploy-naos.yml index ac8c750639..00de4f325f 100644 --- a/.github/workflows/deploy-naos.yml +++ b/.github/workflows/deploy-naos.yml @@ -32,18 +32,3 @@ jobs: token: ${{secrets.GITHUB_TOKEN}} label: deploy naos type: remove - - name: Get tag name - id: tag_name - run: echo "tag_name=$(date +'%Y.%m.%d-%H:%M')" >> "$GITHUB_ENV" - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Create Sentry release - uses: getsentry/action-release@v1 - env: - SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - SENTRY_ORG: dodona - SENTRY_PROJECT: dodona-frontend - with: - environment: staging - version: ${{ env.tag_name }} diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml index 3249b7c4f3..c6ee9f0848 100644 --- a/.github/workflows/deploy-production.yml +++ b/.github/workflows/deploy-production.yml @@ -22,18 +22,3 @@ jobs: - name: Run deploy run: | echo "deploy production $GITHUB_SHA" | ssh -p 4840 dodona@mestra.ugent.be - - name: Get tag name - id: tag_name - run: echo "tag_name=$(date +'%Y.%m.%d-%H:%M')" >> "$GITHUB_ENV" - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Create Sentry release - uses: getsentry/action-release@v1 - env: - SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - SENTRY_ORG: dodona - SENTRY_PROJECT: dodona-frontend - with: - environment: production - version: ${{ env.tag_name }} diff --git a/app/assets/javascripts/sentry.ts b/app/assets/javascripts/sentry.ts index 7ab0736567..ed2709c561 100644 --- a/app/assets/javascripts/sentry.ts +++ b/app/assets/javascripts/sentry.ts @@ -1,18 +1,15 @@ import * as Sentry from "@sentry/browser"; -const HOST_TO_ENVIRONMENT: Record = { - "dodona.localhost": "development", - "naos.dodona.be": "staging", - "dodona.be": "production", -}; - export function initSentry(): void { - const environment = window.location.hostname in HOST_TO_ENVIRONMENT ? - HOST_TO_ENVIRONMENT[window.location.hostname] : "unknown"; + const environmentTag = document.querySelector("meta[name='environment']"); + const environment = environmentTag?.getAttribute("content") ?? "unknown"; + const releaseTag = document.querySelector("meta[name='version']"); + const release = releaseTag?.getAttribute("content") ?? "unknown"; // config options can be found at https://docs.sentry.io/platforms/javascript/configuration/ Sentry.init({ dsn: "https://18315b6d60f9329de56983fd94f67db9@o4507329115783168.ingest.de.sentry.io/4507333215256657", environment, + release, }); } diff --git a/app/javascript/packs/frame.js b/app/javascript/packs/frame.js index 824de94580..36022c05cd 100644 --- a/app/javascript/packs/frame.js +++ b/app/javascript/packs/frame.js @@ -1,5 +1,7 @@ import "core-js/stable"; import "regenerator-runtime/runtime"; +import { initSentry } from "sentry"; +initSentry(); // bootstrap import { Alert, Button, Collapse, Dropdown, Modal, Popover, Tab, Tooltip } from "bootstrap"; diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 112b99732b..c05777484d 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -16,6 +16,8 @@ + + "> "> diff --git a/app/views/layouts/frame.html.erb b/app/views/layouts/frame.html.erb index 4856f80575..abeada8719 100644 --- a/app/views/layouts/frame.html.erb +++ b/app/views/layouts/frame.html.erb @@ -7,6 +7,8 @@ + + <%= yield :meta_tags %> diff --git a/app/views/layouts/lti.html.erb b/app/views/layouts/lti.html.erb index 46acabf3b5..417f79b01c 100644 --- a/app/views/layouts/lti.html.erb +++ b/app/views/layouts/lti.html.erb @@ -4,6 +4,8 @@ + + <%= yield :meta_tags %> Dodona<%= " - #{@title}" if @title %>