Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

see what breaks 🤷 #107

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
5dc71c6
Fix flaky assertNumQueries test in TestAddonAdmin (#22363)
diox Jun 13, 2024
852f4a1
Bump django-debug-toolbar from 4.3.0 to 4.4.2 in /requirements (#22286)
dependabot[bot] Jun 13, 2024
8fc73b3
Split tests for faster execution (#22318)
KevinMind Jun 13, 2024
9f8766a
Pontoon: Update Hungarian (hu) localization of AMO
meskobalazs Jun 14, 2024
21a6321
Rename-release (#22364)
KevinMind Jun 14, 2024
7e62135
Jobs to release_master/tag in release workflow (#22367)
KevinMind Jun 14, 2024
2f36581
Add logs for github output (#22368)
KevinMind Jun 14, 2024
5f0a7f3
Pontoon: Update Danish (da) localization of AMO
Joergen Jun 14, 2024
b033a7b
Pontoon: Update Danish (da) localization of AMO
Joergen Jun 14, 2024
8a53ff0
Bump addons-linter from 6.29.0 to 6.30.0 (#22369)
dependabot[bot] Jun 14, 2024
46771c1
Pontoon: Update Danish (da) localization of AMO
Joergen Jun 14, 2024
0e5437b
Pontoon: Update Danish (da) localization of AMO
hennsoe Jun 14, 2024
ec65a2a
Pontoon: Update Czech (cs) localization of AMO
Jun 14, 2024
a984783
Pontoon: Update Korean (ko) localization of AMO
Jun 15, 2024
e3f00f5
Pontoon: Update Korean (ko) localization of AMO
Jun 15, 2024
5e9ee28
Pontoon: Update Norwegian Nynorsk (nn-NO) localization of AMO
Jun 15, 2024
84e5564
Pontoon: Update Norwegian Nynorsk (nn-NO) localization of AMO
Jun 15, 2024
c581116
Pontoon: Update Norwegian Nynorsk (nn-NO) localization of AMO
Jun 15, 2024
6eb1718
Pontoon: Update Norwegian Nynorsk (nn-NO) localization of AMO
Jun 15, 2024
a4e0d98
Pontoon: Update Norwegian Nynorsk (nn-NO) localization of AMO
Jun 15, 2024
9bb57d3
Pontoon: Update Norwegian Nynorsk (nn-NO) localization of AMO
Jun 15, 2024
e1a8d83
Pontoon: Update Norwegian Nynorsk (nn-NO) localization of AMO
Jun 15, 2024
0980474
Pontoon: Update Norwegian Nynorsk (nn-NO) localization of AMO
Jun 15, 2024
9240211
Pontoon: Update Norwegian Nynorsk (nn-NO) localization of AMO
Jun 15, 2024
a62eb88
Pontoon: Update Norwegian Nynorsk (nn-NO) localization of AMO
Jun 15, 2024
a8939e1
Handle abuse reports being associated with appeal jobs
eviljeff Jun 12, 2024
ead04d6
Update src/olympia/abuse/tests/test_models.py
eviljeff Jun 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .github/actions/run-docker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ runs:
DOCKER_SERVICES: ${{ inputs.services }}
HOST_UID: ${{ steps.id.outputs.id }}
run: |
if [[ -z "${{ inputs.run }}" ]]; then
echo "run input is required"
exit 1
fi

# Start the specified services
make up

Expand Down
17 changes: 0 additions & 17 deletions .github/workflows/cd.yml

This file was deleted.

167 changes: 91 additions & 76 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,39 @@
name: CI

on:
# Runs when there is a push to the default branch
# This triggers tests and a pushed "latest" image
# That is deployed to the "dev" environment
push:
branches:
- master
# Runs on pull requests to verify changes and push
# PR image for local testing
pull_request:
branches:
- master
# Manually dispatch to update cache or to push an image
# From any ref
workflow_dispatch:
inputs:
splits:
description: 'The number of splits for test_main'
required: true
default: '14'
# Runs when a release is published
# Pushes a tagged image
# That is deployed to the "staging/production" environments
release:
types: [published]

concurrency:
# different events on the same ref can run in parallel
# different refs on the same event can run in parallel
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name}}
# different splits on the same ref + event can run in parallel
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name}}-${{ inputs.splits}}
cancel-in-progress: true

env:
log_artifact: test_main_logs
log_file: report.json
docs_artifact: docs

jobs:
Expand All @@ -32,7 +50,6 @@ jobs:
is_fork: ${{ steps.context.outputs.is_fork }}
is_dependabot: ${{ steps.context.outputs.is_dependabot }}
is_default_branch: ${{ steps.context.outputs.is_default_branch }}
is_push: ${{ steps.context.outputs.is_push }}

steps:
- name: Log context
Expand All @@ -55,24 +72,19 @@ jobs:
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions
is_dependabot="${{ github.actor == 'dependabot[bot]' }}"

# Are we running on a push event
# Many jobs/steps only execute or change execution on push events
is_push="${{ github.event_name == 'push' }}"

if [[ "${{ github.event_name }}" == 'pull_request' ]]; then
# repository on a pull request refers to the base which is always mozilla/addons-server
is_fork=${{ github.event.pull_request.head.repo.fork }}
else
# Repository on a push refers to the head which would be the fork
# In most events, the epository refers to the head which would be the fork
# This is different in a pullrequest where we need to check the head explicitly
is_fork="${{ github.event.repository.fork }}"
fi

echo "github.event.repository.full_name ${{ github.event.repository.full_name }}"

echo "is_default_branch=$is_default_branch" >> $GITHUB_OUTPUT
echo "is_fork=$is_fork" >> $GITHUB_OUTPUT
echo "is_dependabot=$is_dependabot" >> $GITHUB_OUTPUT
echo "is_push=$is_push" >> $GITHUB_OUTPUT

echo "event_name: ${{ github.event_name }}"
cat $GITHUB_OUTPUT
Expand All @@ -93,7 +105,6 @@ jobs:
shell: bash
run: |
is_fork="${{ needs.context.outputs.is_fork == 'true' }}"
is_default_branch="${{ needs.context.outputs.is_default_branch == 'true' }}"
is_dependabot="${{ needs.context.outputs.is_dependabot == 'true' }}"

# Default behaviour is to build images for any CI.yml run
Expand All @@ -106,7 +117,7 @@ jobs:
fi

# Dependabot PRs are treated as if they are from forks (see above)
if [[ "$is_dependabot" == 'true' && "$is_default_branch" == 'false' ]]; then
if [[ "$is_dependabot" == 'true' && "${{ github.event_name }}" == 'pull_request' ]]; then
should_build="false"
fi

Expand Down Expand Up @@ -217,7 +228,7 @@ jobs:
# to the default branch
# that is not running on a fork
if: |
needs.context.outputs.is_push == 'true' &&
github.event_name == 'push' &&
needs.context.outputs.is_default_branch == 'true' &&
needs.context.outputs.is_fork == 'false'
permissions:
Expand Down Expand Up @@ -256,7 +267,7 @@ jobs:
run: make extract_locales

- name: Push Locales
if: needs.context.outputs.is_push
if: github.event_name == 'push'
shell: bash
run: |
if [[ "${{ needs.context.outputs.is_fork == 'true' }}" == 'true' ]]; then
Expand All @@ -270,38 +281,6 @@ jobs:
make push_locales ARGS="${args}"
fi

test_test_addons_versions_files_ratings:
runs-on: ubuntu-latest
needs: build

steps:
- uses: actions/checkout@v4

- name: Test (test_addons_versions_files_ratings)
uses: ./.github/actions/run-docker
with:
services: ''
digest: ${{ needs.build.outputs.digest }}
version: ${{ needs.build.outputs.version }}
run: |
make test_addons_versions_files_ratings

test_amo_lib_locales_and_signing:
runs-on: ubuntu-latest
needs: build

steps:
- uses: actions/checkout@v4

- name: Test (test_amo_lib_locales_and_signing)
uses: ./.github/actions/run-docker
with:
services: ''
digest: ${{ needs.build.outputs.digest }}
version: ${{ needs.build.outputs.version }}
run: |
make test_amo_lib_locales_and_signing

test_needs_locales_compilation:
runs-on: ubuntu-latest
needs: build
Expand Down Expand Up @@ -338,82 +317,118 @@ jobs:
make update_assets
make test_static_assets

test_devhub:
test_internal_routes_allowed:
runs-on: ubuntu-latest
needs: build

steps:
- uses: actions/checkout@v4

- name: Test (test_devhub)
- name: Test (test_internal_routes_allowed)
uses: ./.github/actions/run-docker
with:
services: ''
digest: ${{ needs.build.outputs.digest }}
version: ${{ needs.build.outputs.version }}
run: |
make test_devhub
make test_internal_routes_allowed

test_main:
test_es_tests:
runs-on: ubuntu-latest
needs: build

steps:
- uses: actions/checkout@v4

- name: Test (test_main)
- name: Test (test_es_tests)
uses: ./.github/actions/run-docker
with:
services: ''
digest: ${{ needs.build.outputs.digest }}
version: ${{ needs.build.outputs.version }}
run: |
make test_main
make test_es_tests

test_reviewers_and_zadmin:
test_config:
runs-on: ubuntu-latest
needs: build

outputs:
matrix: ${{ steps.result.outputs.matrix }}
splits: ${{ steps.result.outputs.splits }}

steps:
- uses: actions/checkout@v4

- name: Test (test_reviewers_and_zadmin)
uses: ./.github/actions/run-docker
with:
services: ''
digest: ${{ needs.build.outputs.digest }}
version: ${{ needs.build.outputs.version }}
run: |
make test_reviewers_and_zadmin
- name: Calculate splits
id: result
shell: bash
run: |
splits=${{ inputs.splits || 14 }}
echo "splits: $splits"
echo "splits=$splits" >> $GITHUB_OUTPUT

test_internal_routes_allowed:
# Construct the matrix input for test_main using the groups count
# the matrix.group should be an array of numbers from 1 to $splits
matrix=[$(seq -s, 1 $splits)]
echo "matrix: $matrix"
echo "matrix=$matrix" >> $GITHUB_OUTPUT

test_main:
runs-on: ubuntu-latest
needs: build
needs: [build, test_config]
strategy:
fail-fast: false
matrix:
group: ${{fromJson(needs.test_config.outputs.matrix)}}

steps:
- uses: actions/checkout@v4

- name: Test (test_internal_routes_allowed)
- name: Test (test_matrix)
uses: ./.github/actions/run-docker
with:
services: ''
digest: ${{ needs.build.outputs.digest }}
version: ${{ needs.build.outputs.version }}
compose_file: docker-compose.yml
run: |
make test_internal_routes_allowed
split="--splits ${{ needs.test_config.outputs.splits }}"
group="--group ${{ matrix.group }}"
report="--report-log ${{ env.log_file}}"
make test_main ARGS="${split} ${group} ${report}"

test_es_tests:
- name: Upload logs
uses: actions/upload-artifact@v4
with:
path: ${{ env.log_file }}
name: ${{ env.log_artifact }}-${{ matrix.group }}
retention-days: 1
overwrite: true

test_log:
runs-on: ubuntu-latest
needs: build
if: always()
needs: [build, test_config, test_main]

steps:
- uses: actions/checkout@v4

- name: Test (test_es_tests)
uses: ./.github/actions/run-docker
- uses: actions/download-artifact@v4
with:
services: ''
digest: ${{ needs.build.outputs.digest }}
version: ${{ needs.build.outputs.version }}
run: |
make test_es_tests
pattern: ${{ env.log_artifact }}*

- name: Cat logs
shell: bash
run: |
for dir in $(ls -d ${{ env.log_artifact }}* | sort -V); do
job=$(basename "$dir")
file="${dir}/${{ env.log_file }}"
if [ -f "$file" ]; then
cat "$file" | jq \
-r \
--arg job "$job" \
'select(has("when") and .when == "teardown") | "[\($job)] \(.outcome) \(.nodeid)"'
else
echo "$file: No such file or directory"
fi
done
Loading
Loading