Skip to content

Commit

Permalink
Merge branch 'main' into add_vacancy_poster_integration
Browse files Browse the repository at this point in the history
  • Loading branch information
ddippolito committed May 30, 2024
2 parents f92a59f + 5e66f29 commit ff7c8bb
Show file tree
Hide file tree
Showing 775 changed files with 11,863 additions and 9,934 deletions.
8 changes: 2 additions & 6 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG RUBY_VERSION=3.2.2
ARG RUBY_VERSION=3.3.1
FROM ruby:${RUBY_VERSION}

ARG USERNAME=teaching-vacancies
Expand All @@ -12,12 +12,8 @@ RUN apt update -yq \
&& apt install curl gnupg -yq \
&& curl -sL https://deb.nodesource.com/setup_$NODEJS_MAJOR_VERSION.x | bash

# Set up repository for CloudFoundry CLI
RUN wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | apt-key add - \
&& echo "deb https://packages.cloudfoundry.org/debian stable main" > /etc/apt/sources.list.d/cloudfoundry-cli.list

# Set up dependencies
RUN apt update && apt install -y cf8-cli nodejs postgresql-client redis-tools less vim sudo shared-mime-info man-db
RUN apt update && apt install -y nodejs postgresql-client redis-tools less vim sudo shared-mime-info man-db
RUN npm install -g yarn

# Install Terraform
Expand Down
11 changes: 8 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,16 @@
"kaiwood.endwise",
"mtxr.sqltools",
"mtxr.sqltools-driver-pg",
"rebornix.Ruby",
"redhat.vscode-yaml",
"sianglim.slim",
"LoranKloeze.ruby-rubocop-revived"
],
"LoranKloeze.ruby-rubocop-revived",
"waderyan.gitblame",
"eamodio.gitlens",
"sleistner.vscode-fileutils",
"Shopify.ruby-extensions-pack",
"GitHub.copilot",
"donjayamanne.git-extension-pack"
],
"settings": {
// Get highlighting for local env files
"files.associations": {
Expand Down
8 changes: 2 additions & 6 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ services:
ports:
- "3000:3000"
- "3035:3035"
tmpfs:
- /tmp # Required for ActiveStorage, see https://github.com/docker/for-mac/issues/5570
environment:
# Rails
DATABASE_URL: postgis://postgres:postgres@db
Expand All @@ -34,7 +32,7 @@ services:
- selenium-chrome

db:
image: postgis/postgis:12-3.1-alpine
image: postgis/postgis:14-3.4-alpine
restart: unless-stopped
volumes:
- postgres_data:/var/lib/postgresql/data
Expand All @@ -52,12 +50,10 @@ services:
- "6379:6379"

selenium-chrome:
image: selenium/standalone-chrome:95.0
image: selenium/standalone-chrome:119.0
shm_size: 2G
ports:
- "7900:7900"
tmpfs:
- /tmp

volumes:
# Postgres data directory
Expand Down
3 changes: 0 additions & 3 deletions .devcontainer/post_create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ gem install solargraph
log 'Install Javascript dependencies'
yarn install

log 'Set API endpoint for CloudFoundry CLI'
cf api api.london.cloud.service.gov.uk

log 'Ensure `tmp` folder has a `.keep` file'
# (this is present on the host, but the container uses a volume for the `tmp` directory,
# leading Git to believe the `.keep` file has gone missing)
Expand Down
78 changes: 78 additions & 0 deletions .devcontainer/teaching_vacancies_bashrc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,81 @@ PATH=$PWD/bin:/workspace/bin:/usr/local/bundle/bin:$PATH

## Enable Git bash completion
source /usr/share/bash-completion/completions/git

## Aliases

# Bundler
alias ber="bundle exec rspec --no-profile"
alias berf="bundle exec rspec --no-profile --only-failures"
alias bernf="bundle exec rspec --no-profile --next-failure"
alias berp="bundle exec rspec --profile 10"
alias be="bundle exec"

# Git
alias gs='git status'
alias gstsh='git stash'
alias gst='git stash'
alias gsp='git stash pop'
alias gsa='git stash apply'
alias gsh='git show'
alias gshw='git show'
alias gshow='git show'
alias gi='vim .gitignore'
alias gcm='git ci -m'
alias gcim='git ci -m'
alias gci='git ci'
alias gco='git co'
alias gcp='git cp'
alias ga='git add -A'
alias gap='git add -p'
alias guns='git unstage'
alias gunc='git uncommit'
alias gm='git merge'
alias gms='git merge --squash'
alias gam='git amend --reset-author'
alias grv='git remote -v'
alias grr='git remote rm'
alias grad='git remote add'
alias gr='git rebase'
alias gra='git rebase --abort'
alias ggrc='git rebase --continue'
alias gbi='git rebase --interactive'
alias gl='git l'
alias glg='git l'
alias glog='git l'
alias co='git co'
alias gf='git fetch'
alias gfp='git fetch --prune'
alias gfa='git fetch --all'
alias gfap='git fetch --all --prune'
alias gfch='git fetch'
alias gd='git diff'
alias gb='git b'
# Staged and cached are the same thing
alias gdc='git diff --cached -w'
alias gds='git diff --staged -w'
alias gpub='grb publish'
alias gtr='grb track'
alias gpl='git pull'
alias gplr='git pull --rebase'
alias gps='git push'
alias gpsh='git push -u origin `git rev-parse --abbrev-ref HEAD`'
alias gnb='git nb' # new branch aka checkout -b
alias grs='git reset'
alias grsh='git reset --hard'
alias gcln='git clean'
alias gclndf='git clean -df'
alias gclndfx='git clean -dfx'
alias gsm='git submodule'
alias gsmi='git submodule init'
alias gsmu='git submodule update'
alias gt='git t'
alias gbg='git bisect good'
alias gbb='git bisect bad'
alias gdmb='git branch --merged | grep -v "\*" | xargs -n 1 git branch -d'
# Git command for rebasing against Main branch in Github/Origin
alias grbm="git fetch origin && git rebase origin/main"
alias gc="git commit"
alias gbl="git branch --list"
# Git safe Push Force
alias gpf="git push --force-with-lease"
3 changes: 3 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ DISABLE_EMAILS=false
DOCUMENTS_S3_BUCKET=test_bucket
DOMAIN=localhost:3000
LOCKBOX_MASTER_KEY=0000000000000000000000000000000000000000000000000000000000000000
RAILS_DEVELOPMENT_HOSTS=.app.github.dev
SCHOOLS_IMAGES_LOGOS_S3_BUCKET=test_bucket
VACANCY_SOURCE_ARK_FEED_URL=http://example.com/feed.xml
VACANCY_SOURCE_UNITED_LEARNING_FEED_URL=http://example.com/feed.xml
VACANCY_SOURCE_VENTRUS_FEED_URL=http://example.com/feed.xml
VACANCY_SOURCE_FUSION_FEED_URL=http://example.com/feed.json
Expand All @@ -12,3 +14,4 @@ VACANCY_SOURCE_MY_NEW_TERM_FEED_URL=https://example.com
VACANCY_SOURCE_BROADBEAN_FEED_URL=http://example.com/feed.xml
VACANCY_SOURCE_VACANCY_POSTER_FEED_URL=http://example.com/feed.xml
VACANCY_SOURCE_MY_NEW_TERM_API_KEY=api_key
SECRET_KEY_BASE=352f2c2ccf5a9a77d8cc91fade3685dda45407f329c14ed0b8e4c2d6618d8475e4e4416bf20eeeec46558384ea9c9e2de97b85e20c47adb93d914576ed6b69d4
1 change: 0 additions & 1 deletion .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ VACANCY_SOURCE_EVERY_FEED_URL=http://example.com/feed.json
VACANCY_SOURCE_MY_NEW_TERM_FEED_URL=http://example.com
VACANCY_SOURCE_MY_NEW_TERM_API_KEY=test-api-key
VACANCY_SOURCE_BROADBEAN_FEED_URL=http://example.com/feed.xml
VACANCY_SOURCE_VACANCY_POSTER_FEED_URL=http://example.com/feed.xml
BIGQUERY_TABLE_NAME=test_events
BIGQUERY_PROJECT_ID=teacher-vacancy-service
BIGQUERY_DATASET=testing_dataset
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ runs:
role-duration-seconds: 3600
role-skip-session-tagging: true

- uses: DFE-Digital/github-actions/set-arm-environment-variables@master
- uses: DFE-Digital/github-actions/set-kubelogin-environment@master
with:
azure-credentials: ${{ inputs.azure-credentials }}

Expand Down
3 changes: 3 additions & 0 deletions .github/actions/smoke-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ runs:
- name: Run deployment smoke test
shell: bash
env:
HTTP_BASIC_USER: ${{ inputs.http_basic_user }}
HTTP_BASIC_PASSWORD: ${{ inputs.http_basic_password }}
run: bundle exec rspec spec/smoke_tests/jobseekers_can_view_homepage_spec.rb --tag smoke_test

- name: print environment
Expand Down
12 changes: 5 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ updates:
# TODO: Remove this ignore config once moved to a Redis v6.2+ instance in AKS.
# The version is currently pinned to <7. We're unable to upgrade sidekiq as it requires out Redis service
# instance to be 6.2+ https://github.com/sidekiq/sidekiq/blob/main/docs/7.0-Upgrade.md#version-support.
# Our current Redis service instance is 5.0.6. This will be upgraded when we migrate from GOVuk PaaS to AKS.
# Our current Redis service instance is 6.0 on Azure .
- dependency-name: "sidekiq"
update-types: ["version-update:semver-major"]

# TODO: Remove this ignore config once moved to a Redis v6.2+ instance in AKS.
# The version is currently pinned to <5 by sidekiq (version 6.5.8).
# It seems this pin is removed by later sidekiq versions, but we're unable to upgrade sidekiq as it requires out
# Redis service instance to be 6.2+ https://github.com/sidekiq/sidekiq/blob/main/docs/7.0-Upgrade.md#version-support.
# Our current Redis service instance is 5.0.6. This will be upgraded when we migrate from GOVuk PaaS to AKS.
# Our current Redis service instance is 6.0 on Azure.
- dependency-name: "redis"
update-types: ["version-update:semver-major"]
groups:
Expand All @@ -29,9 +29,9 @@ updates:
patterns:
- "*"
exclude-patterns:
- "govuk"
- "govuk*"
- "noticed"

- package-ecosystem: "docker"
directory: "/"
schedule:
Expand Down Expand Up @@ -64,6 +64,4 @@ updates:
patterns:
- "*"
exclude-patterns:
- "govuk"
- "jest"

- "govuk*"
71 changes: 0 additions & 71 deletions .github/workflows/TV-check-users-in-space-developer-role.yml

This file was deleted.

68 changes: 68 additions & 0 deletions .github/workflows/accessibility_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Accessibility Tests

on:
workflow_dispatch:
schedule:
- cron: '0 3 * * 0' # Run every Sunday at 3am

jobs:
pally:
name: Pa11y accessibility tests
env:
RAILS_ENV: test
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Prepare application environment
uses: ./.github/actions/prepare-app-env
with:
skip-ruby: true

- run: npm install
- name: Run Pa11y accessibility tests against QA sitemap pages
run: |
npm install -g pa11y-ci
pa11y-ci --sitemap https://qa.teaching-vacancies.service.gov.uk/sitemap.xml
axe:
name: Axe accessibility tests
env:
RAILS_ENV: test
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Prepare application environment
uses: ./.github/actions/prepare-app-env
with:
skip-ruby: true

- run: npm install
- name: Run Axe accessibility tests against QA sitemap pages
run: |
npm install -g @axe-core/cli sitemap-urls
# Gets all urls from sitemap in an array
urls=($(curl https://qa.teaching-vacancies.service.gov.uk/sitemap.xml | sitemap-urls))
# Runs axe against each url from the sitemap
axe $(for url in "${urls[@]}"; do echo $url, ; done;) --exit
lighthouse:
name: Lighthouse tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Prepare application environment
uses: ./.github/actions/prepare-app-env
with:
skip-ruby: true
- run: npm install
- name: run Lighthouse Performance, Accessibility, Best Practices, SEO, and PWA tests
run: |
npm install -g @lhci/cli
lhci autorun \
--collect.url=https://qa.teaching-vacancies.service.gov.uk \
--collect.url=https://qa.teaching-vacancies.service.gov.uk/jobs \
--collect.url=https://qa.teaching-vacancies.service.gov.uk/schools \
Loading

0 comments on commit ff7c8bb

Please sign in to comment.