Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into poetry-migrate
Browse files Browse the repository at this point in the history
  • Loading branch information
tushar5526 committed Aug 3, 2023
2 parents 174d20c + 6c96ccf commit 6630286
Show file tree
Hide file tree
Showing 196 changed files with 5,247 additions and 11,218 deletions.
10 changes: 0 additions & 10 deletions .eslintignore

This file was deleted.

9 changes: 0 additions & 9 deletions .flake8

This file was deleted.

6 changes: 3 additions & 3 deletions .github/actions/api-deploy-ecs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ runs:

- name: Set ECR tag
id: ecr-tag-variable
run: echo ::set-output name=tag::${{ inputs.image_tag }}
run: echo "tag=${{ inputs.image_tag }}" >> $GITHUB_OUTPUT
shell: bash

- name: Write git info to Docker image
Expand Down Expand Up @@ -159,7 +159,7 @@ runs:
cd api
docker build -t $ECR_REPOSITORY:$IMAGE_TAG -f Dockerfile --build-arg SAML_INSTALLED=1 .
docker push $ECR_REPOSITORY:$IMAGE_TAG
echo "::set-output name=image::$ECR_REPOSITORY:$IMAGE_TAG"
echo "image=$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT
shell: bash

- name: Fill in the new image ID in the Amazon ECS API task definition
Expand Down Expand Up @@ -187,7 +187,7 @@ runs:
AWS_DEFAULT_REGION: eu-west-2
TASK_DEFINITION: ${{ steps.task-def-migration.outputs.task-definition }}
run: |
echo "::set-output name=task_definition_arn::$(aws ecs register-task-definition --cli-input-json file://$TASK_DEFINITION | jq '.taskDefinition.taskDefinitionArn')"
echo "task_definition_arn=$(aws ecs register-task-definition --cli-input-json file://$TASK_DEFINITION | jq '.taskDefinition.taskDefinitionArn')" >> $GITHUB_OUTPUT
aws ecs run-task --cluster ${{ inputs.aws_ecs_cluster_name }} --count 1 --launch-type FARGATE --task-definition flagsmith-api-migration --network-configuration '{
"awsvpcConfiguration": {
"subnets": ["${{ inputs.aws_vpc_subnet_id }}"],
Expand Down
3 changes: 2 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
Thanks for submitting a PR! Please check the boxes below:

- [ ] I have run [`pre-commit`](https://docs.flagsmith.com/deployment/locally-api#pre-commit) to check linting
- [ ] I have run [`pre-commit`](https://docs.flagsmith.com/platform/contributing#pre-commit) to check linting
- [ ] I have filled in the "Changes" section below?
- [ ] I have filled in the "How did you test this code" section below?
- [ ] I have used a [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/) title for this Pull Request

## Changes

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/api-deploy-production-ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ jobs:
aws_identity_migration_task_role_arn: arn:aws:iam::084060095745:role/task-exec-role-741a7e3
aws_task_definitions_directory_path: infrastructure/aws/production
flagsmith_saml_revision: v1.1.0
flagsmith_workflows_revision: v1.2.4
flagsmith_workflows_revision: v1.2.5
flagsmith_auth_controller_revision: v0.0.1
flagsmith_rbac_revision: v0.1.2
flagsmith_rbac_revision: v0.2.0

- name: Deploy task processor to Production
uses: ./.github/actions/task-processor-deploy-ecs
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/api-deploy-staging-ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ jobs:
aws_identity_migration_task_role_arn: arn:aws:iam::302456015006:role/task-exec-role-6fb76f6
aws_task_definitions_directory_path: infrastructure/aws/staging
flagsmith_saml_revision: v1.1.0
flagsmith_workflows_revision: v1.2.4
flagsmith_workflows_revision: v1.2.5
flagsmith_auth_controller_revision: v0.0.1
flagsmith_rbac_revision: v0.1.2
flagsmith_rbac_revision: v0.2.0

- name: Deploy task processor to Staging
uses: ./.github/actions/task-processor-deploy-ecs
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/api-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ on:
- api/**
- .github/**
types: [opened, synchronize, reopened, ready_for_review]
push:
paths:
- api/**
- .github/**
branches:
- main

defaults:
run:
Expand Down Expand Up @@ -64,3 +70,11 @@ jobs:
env:
DOTENV_OVERRIDE_FILE: .env-ci
run: make test

- name: Upload Coverage
uses: codecov/codecov-action@v3
env:
PYTHON: ${{ matrix.python-version }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: PYTHON
1 change: 1 addition & 0 deletions .github/workflows/frontend-deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,5 @@ jobs:
npm run env
npm run bundle
echo ${{ github.sha }} > CI_COMMIT_SHA
npm install --global [email protected]
vercel --prod --token ${{ secrets.VERCEL_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/frontend-e2e-docker-publish-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/platform-docker-build-e2e-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build E2E Frontend Base Image

on:
schedule:
# Update the E2E Firefox testcafe version on the first of every month
- cron: 0 0 1 * *

jobs:
build-e2e-docker-image:
runs-on: ubuntu-latest
name: Publish E2E Frontend Image

steps:
- name: Cloning repo
uses: actions/checkout@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}

- name: Build E2E Frontend Image
run: |
cd frontend
docker build -f Dockerfile-base.e2e --tag ghcr.io/flagsmith/e2e-frontend-base:latest .
docker push ghcr.io/flagsmith/e2e-frontend-base:latest
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:

env:
FLAGSMITH_SAML_REVISION: v1.1.0
FLAGSMITH_RBAC_REVISION: v0.1.2
FLAGSMITH_WORKFLOWS_REVISION: v1.2.4
FLAGSMITH_RBAC_REVISION: v0.2.0
FLAGSMITH_WORKFLOWS_REVISION: v1.2.5

jobs:
build-dockerhub:
Expand Down
27 changes: 25 additions & 2 deletions .github/workflows/platform-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore:
- docs/**
- infrastructure/**

jobs:
validate-pr-title:
Expand All @@ -14,6 +15,19 @@ jobs:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: | # mirrors changelog-sections in the /release-please-config.json
fix
feat
infra
docs
chore
build
deps
ci
refactor
style
test
run-e2e-tests:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -51,11 +65,13 @@ jobs:
slack_token: ${{ secrets.SLACK_TOKEN }}
environment: local

- name: Output API logs
- name: Output API container status and logs
if: failure()
env:
API_CONTAINER_ID: ${{ steps.run-local-api.outputs.containerId }}
run: docker logs $API_CONTAINER_ID
run: |
docker inspect $API_CONTAINER_ID | jq '.[0].State'
docker logs $API_CONTAINER_ID
run-e2e-tests-docker-unified:
runs-on: ubuntu-latest
Expand All @@ -65,6 +81,13 @@ jobs:
- name: Cloning repo
uses: actions/checkout@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}

- name: Run docker-compose with unified-image
working-directory: frontend
env:
Expand Down
42 changes: 8 additions & 34 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,56 +4,30 @@ repos:
hooks:
- id: isort
name: isort (python)

- repo: https://github.com/psf/black
rev: 23.1.0
rev: 23.7.0
hooks:
- id: black
language_version: python3
exclude: migrations

- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
name: flake8
args: [--config, api/.flake8]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: check-json
- id: check-toml

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0
hooks:
- id: prettier
- repo: https://github.com/pre-commit/mirrors-eslint
rev: 'v8.44.0'
hooks:
- id: eslint
files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx]
types: [file]
args: [--fix]
exclude: |
(?x)(
.idea|
^frontend/node_modules/|
^frontend/reports/|
^frontend/public/|
^frontend/tests_output/|
^frontend/web/static/|
^frontend/web/project/libs.js/|
^frontend/e2e/|
^frontend/webpack/|
^frontend/api/
)$
additional_dependencies:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- '@typescript-eslint/[email protected]'
- [email protected]
- [email protected]
- '@dword-design/[email protected]'
- '@typescript-eslint/[email protected]'
- [email protected]
- [email protected]
- [email protected]
exclude: ^(frontend/|CHANGELOG.md)
11 changes: 1 addition & 10 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,4 @@
*.json
*.handlebars
*.css
.bablerc
frontend/node_modules
frontend/report
frontend/public
frontend/tests_output
frontend/web/static
frontend/web/project/libs.js
frontend/e2e
frontend/webpack
frontend/api
.bablerc
19 changes: 0 additions & 19 deletions .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,6 @@
"options": {
"tabWidth": 2
}
},
{
"files": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"],
"options": {
"arrowParens": "always",
"bracketSpacing": true,
"insertPragma": false,
"jsxSingleQuote": true,
"printWidth": 80,
"proseWrap": "preserve",
"quoteProps": "preserve",
"requirePragma": false,
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false,
"vueIndentScriptAndStyle": false
}
}
]
}
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.61.0"
".": "2.64.1"
}
Loading

0 comments on commit 6630286

Please sign in to comment.