Skip to content

Commit 12115bd

Browse files
authored
Merge branch 'master' into setup-downloads-on-timescaledb
2 parents 718c6a4 + a07d05c commit 12115bd

File tree

552 files changed

+11515
-4586
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

552 files changed

+11515
-4586
lines changed

.devcontainer/Dockerfile

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,8 @@
11
# syntax = docker/dockerfile:1.4
22

3-
ARG RUBY_VERSION=3.3
3+
ARG RUBY_VERSION=3.3.5
4+
FROM ghcr.io/rails/devcontainer/images/ruby:$RUBY_VERSION
45

5-
FROM ruby:${RUBY_VERSION}-alpine
6-
7-
ENV USERNAME=vscode \
8-
UID=1000 \
9-
GID=1000
10-
11-
# Install the git-credential-manager package via the dotnet tooling to
12-
RUN apk update && apk add --no-cache \
13-
github-cli \
14-
git \
15-
build-base \
16-
bash \
17-
mandoc \
18-
man-pages \
19-
tzdata \
20-
libpq-dev \
21-
libmagic \
22-
nodejs \
23-
sudo
24-
25-
# create non-root group and user
26-
RUN addgroup -g $GID $USERNAME \
27-
&& adduser -s /bin/bash -u $UID -G $USERNAME $USERNAME --disabled-password --gecos ""
28-
29-
# set sudo permissions for vscode user
30-
RUN echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME
31-
RUN chmod 0440 /etc/sudoers.d/$USERNAME
32-
33-
USER $USERNAME
6+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
7+
&& apt-get -y install --no-install-recommends pkg-config \
8+
&& apt-get clean && rm -rf /var/lib/apt/lists/*

.devcontainer/devcontainer.json

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
"docker-compose.yml",
66
"../docker-compose.yml"
77
],
8-
"service": "app",
8+
"service": "rails-app",
99
"runServices": [
1010
"db",
1111
"cache",
1212
"search",
13-
"toxiproxy"
13+
"toxiproxy",
14+
"selenium"
1415
],
1516
"forwardPorts": [
1617
3000, // Rails
@@ -23,10 +24,20 @@
2324
"onCreateCommand": "bin/setup",
2425
// Use 'updateContentCommand' to run commands when the container is updated.
2526
"updateContentCommand": "bin/setup",
27+
// Features to add to the dev container. More info: https://containers.dev/features.
28+
"features": {
29+
"ghcr.io/devcontainers/features/github-cli:1": {},
30+
// "ghcr.io/rails/devcontainer/features/activestorage": {},
31+
"ghcr.io/rails/devcontainer/features/postgres-client": {}
32+
},
2633
// Configure tool-specific properties.
2734
"containerEnv": {
2835
"EDITOR": "code --wait",
29-
"GIT_EDITOR": "code --wait"
36+
"GIT_EDITOR": "code --wait",
37+
"CAPYBARA_SERVER_PORT": "45678",
38+
"SELENIUM_HOST": "selenium",
39+
"ELASTICSEARCH_URL": "http://search:9200",
40+
"DATABASE_URL": "postgres://postgres@db:5432"
3041
},
3142
"customizations": {
3243
"codespaces": {

.devcontainer/docker-compose.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
version: "3"
21
services:
3-
app:
2+
rails-app:
43
build:
54
context: .
65
dockerfile: Dockerfile
7-
command: /bin/sh -c "while sleep 1000; do :; done"
6+
command: sleep infinity
87
volumes:
98
- ../..:/workspaces:cached
10-
environment:
11-
- ELASTICSEARCH_URL=http://search:9200
12-
- DATABASE_URL=postgres://postgres@db:5432
9+
depends_on:
10+
- search
11+
- db
12+
- selenium
13+
14+
selenium:
15+
image: selenium/standalone-chromium
16+
restart: unless-stopped

.github/actions/setup-rubygems.org/action.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,23 @@ inputs:
77
rubygems-version:
88
description: "RubyGems version to use"
99
required: true
10+
install-avo-pro:
11+
description: "Install Avo gem"
12+
required: false
13+
default: "true"
1014
runs:
1115
using: "composite"
1216
steps:
1317
- name: Install and start services
1418
shell: bash
1519
run: |
1620
docker compose up -d --wait
17-
- uses: ruby/setup-ruby@3783f195e29b74ae398d7caca108814bbafde90e # v1.180.1
21+
- name: Configure bundler environment
22+
shell: bash
23+
if: github.secret_source != 'None' && inputs.install-avo-pro == 'true'
24+
run: |
25+
printf "BUNDLE_WITH=avo\nRAILS_GROUPS=avo\n" >> $GITHUB_ENV
26+
- uses: ruby/setup-ruby@52753b7da854d5c07df37391a986c76ab4615999 # v1.191.0
1827
with:
1928
ruby-version: ${{ inputs.ruby-version }}
2029
bundler-cache: true

.github/workflows/codeql.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ permissions: # added using https://github.com/step-security/secure-workflows
2626
jobs:
2727
analyze:
2828
name: Analyze
29-
runs-on: ubuntu-latest
29+
runs-on: ubuntu-24.04
3030
permissions:
3131
actions: read
3232
contents: read
@@ -41,11 +41,11 @@ jobs:
4141

4242
steps:
4343
- name: Checkout repository
44-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
44+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4545

4646
# Initializes the CodeQL tools for scanning.
4747
- name: Initialize CodeQL
48-
uses: github/codeql-action/init@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
48+
uses: github/codeql-action/init@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # v3.27.4
4949
with:
5050
languages: ${{ matrix.language }}
5151
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -58,7 +58,7 @@ jobs:
5858
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5959
# If this step fails, then you should remove it and run the build manually (see below)
6060
- name: Autobuild
61-
uses: github/codeql-action/autobuild@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
61+
uses: github/codeql-action/autobuild@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # v3.27.4
6262

6363
# ℹ️ Command-line programs to run using the OS shell.
6464
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -71,6 +71,6 @@ jobs:
7171
# ./location_of_script_within_repo/buildscript.sh
7272

7373
- name: Perform CodeQL Analysis
74-
uses: github/codeql-action/analyze@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
74+
uses: github/codeql-action/analyze@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # v3.27.4
7575
with:
7676
category: "/language:${{matrix.language}}"

.github/workflows/docker.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,24 @@ permissions:
1212
jobs:
1313
build:
1414
name: Docker build (and optional push)
15-
runs-on: ubuntu-22.04
15+
runs-on: ubuntu-24.04
1616
env:
17-
RUBYGEMS_VERSION: 3.5.14
18-
RUBY_VERSION: 3.3.3
17+
RUBYGEMS_VERSION: "3.5.20"
18+
RUBY_VERSION: "3.3.5"
1919
steps:
20-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
20+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2121
- name: Set up Docker Buildx
2222
id: buildx
23-
uses: docker/setup-buildx-action@4fd812986e6c8c2a69e18311145f9371337f27d4 # master
23+
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # master
2424
- name: Cache Docker layers
25-
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
25+
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
2626
with:
2727
path: /tmp/.buildx-cache
2828
key: ${{ runner.os }}-rubygems-${{ hashFiles('**/Gemfile.lock') }}
2929
restore-keys: |
3030
${{ runner.os }}-rubygems-org
3131
- name: Install and start services (needed for image test)
32-
run: docker-compose up -d
32+
run: docker compose up -d
3333
- name: Configure AWS credentials from Production account
3434
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
3535
if: github.secret_source != 'None'
@@ -41,6 +41,8 @@ jobs:
4141
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1
4242
- name: build, test and optionally push docker image
4343
run: ./script/build_docker.sh
44+
env:
45+
BUNDLE_PACKAGER__DEV: ${{ secrets.BUNDLE_PACKAGER__DEV }}
4446
# Temp fix
4547
# https://github.com/docker/build-push-action/issues/252
4648
# https://github.com/moby/buildkit/issues/1896

.github/workflows/lint.yml

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,37 @@ permissions:
1010
jobs:
1111
rubocop:
1212
name: Rubocop
13-
runs-on: ubuntu-22.04
13+
runs-on: ubuntu-24.04
1414
steps:
15-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
16-
- uses: ruby/setup-ruby@97e35c5302afcf3f5ac1df3fca9343d32536b286 # v1.184.0
15+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
- uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # v1.202.0
1717
with:
1818
bundler-cache: true
1919
- name: Rubocop
2020
run: bundle exec rubocop
2121
brakeman:
2222
name: Brakeman
23-
runs-on: ubuntu-22.04
23+
runs-on: ubuntu-24.04
2424
steps:
25-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
26-
- uses: ruby/setup-ruby@97e35c5302afcf3f5ac1df3fca9343d32536b286 # v1.184.0
25+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26+
- uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # v1.202.0
2727
with:
2828
bundler-cache: true
2929
- name: Brakeman
3030
run: bundle exec brakeman
3131
importmap:
3232
name: Importmap Verify
33-
runs-on: ubuntu-22.04
33+
runs-on: ubuntu-24.04
3434
steps:
35-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
36-
- uses: ruby/setup-ruby@97e35c5302afcf3f5ac1df3fca9343d32536b286 # v1.184.0
35+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
36+
- uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # v1.202.0
3737
with:
3838
bundler-cache: true
3939
- name: Importmap Verify
4040
run: bundle exec rake importmap:verify
4141
kubeconform:
4242
name: Kubeconform
43-
runs-on: ubuntu-22.04
43+
runs-on: ubuntu-24.04
4444
strategy:
4545
matrix:
4646
kubernetes_version: ["1.29.1"]
@@ -50,8 +50,8 @@ jobs:
5050
steps:
5151
- name: login to Github Packages
5252
run: echo "${{ github.token }}" | docker login https://ghcr.io -u ${GITHUB_ACTOR} --password-stdin
53-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
54-
- uses: ruby/setup-ruby@97e35c5302afcf3f5ac1df3fca9343d32536b286 # v1.184.0
53+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
54+
- uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # v1.202.0
5555
with:
5656
bundler-cache: true
5757
- name: krane render
@@ -60,12 +60,27 @@ jobs:
6060
env:
6161
ENVIRONMENT: "${{ matrix.environment }}"
6262
REVISION: "${{ github.sha }}"
63-
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
63+
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
6464
with:
6565
name: "${{ matrix.environment }}.rendered.yaml"
6666
path: "config/deploy/${{ matrix.environment }}.rendered.yaml"
6767
- name: kubeconform
68-
uses: docker://ghcr.io/yannh/kubeconform:v0.6.3
68+
uses: docker://ghcr.io/yannh/kubeconform@sha256:03f6b236ef64f20b4bc950209d6254b109e23b4b05e7811649f59eae5659fa58 # v0.6.3
6969
with:
7070
entrypoint: "/kubeconform"
7171
args: "-strict -summary -output json --kubernetes-version ${{ matrix.kubernetes_version }} config/deploy/${{ matrix.environment }}.rendered.yaml"
72+
frizbee:
73+
name: Frizbee
74+
runs-on: ubuntu-24.04
75+
steps:
76+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
77+
- uses: segiddins/frizbee-action@c162fdaa6c73525a577d2d6eb193683dfc9ba2be # segiddins/run-in-place
78+
env:
79+
GITHUB_TOKEN: ${{ github.token }}
80+
with:
81+
action_paths: '[".github/workflows", ".github/actions"]'
82+
dockerfiles: '["./Dockerfile", ".devcontainer/Dockerfile"]'
83+
docker_compose: '["./docker-compose.yml", ".devcontainer/docker-compose.yml"]'
84+
fail_on_unpinned: true
85+
open_pr: false
86+
repo_root: "."

.github/workflows/scorecards.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ permissions: read-all
2020
jobs:
2121
analysis:
2222
name: Scorecards analysis
23-
runs-on: ubuntu-latest
23+
runs-on: ubuntu-24.04
2424
permissions:
2525
# Needed to upload the results to code-scanning dashboard.
2626
security-events: write
@@ -32,12 +32,12 @@ jobs:
3232

3333
steps:
3434
- name: "Checkout code"
35-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v3.1.0
35+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v3.1.0
3636
with:
3737
persist-credentials: false
3838

3939
- name: "Run analysis"
40-
uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3
40+
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
4141
with:
4242
results_file: results.sarif
4343
results_format: sarif
@@ -67,6 +67,6 @@ jobs:
6767

6868
# Upload the results to GitHub's code scanning dashboard.
6969
- name: "Upload to code-scanning"
70-
uses: github/codeql-action/upload-sarif@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
70+
uses: github/codeql-action/upload-sarif@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # v3.27.4
7171
with:
7272
sarif_file: results.sarif

.github/workflows/test.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
status_check:
1616
name: All required tests passing check
1717
needs: [rails]
18-
runs-on: ubuntu-22.04
18+
runs-on: ubuntu-24.04
1919
if: always()
2020
steps:
2121
- run: /bin/${{ (needs.rails.result == 'success' || needs.rails.result == 'skipped') }}
@@ -26,44 +26,52 @@ jobs:
2626
matrix:
2727
rubygems:
2828
- name: locked
29-
version: "3.5.14"
29+
version: "3.5.20"
3030
- name: latest
3131
version: latest
32-
ruby_version: ["3.3.3"]
32+
ruby_version: ["3.3.5"]
3333
tests:
3434
- name: general
3535
command: test
3636
- name: system
3737
command: test:system
38+
include:
39+
- rubygems: { name: latest, version: latest }
40+
ruby_version: "3.3.5"
41+
tests: { name: "avo without pro", command: "test test/*/avo" }
3842
name: Rails tests ${{ matrix.tests.name }} (RubyGems ${{ matrix.rubygems.name }}, Ruby ${{ matrix.ruby_version }})
3943
runs-on: ubuntu-22.04
4044
env:
4145
RUBYGEMS_VERSION: ${{ matrix.rubygems.version }}
4246
# Fail hard when Toxiproxy is not running to ensure all tests (even Toxiproxy optional ones) are passing
4347
REQUIRE_TOXIPROXY: true
48+
REQUIRE_AVO_PRO: ${{ github.secret_source != 'None' && matrix.tests.name != 'avo without pro' }}
49+
AVO_LICENSE_KEY: ${{ secrets.AVO_LICENSE_KEY }}
50+
BUNDLE_PACKAGER__DEV: ${{ secrets.BUNDLE_PACKAGER__DEV }}
4451
steps:
45-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
52+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4653

4754
- name: Setup rubygems.org
4855
uses: ./.github/actions/setup-rubygems.org
4956
with:
5057
ruby-version: ${{ matrix.ruby_version }}
5158
rubygems-version: ${{ matrix.rubygems.version }}
59+
install-avo-pro: ${{ matrix.tests.name != 'avo without pro' }}
5260

5361
- name: Tests ${{ matrix.tests.name }}
5462
id: test-all
5563
run: bin/rails ${{ matrix.tests.command }}
5664

5765
- name: Save capybara screenshots
5866
if: ${{ failure() && steps.test-all.outcome == 'failure' }}
59-
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
67+
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
6068
with:
6169
name: capybara-screenshots-${{ matrix.tests.name }}-${{ matrix.rubygems.name }}
6270
path: tmp/capybara
6371
if-no-files-found: ignore
6472

6573
- name: Upload coverage to Codecov
6674
if: matrix.rubygems.name == 'locked' && (success() || failure())
67-
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
75+
uses: codecov/codecov-action@3b1354a6c45db9f1008891f4eafc1a7e94ce1d18 # v5.0.1
6876
env:
6977
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)