Skip to content

Commit

Permalink
Merge branch 'main' into skander/spectrograms
Browse files Browse the repository at this point in the history
  • Loading branch information
skanderm committed Aug 20, 2024
2 parents 1b804a9 + 12a1b40 commit 65fe710
Show file tree
Hide file tree
Showing 33 changed files with 2,487 additions and 1,771 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ assignees: ''
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
A clear and concise description of what the problem is. Example: I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.
Expand Down
59 changes: 42 additions & 17 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,53 @@
# See https://docs.github.com/en/code-security/dependabot/dependabot-alerts/configuring-dependabot-alerts
version: 2
updates:
# Updates Elixir dependencies
- package-ecosystem: mix
directory: server/
# Updates GHA dependencies
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
day: monday
time: "05:00"
timezone: America/Los_Angeles
# Will only open a maximum of 3 PRs
groups:
actions:
patterns:
- "*"
open-pull-requests-limit: 3
# Updates GHA dependencies
- package-ecosystem: github-actions

# Updates Docker dependencies
- package-ecosystem: docker
directory: /
schedule:
interval: weekly
day: monday
time: "05:00"
timezone: America/Los_Angeles
open-pull-requests-limit: 3
ignore:
# Ignore odd-numbered node versions because they're not LTS
# Have to manage this manually until https://github.com/dependabot/dependabot-core/issues/2247 is resolved
# Even-numbered releases also need to be ignored for the first 6 months,
# but there's no way to configure that in Dependabot yet
- dependency-name: node
versions: ["21.x", "23.x", "25.x", "27.x"]

# Updates Elixir dependencies
- package-ecosystem: mix
directory: server/
schedule:
interval: weekly
day: monday
time: "05:00"
timezone: America/Los_Angeles
# Will only open a maximum of 3 PRs
open-pull-requests-limit: 3

# Updates JavaScript dependencies
- package-ecosystem: npm
directory: /ui
schedule:
interval: daily
interval: weekly
time: "05:00"
timezone: America/Los_Angeles
open-pull-requests-limit: 3
Expand All @@ -48,9 +71,11 @@ updates:
patterns:
- "graphql"
- "@graphql-codegen/*"
- "@tanstack/react-query"
- "@tanstack/react-query*"
map:
patterns:
- "leaflet"
- "leaflet*"
- "react-leaflet"
- "@types/leaflet"
Expand All @@ -61,6 +86,7 @@ updates:
- "@types/video.js"
code-style:
patterns:
- "eslint"
- "eslint*"
- "@typescript-eslint/*"
- "prettier"
Expand All @@ -69,17 +95,16 @@ updates:
misc:
patterns:
- "*"
# Open individual PRs for the following packages
exclude-patterns:
# Open individual PRs for the following packages
- "typescript"
- "phoenix"
- "@types/node"
# Updates Docker dependencies
- package-ecosystem: docker
directory: /
schedule:
interval: weekly
day: monday
time: "05:00"
timezone: America/Los_Angeles
open-pull-requests-limit: 3
ignore:
# Ignore until nextjs adds eslint 9 support https://github.com/vercel/next.js/issues/64409
- dependency-name: "eslint"
versions: ["9.0 - 9.9"]
- dependency-name: "eslint-plugin-unused-imports"
versions: ["4.0 - 4.1"]
- dependency-name: "@typescript-eslint/eslint-plugin"
versions: ["8.0 - 8.1"]
7 changes: 5 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,19 @@ on:
pull_request:
branches: [main]

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
- uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Build containers
run: docker compose build --build-arg MIX_ENV=test
Expand Down
78 changes: 78 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: ["main"]
pull_request:
# The branches below must be a subset of the branches above
branches: ["main"]
schedule:
- cron: "27 6 * * 3"

permissions:
contents: read

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ["javascript-typescript"]
# CodeQL supports [ $supported-codeql-languages ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit

- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@29d86d22a34ea372b1bbf3b2dced2e25ca6b3384 # v3.26.1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@29d86d22a34ea372b1bbf3b2dced2e25ca6b3384 # v3.26.1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@29d86d22a34ea372b1bbf3b2dced2e25ca6b3384 # v3.26.1
with:
category: "/language:${{matrix.language}}"
27 changes: 27 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Dependency Review Action
#
# This Action will scan dependency manifest files that change as part of a Pull Request,
# surfacing known-vulnerable versions of the packages declared or updated in the PR.
# Once installed, if the workflow run is marked as required,
# PRs introducing known-vulnerable packages will be blocked from merging.
#
# Source repository: https://github.com/actions/dependency-review-action
name: 'Dependency Review'
on: [pull_request]

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit

- name: 'Checkout Repository'
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: 'Dependency Review'
uses: actions/dependency-review-action@5a2ce3f5b92ee19cbb1541a4984c76d921601d7c # v4.3.4
7 changes: 5 additions & 2 deletions .github/workflows/fast-forward.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
issue_comment:
types: [created, edited]

permissions:
contents: read

jobs:
fast-forward:
# Only run if the comment contains the /fast-forward command.
Expand All @@ -17,12 +20,12 @@ jobs:
issues: write

steps:
- uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
- uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit

- name: Fast forwarding
uses: sequoia-pgp/fast-forward@v1
uses: sequoia-pgp/fast-forward@ea7628bedcb0b0b96e94383ada458d812fca4979 # v1.0.0
with:
merge: true
# To reduce the workflow's verbosity, use 'on-error'
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/heroku.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
|| (contains(github.event.comment.body, '/refresh-heroku-status') && github.event.issue.pull_request) }}

steps:
- uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
- uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit

# Forward deployment's status to the deployed commit.
- uses: octokit/request-action@v2.x
- uses: octokit/request-action@872c5c97b3c85c23516a572f02b31401ef82415d # v2.3.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand All @@ -45,20 +45,20 @@ jobs:

# Check that the deployed app returns successful HTTP response.
steps:
- uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
- uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit

- id: health_check
uses: jtalk/url-health-check-action@v4
uses: jtalk/url-health-check-action@b716ccb6645355dd9fcce8002ce460e5474f7f00 # v4
with:
url: ${{ github.event.deployment.payload.web_url }}
follow-redirect: true
max-attempts: 4
retry-delay: 30s
continue-on-error: true
# Set appropriate status to the deployed commit.
- uses: octokit/request-action@v2.x
- uses: octokit/request-action@872c5c97b3c85c23516a572f02b31401ef82415d # v2.3.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ jobs:
# actions: read

steps:
- uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
- uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit

- name: "Checkout code"
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
with:
results_file: results.sarif
results_format: sarif
Expand All @@ -63,7 +63,7 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: SARIF file
path: results.sarif
Expand All @@ -72,6 +72,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard (optional).
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
uses: github/codeql-action/upload-sarif@29d86d22a34ea372b1bbf3b2dced2e25ca6b3384 # v3.26.1
with:
sarif_file: results.sarif
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
repos:
- repo: https://github.com/gitleaks/gitleaks
rev: v8.16.3
hooks:
- id: gitleaks
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: shellcheck
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.38.0
hooks:
- id: eslint
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ We recommend following these steps if you'd like to contribute to the repo.

0. Check out the [Trello board](https://trello.com/b/hRFh7Sc1/orcasite-development) for an overview of features being worked on.
- This [public roadmap](https://trello.com/b/wBg0qhss/orcasound-roadmap) has a higher level view.
1. Fork the Orcasite repo
2. Develop on a [feature branch](https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow)
1. Fork the Orcasite repo.
2. Develop on a [feature branch](https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow).
3. Submit a PR (don't review your own)!
- To maintain a consistent style, we recommend running [Prettier](https://github.com/prettier/prettier) on js, and `mix format` before submission
- To maintain a consistent style, we recommend running [Prettier](https://github.com/prettier/prettier) on js, and `mix format` before submission.
4. Once a PR is merged, we can throw it up onto the dev server to see how things look!

### Questions?
Expand Down Expand Up @@ -51,6 +51,6 @@ If you're new to Elixir (or JS and React), that's no problem! Here are some reso
- [Apollo GraphQL](https://www.apollographql.com/docs/react/) - Javascript library for GraphQL

### Example codebases
Some of these are convenient for reference
Some of these are convenient for reference:

- [Evercam](https://github.com/evercam/evercam-server/) - Good example of supervision trees
- [Evercam](https://github.com/evercam/evercam-server/) - Good example of supervision trees
Loading

0 comments on commit 65fe710

Please sign in to comment.