Skip to content

Commit

Permalink
Merge branch 'master' into chore--udpate-golang-depenancies
Browse files Browse the repository at this point in the history
  • Loading branch information
AlaricWhitney authored Apr 25, 2023
2 parents 4404403 + 0334a06 commit e3073f6
Show file tree
Hide file tree
Showing 26 changed files with 503 additions and 325 deletions.
162 changes: 153 additions & 9 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,157 @@
# configuration options available at https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

# This configuration implements every package-ecosystem entry with the following logic:
# - run Sunday's at midnight at a timeframe that allows TII team members to benefit from dependabot runs
# - only manage direct dependencies, as opposed to transient dependencies which are harder to maintain at scale

version: 2
updates:
- package-ecosystem: npm
- package-ecosystem: 'bundler'
directory: '/'
schedule:
interval: daily
time: '09:00'
timezone: 'America/Chicago'
open-pull-requests-limit: 3
ignore:
# ignore all patch updates
- dependency-name: '*'
update-types: ['version-update:semver-patch']
interval: 'weekly'
day: 'sunday'
time: '00:00'
timezone: 'Asia/Kolkata'
allow:
- dependency-type: 'direct'

- package-ecosystem: 'cargo'
directory: '/'
schedule:
interval: 'weekly'
day: 'sunday'
time: '00:00'
timezone: 'Asia/Kolkata'
allow:
- dependency-type: 'direct'

- package-ecosystem: 'composer'
directory: '/'
schedule:
interval: 'weekly'
day: 'sunday'
time: '00:00'
timezone: 'Asia/Kolkata'
allow:
- dependency-type: 'direct'

- package-ecosystem: 'docker'
directory: '/'
schedule:
interval: 'weekly'
day: 'sunday'
time: '00:00'
timezone: 'Asia/Kolkata'
allow:
- dependency-type: 'direct'

- package-ecosystem: 'mix'
directory: '/'
schedule:
interval: 'weekly'
day: 'sunday'
time: '00:00'
timezone: 'Asia/Kolkata'
allow:
- dependency-type: 'direct'

- package-ecosystem: 'elm'
directory: '/'
schedule:
interval: 'weekly'
day: 'sunday'
time: '00:00'
timezone: 'Asia/Kolkata'
allow:
- dependency-type: 'direct'

- package-ecosystem: 'gitsubmodule'
directory: '/'
schedule:
interval: 'weekly'
day: 'sunday'
time: '00:00'
timezone: 'Asia/Kolkata'
allow:
- dependency-type: 'direct'

- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'
day: 'sunday'
time: '00:00'
timezone: 'Asia/Kolkata'
allow:
- dependency-type: 'direct'

- package-ecosystem: 'gomod'
directory: '/'
schedule:
interval: 'weekly'
day: 'sunday'
time: '00:00'
timezone: 'Asia/Kolkata'
allow:
- dependency-type: 'direct'

- package-ecosystem: 'gradle'
directory: '/'
schedule:
interval: 'weekly'
day: 'sunday'
time: '00:00'
timezone: 'Asia/Kolkata'
allow:
- dependency-type: 'direct'

- package-ecosystem: 'maven'
directory: '/'
schedule:
interval: 'weekly'
day: 'sunday'
time: '00:00'
timezone: 'Asia/Kolkata'
allow:
- dependency-type: 'direct'

- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'weekly'
day: 'sunday'
time: '00:00'
timezone: 'Asia/Kolkata'
allow:
- dependency-type: 'direct'

- package-ecosystem: 'nuget'
directory: '/'
schedule:
interval: 'weekly'
day: 'sunday'
time: '00:00'
timezone: 'Asia/Kolkata'
allow:
- dependency-type: 'direct'

- package-ecosystem: 'pip'
directory: '/'
schedule:
interval: 'weekly'
day: 'sunday'
time: '00:00'
timezone: 'Asia/Kolkata'
allow:
- dependency-type: 'direct'

- package-ecosystem: 'terraform'
directory: '/'
schedule:
interval: 'weekly'
day: 'sunday'
time: '00:00'
timezone: 'Asia/Kolkata'
allow:
- dependency-type: 'direct'
75 changes: 75 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# 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: ['master']
pull_request:
# The branches below must be a subset of the branches above
branches: ['master']
schedule:
- cron: '18 13 * * 6'

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

strategy:
fail-fast: false
matrix:
language: ['go', 'javascript']
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
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.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, 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@v2

# ℹ️ 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@v2
with:
category: '/language:${{matrix.language}}'
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ jobs:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
- run: yarn install
Expand All @@ -23,4 +23,4 @@ jobs:
level: warning
fail_on_error: true
- name: tsc
run: yarn workspaces run check
run: yarn run check
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,6 @@ ngrok.log

smoketest_db_dump
*.pid

/.yarn
/.yarnrc.yml
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ LOG_DIR=
GOPATH:=$(shell go env GOPATH)

# Use sha256sum on linux and shasum -a 256 on mac
SHA_CMD := $(shell if [ -x "$(shell command -v sha256sum)" ]; then echo "sha256sum"; else echo "shasum -a 256"; fi)
SHA_CMD := $(shell if [ -x "$(shell command -v sha256sum 2>/dev/null)" ]; then echo "sha256sum"; else echo "shasum -a 256"; fi)

export CY_ACTION = open
export CY_BROWSER = chrome
Expand Down Expand Up @@ -148,7 +148,7 @@ start-integration: web/src/build/static/app.js bin/goalert bin/psql-lite bin/wai
GOALERT_DB_URL="$(INT_DB_URL)" ./bin/runproc -f Procfile.integration

jest: node_modules
yarn workspace goalert-web run jest $(JEST_ARGS)
yarn run jest $(JEST_ARGS)

test: node_modules jest ## Run all unit tests
go test -short ./...
Expand All @@ -162,7 +162,7 @@ check: check-go check-js ## Run all lint checks
check-js: force-yarn generate node_modules
yarn run fmt
yarn run lint
yarn workspaces run check
yarn run check

check-go: generate $(BIN_DIR)/tools/golangci-lint
@go mod tidy
Expand Down Expand Up @@ -225,7 +225,7 @@ tools:
go get -u honnef.co/go/tools/cmd/staticcheck
go get -u golang.org/x/tools/cmd/stringer

yarn.lock: package.json web/src/package.json Makefile
yarn.lock: package.json Makefile
yarn --no-progress --silent --check-files && touch $@

node_modules/.yarn-integrity: yarn.lock Makefile
Expand All @@ -237,11 +237,11 @@ node_modules: yarn.lock node_modules/.yarn-integrity

web/src/build/static/explore.js: web/src/build/static

web/src/build/static: web/src/esbuild.config.js node_modules $(shell find ./web/src/app -type f ) $(shell find ./web/src/explore -type f ) web/src/schema.d.ts web/src/package.json
web/src/build/static: web/src/esbuild.config.js node_modules $(shell find ./web/src/app -type f ) $(shell find ./web/src/explore -type f ) web/src/schema.d.ts package.json
rm -rf web/src/build/static
mkdir -p web/src/build/static
cp -f web/src/app/public/icons/favicon-* web/src/app/public/logos/black/goalert-alt-logo.png web/src/build/static/
GOALERT_VERSION=$(GIT_VERSION) yarn workspace goalert-web run esbuild
GOALERT_VERSION=$(GIT_VERSION) yarn run esbuild

web/src/build/static/app.js: web/src/build/static

Expand Down
2 changes: 1 addition & 1 deletion Makefile.binaries.mk
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ $(BIN_DIR)/build/integration/cypress.json: web/src/cypress.json

$(BIN_DIR)/build/integration/cypress: node_modules $(BIN_DIR)/build/integration/cypress.json web/src/esbuild.cypress.js $(shell find ./web/src/cypress)
rm -rf $@
yarn workspace goalert-web esbuild-cy
yarn run esbuild-cy
mkdir -p $@/plugins
cp web/src/cypress/plugins/index.js $@/plugins/index.js
touch $@
Expand Down
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ smtp: go run github.com/mailhog/MailHog -ui-bind-addr=localhost:8025 -api-bind-a
prom: bin/tools/prometheus --log.level=warn --config.file=devtools/prometheus/prometheus.yml --storage.tsdb.path=bin/prom-data/ --web.listen-address=localhost:9090

@watch-file=./web/src/esbuild.config.js
ui: yarn workspace goalert-web run esbuild --watch
ui: yarn run esbuild --watch

grpcui: go run github.com/fullstorydev/grpcui/cmd/grpcui -plaintext -open-browser=false -port 8234 localhost:1234
6 changes: 3 additions & 3 deletions Procfile.cypress
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ build: while true; do make -qs bin/goalert || make bin/goalert || (echo '\033[0;
goalert: go run ./devtools/waitfor postgres://postgres@127.0.0.1:5433 && go run ./devtools/procwrap -test=127.0.0.1:3042 bin/goalert -l=127.0.0.1:3042 --ui-dir=web/src/build --db-url=postgres://postgres@127.0.0.1:5433 --slack-base-url=http://127.0.0.1:3040/slack --log-errors-only --public-url=http://127.0.0.1:3040$HTTP_PREFIX

@watch-file=./web/src/esbuild.config.js
ui: yarn workspace goalert-web run esbuild --watch
ui: yarn run esbuild --watch

@watch-file=./web/src/esbuild.cypress.js
build-cy: yarn workspace goalert-web run esbuild-cy --watch
build-cy: yarn run esbuild-cy --watch

slack: go run ./devtools/mockslack/cmd/mockslack -client-id=000000000000.000000000000 -client-secret=00000000000000000000000000000000 -access-token=xoxp-000000000000-000000000000-000000000000-00000000000000000000000000000000 -prefix=/slack -single-user=bob -addr=127.0.0.1:3046

proxy: go run ./devtools/simpleproxy -addr=127.0.0.1:3040 /slack/=http://127.0.0.1:3046 http://127.0.0.1:3042

@oneshot
cypress: go run ./devtools/waitfor http://127.0.0.1:3042 && CYPRESS_DB_URL=postgres://postgres@127.0.0.1:5433 yarn workspace goalert-web --cwd=bin/build/integration cypress open --config baseUrl=http://127.0.0.1:3040$HTTP_PREFIX
cypress: go run ./devtools/waitfor http://127.0.0.1:3042 && CYPRESS_DB_URL=postgres://postgres@127.0.0.1:5433 yarn --cwd=bin/build/integration cypress open --config baseUrl=http://127.0.0.1:3040$HTTP_PREFIX

db: $CONTAINER_TOOL rm -f smoketest-postgres || true; $CONTAINER_TOOL run -it --rm --name smoketest-postgres -p5433:5432 -e=POSTGRES_HOST_AUTH_METHOD=trust postgres:13-alpine
2 changes: 1 addition & 1 deletion Procfile.cypress.ci
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@oneshot
cypress: go run ./devtools/waitfor http://127.0.0.1:3042 && CYPRESS_DB_URL=$DB_URL yarn workspace goalert-web --cwd=bin/build/integration cypress $CY_ACTION --config baseUrl=http://127.0.0.1:3040$HTTP_PREFIX
cypress: go run ./devtools/waitfor http://127.0.0.1:3042 && CYPRESS_DB_URL=$DB_URL yarn --cwd=bin/build/integration cypress $CY_ACTION --config baseUrl=http://127.0.0.1:3040$HTTP_PREFIX

goalert: go run ./devtools/waitfor $DB_URL && go run ./devtools/procwrap -test=127.0.0.1:3042 bin/goalert -l=127.0.0.1:3042 --db-url=$DB_URL --slack-base-url=http://127.0.0.1:3040/slack --log-errors-only --public-url=http://127.0.0.1:3040$HTTP_PREFIX

Expand Down
6 changes: 3 additions & 3 deletions Procfile.cypress.prod
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ slack: go run ./devtools/mockslack/cmd/mockslack -client-id=000000000000.0000000
proxy: go run ./devtools/simpleproxy -addr=127.0.0.1:3040 /slack/=http://127.0.0.1:3046 http://127.0.0.1:3042

@oneshot
cypress: go run ./devtools/waitfor http://127.0.0.1:3042 && CYPRESS_DB_URL=postgres://postgres@127.0.0.1:5433 yarn workspace goalert-web --cwd=bin/build/integration cypress $CY_ACTION --config baseUrl=http://127.0.0.1:3040$HTTP_PREFIX
cypress: go run ./devtools/waitfor http://127.0.0.1:3042 && CYPRESS_DB_URL=postgres://postgres@127.0.0.1:5433 yarn --cwd=bin/build/integration cypress $CY_ACTION --config baseUrl=http://127.0.0.1:3040$HTTP_PREFIX

db: $CONTAINER_TOOL rm -f smoketest-postgres || true; $CONTAINER_TOOL run -it --rm --name smoketest-postgres -p5433:5432 -e=POSTGRES_HOST_AUTH_METHOD=trust postgres:13-alpine


@watch-file=./web/src/esbuild.config.js
ui: yarn workspace goalert-web run esbuild --watch --prod
ui: yarn run esbuild --watch --prod

@watch-file=./web/src/esbuild.cypress.js
build-cy: yarn workspace goalert-web run esbuild-cy --watch
build-cy: yarn run esbuild-cy --watch
2 changes: 1 addition & 1 deletion Procfile.integration
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build: while true; do make -qs bin/goalert BUNDLE=1 || make bin/goalert BUNDLE=1 || (echo '\033[0;31mBuild Failure'; sleep 3); sleep 0.1; done

@watch-file=./web/src/esbuild.config.js
ui: yarn workspace goalert-web run esbuild --watch --prod
ui: yarn run esbuild --watch --prod
2 changes: 1 addition & 1 deletion Procfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ prom: bin/tools/prometheus --log.level=warn --config.file=devtools/prometheus/pr


@watch-file=./web/src/esbuild.config.js
ui: yarn workspace goalert-web run esbuild --watch --prod
ui: yarn run esbuild --watch --prod
2 changes: 1 addition & 1 deletion Procfile.swo
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ smtp: go run github.com/mailhog/MailHog -ui-bind-addr=localhost:8025 -api-bind-a
prom: bin/tools/prometheus --log.level=warn --config.file=devtools/prometheus/prometheus-swo.yml --storage.tsdb.path=bin/prom-data/ --web.listen-address=localhost:9090

@watch-file=./web/src/esbuild.config.js
ui: yarn workspace goalert-web run esbuild --watch
ui: yarn run esbuild --watch

@watch-file=./bin/goalert
ga2: ./bin/goalert -l=localhost:3050 --ui-dir=web/src/build --db-url=postgres://goalert@localhost:5435/goalert?sslmode=disable --listen-prometheus=localhost:2113 --db-url-next=postgres://goalert@localhost:5435/goalert2 --api-only
Expand Down
Loading

0 comments on commit e3073f6

Please sign in to comment.