Skip to content

Commit

Permalink
Merge branch 'main' into js/refactor-board-remove-intersection-observer
Browse files Browse the repository at this point in the history
  • Loading branch information
brandstetterm authored Jan 13, 2025
2 parents 59252d9 + d4666e5 commit 918a6e7
Show file tree
Hide file tree
Showing 389 changed files with 12,467 additions and 7,494 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/clean_packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Remove old unused scrumlr packages

on:
schedule:
- cron: "0 7 * * 1-5" # every monday through friday at 7 am

jobs:
clean_scrumlr_server_packages:
name: "clean scrumlr server packages"
runs-on: ubuntu-latest
steps:
- uses: actions/delete-package-versions@v5
with:
package-name: "scrumlr.io/scrumlr-server"
package-type: "container"
min-versions-to-keep: 256
delete-only-untagged-versions: "true"

clean_scrumlr_frontend_packages:
name: "clean scrumlr frontend packages"
runs-on: ubuntu-latest
steps:
- uses: actions/delete-package-versions@v5
with:
package-name: "scrumlr.io/scrumlr-frontend"
package-type: "container"
min-versions-to-keep: 256
delete-only-untagged-versions: "true"
13 changes: 7 additions & 6 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v4
id: yarn-cache
Expand Down Expand Up @@ -85,7 +85,8 @@ jobs:
- name: Go lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.54
version: v1.61
skip-pkg-cache: true
working-directory: ./server/src/

- name: Build server
Expand All @@ -96,19 +97,19 @@ jobs:
package:
needs: [test-frontend, test-backend]
uses: inovex/scrumlr.io/.github/workflows/package.yml@main
uses: ./.github/workflows/package.yml

deploy_to_dev_cluster:
needs: package
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.user.login != 'dependabot[bot]' || github.ref_name == 'main' }}
uses: inovex/scrumlr.io/.github/workflows/deploy_to_dev_cluster.yml@main
uses: ./.github/workflows/deploy_to_dev_cluster.yml
secrets: inherit
with:
frontend_image_tag: ${{ needs.package.outputs.frontend-image-tag }}
server_image_tag: ${{ needs.package.outputs.server-image-tag }}

docs_changes:
if : ${{ github.ref == 'refs/heads/main' }}
if : ${{ github.event_name == 'pull_request' && github.event.pull_request.user.login != 'dependabot[bot]' || github.ref_name == 'main' }}
runs-on: ubuntu-latest
steps:
- name: checkout repository
Expand All @@ -129,7 +130,7 @@ jobs:
deploy_github_pages:
needs: docs_changes
if: ${{ needs.docs_changes.outputs.docs_changed == 'true' }}
uses: inovex/scrumlr.io/.github/workflows/deploy_docs.yml@main
uses: ./.github/workflows/deploy_docs.yml
secrets: inherit
deployment_health_check:
needs: deploy_to_dev_cluster
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
deploy:
needs: build
runs-on: ubuntu-latest
if: ${{ github.ref_name == 'main' }}
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy_to_dev_cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ jobs:
pull-requests: write
steps:
- name: Install kubectl
uses: azure/setup-kubectl@v3
uses: azure/setup-kubectl@v4
id: install
- name: Set up Kubernetes Auth
uses: azure/k8s-set-context@v3
uses: azure/k8s-set-context@v4
with:
method: service-account
k8s-secret: ${{ secrets.KUBERNETES_SECRET }}
k8s-url: https://kubernetes.default.svc

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Replace template variables
run: |
Expand All @@ -50,7 +50,7 @@ jobs:
cat k8s/deployment.yaml
- name: Deploy to dev cluster
uses: Azure/k8s-deploy@v4
uses: Azure/k8s-deploy@v5
with:
namespace: scrumlr-dev-deployments
force: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
org.opencontainers.image.description=The web client for scrumlr.io
- name: Build and push frontend images
uses: docker/build-push-action@v4
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:
org.opencontainers.image.description=The server for scrumlr.io
- name: Build and push server images
uses: docker/build-push-action@v4
uses: docker/build-push-action@v6
with:
context: ./server/src
file: ./server/src/Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ on:

jobs:
package:
uses: inovex/scrumlr.io/.github/workflows/package.yml@main
uses: ./.github/workflows/package.yml


8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
FROM node:lts-hydrogen as build-stage
FROM node:iron-alpine AS build-stage

WORKDIR /usr/src/app

COPY package.json yarn.lock ./
RUN yarn install

RUN yarn install --network-timeout 240000

COPY src/ src/
COPY public/ public/
Expand All @@ -15,7 +16,7 @@ COPY .env .

RUN yarn build

FROM nginxinc/nginx-unprivileged:1.21-alpine
FROM nginxinc/nginx-unprivileged:1.27-alpine

# Toggle visibility of cookie policy, privacy policy, and terms & conditions
ENV SCRUMLR_SHOW_LEGAL_DOCUMENTS=''
Expand All @@ -32,6 +33,7 @@ ENV SCRUMLR_LISTEN_PORT='8080'
# Analytics variables
ENV SCRUMLR_ANALYTICS_DATA_DOMAIN=''
ENV SCRUMLR_ANALYTICS_SRC=''
ENV SCRUMLR_CLARITY_ID=''

COPY ./nginx.conf /etc/nginx/templates/scrumlr.io.conf.template
COPY --from=build-stage /usr/src/app/build /usr/share/nginx/html
Expand Down
2 changes: 2 additions & 0 deletions deployment/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.env
jwt.key
2 changes: 1 addition & 1 deletion deployment/SKE/create_db_job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
spec:
containers:
- name: create-db
image: postgres:16.3-alpine
image: postgres:16.4-alpine
env:
- name: DB_URL
value: "$DB_URL"
Expand Down
11 changes: 9 additions & 2 deletions deployment/docker/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
ANALYTICS_DATA_DOMAIN=
ANALYTICS_SRC=
# Auth Providers
AUTH_CALLBACK_HOST=
APPLE_CLIENT_ID=
APPLE_CLIENT_SECRET=
AZURE_AD_CLIENT_ID=
Expand All @@ -16,6 +17,11 @@ GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
MICROSOFT_CLIENT_ID=
MICROSOFT_CLIENT_SECRET=
OIDC_CLIENT_ID=
OIDC_CLIENT_SECRET=
OIDC_DISCOVERY_URL=http://oidc.localhost:5556/dex/.well-known/openid-configuration
# Session Secret
SESSION_SECRET=
# Your Postgres Password
POSTGRES_PASSWORD=
# Redis if you use it instead of NATS
Expand All @@ -35,10 +41,11 @@ SCRUMLR_SERVER_NATS_URL="nats://nats:4222"
# Server Port
SCRUMLR_SERVER_PORT=8080
# Server URL
SCRUMLR_SERVER_URL="http://localhost:8080/api"
SCRUMLR_SERVER_URL="/api"
# Show Legal Documents (Cookie Policy, Privacy Policy, Terms of Service)
SCRUMLR_SHOW_LEGAL_DOCUMENTS=true
# Websocket URL (wss:// or ws://)
SCRUMLR_WEBSOCKET_URL="ws://localhost:8080/api"
# SCRUMLR_WEBSOCKET_URL="ws://localhost:8080/api"
# Webhook URL for feedback
WEBHOOK_URL=
SCRUMLR_CLARITY_ID=
14 changes: 14 additions & 0 deletions deployment/docker/Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
0.0.0.0:80 {
log {
output stdout
}
@api {
path /api*
}
reverse_proxy @api scrumlr-backend:8080

@frontend {
path / /static* /locales* /login* /board* /new* /timer_finished.mp3 /hotkeys.pdf /legal/* /manifest.json /service-worker.js
}
reverse_proxy @frontend scrumlr-frontend:8080
}
26 changes: 26 additions & 0 deletions deployment/docker/dex.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---

issuer: 'http://oidc.localhost:5556/dex'

storage:
type: memory

web:
http: '0.0.0.0:5556'

staticClients:
- id: ''
redirectURIs:
- 'http://localhost:8080/api/login/oidc/callback'
name: ''
secret: ''

enablePasswordDB: true
staticPasswords:
- email: ''
# bcrypt hash of the string "password": $(echo password | htpasswd -BinC 10 admin | cut -d: -f2)
hash: ''
username: ''
userID: ''


40 changes: 31 additions & 9 deletions deployment/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
version: '3.8'
version: "3.8"

services:
scrumlr-backend:
restart: always
build:
context: ../server/src/
dockerfile: Dockerfile
image: ghcr.io/inovex/scrumlr.io/scrumlr-server:3.10.1
command:
- "/app/main"
- "-disable-check-origin"
Expand All @@ -21,13 +19,18 @@ services:
SCRUMLR_FEEDBACK_WEBHOOK_URL: "${WEBHOOK_URL}"
SCRUMLR_BASE_PATH: "${SCRUMLR_BASE_PATH}"
SCRUMLR_INSECURE: "${SCRUMLR_INSECURE}"
SCRUMLR_AUTH_CALLBACK_HOST: "${AUTH_CALLBACK_HOST}"
SCRUMLR_AUTH_GITHUB_CLIENT_ID: "${GITHUB_CLIENT_ID}"
SCRUMLR_AUTH_GITHUB_CLIENT_SECRET: "${GITHUB_CLIENT_SECRET}"
SCRUMLR_AUTH_AZURE_AD_TENANT_ID: "${AZURE_AD_TENANT_ID}"
SCRUMLR_AUTH_AZURE_AD_CLIENT_ID: "${AZURE_AD_CLIENT_ID}"
SCRUMLR_AUTH_AZURE_AD_CLIENT_SECRET: "${AZURE_AD_CLIENT_SECRET}"
SCRUMLR_AUTH_APPLE_CLIENT_ID: "${APPLE_CLIENT_ID}"
SCRUMLR_AUTH_APPLE_CLIENT_SECRET: "${APPLE_CLIENT_SECRET}"
SCRUMLR_AUTH_OIDC_CLIENT_ID: "${OIDC_CLIENT_ID}"
SCRUMLR_AUTH_OIDC_CLIENT_SECRET: "${OIDC_CLIENT_SECRET}"
SCRUMLR_AUTH_OIDC_DISCOVERY_URL: "${OIDC_DISCOVERY_URL}"
SESSION_SECRET: "${SESSION_SECRET}"
# SCRUMLR_CONFIG_PATH: "${SCRUMRL_CONFIG_PATH}"
# Redis variables (if you decide to use Redis instead of NATS)
SCRUMLR_SERVER_REDIS_HOST: "${REDIS_HOST}"
Expand All @@ -41,23 +44,22 @@ services:

scrumlr-frontend:
restart: always
build:
context: ../.
dockerfile: Dockerfile
image: ghcr.io/inovex/scrumlr.io/scrumlr-frontend:3.10.1
environment:
SCRUMLR_SERVER_URL: "${SCRUMLR_SERVER_URL}"
SCRUMLR_WEBSOCKET_URL: "${SCRUMLR_WEBSOCKET_URL}"
SCRUMLR_SHOW_LEGAL_DOCUMENTS: "${SCRUMLR_SHOW_LEGAL_DOCUMENTS}"
# Add missing frontend environment variables here
SCRUMLR_LISTEN_PORT: "${SCRUMLR_LISTEN_PORT}"
SCRUMLR_LISTEN_PORT: "${SCRUMLR_LISTEN_PORT:-8080}"
SCRUMLR_ANALYTICS_DATA_DOMAIN: "${ANALYTICS_DATA_DOMAIN}"
SCRUMLR_ANALYTICS_SRC: "${ANALYTICS_SRC}"
SCRUMLR_CLARITY_ID: "${SCRUMLR_CLARITY_ID}"
ports:
- "9090:8080"

postgres:
restart: always
image: postgres:16.3
image: postgres:16.4
environment:
POSTGRES_DB: scrumlr
POSTGRES_USER: scrumlr
Expand All @@ -74,5 +76,25 @@ services:
- "4222:4222"
- "8222:8222"

# oidc.localhost:
# restart: always
# image: ghcr.io/dexidp/dex:v2.41.1-distroless
# volumes:
# - ./dex.yaml:/etc/dex/config.docker.yaml:ro
# ports:
# - "5556:5556"
# profiles:
# - oidc

caddy:
image: caddy
restart: always
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
ports:
- "80:80"
- "443:443"


volumes:
postgres_data:
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@astrojs/starlight": "^0.21.5",
"astro": "^4.3.5",
"astro": "^4.16.18",
"sharp": "^0.32.5",
"@astrojs/check": "^0.5.10",
"typescript": "^5.4.5"
Expand Down
13 changes: 13 additions & 0 deletions docs/src/content/docs/dev/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,26 @@ $ docker compose --project-directory server/ --profile dev up -d
$ go run . -d "postgres://admin:supersecret@localhost:5432/scrumlr?sslmode=disable" -v --disable-check-origin --insecure
```
## Testing
### Frontend Testing
To run the tests locally, you can use the following command in your terminal:
```bash
yarn test
```

This command will execute the test suite and provide you with detailed feedback on the test results, including any failures or errors encountered. Running tests locally helps you verify that your changes have not introduced any regressions and ensures that the existing functionality remains intact.

### Backend Testing
To ensure the functionality of your backend, you can run tests locally using the following methods:
To test your general Go code, use the built-in testing tool:
```bash
go test ./... -cover -coverprofile=coverage.txt
```
### API Testing
When all backend components are running, you can use Postman tests to check the API. The CLI tool for this is `newman`, which needs to be installed beforehand:
```bash
newman run api.postman_collection.json --env-var "base_url=localhost:8080" --verbose
```

In addition to local testing, we utilize GitHub Actions to automate the testing process for every pull request. GitHub Actions automatically runs the test suite against the proposed changes, providing a clear indication of whether the tests pass or not. This ensures that all tests are passing before merging any changes into the main branch, maintaining the stability and integrity of our codebase.

We strongly encourage contributors to write new tests when introducing new features or modifying existing functionality. These tests help validate the behavior and correctness of the code, making it easier to identify and fix issues early on.
Expand Down
Loading

0 comments on commit 918a6e7

Please sign in to comment.