forked from saleor/saleor
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'saleor:main' into master
- Loading branch information
Showing
481 changed files
with
25,028 additions
and
8,503 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Publish for load test | ||
|
||
on: | ||
pull_request: | ||
types: [reopened, synchronize, labeled] | ||
branches: ["**"] | ||
|
||
jobs: | ||
init: | ||
if: ${{ ((github.event.action == 'labeled') && (github.event.label.name == 'load test')) || ((github.event.action != 'labeled') && contains(github.event.pull_request.labels.*.name, 'load test')) }} | ||
runs-on: ubuntu-20.04 | ||
outputs: | ||
version: ${{ steps.variables.outputs.version }} | ||
steps: | ||
- name: Prepare variables | ||
id: variables | ||
run: | ||
set -x | ||
|
||
branch=${{ github.event.pull_request.head.ref }} | ||
branch_slug=$(echo "$branch" | sed 's@/@-@g') | ||
branch_sha=${{ github.event.pull_request.head.sha }} | ||
image_version="${branch_slug}-${branch_sha:0:8}" | ||
|
||
echo "VERSION=${image_version}" >> $GITHUB_OUTPUT | ||
|
||
publish: | ||
needs: | ||
- init | ||
uses: ./.github/workflows/publish-containers.yml | ||
with: | ||
version: ${{ needs.init.outputs.version }} | ||
secrets: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CLOUD_CI_WEBHOOK_URL }} | ||
SLACK_MENTION_GROUP_ID: ${{ secrets.SLACK_CORE_SUPPORT_GROUP_ID }} | ||
|
||
deploy: | ||
runs-on: ubuntu-20.04 | ||
needs: | ||
- publish | ||
steps: | ||
- name: Trigger load test deployment | ||
run: | | ||
curl -f -X POST \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
-H "Authorization: Bearer ${{ secrets.SALEOR_RELEASE_TOKEN }}" \ | ||
https://api.github.com/repos/saleor/saleor-multitenant/dispatches \ | ||
-d "{\"event_type\":\"deploy-load-test\",\"client_payload\":{\"version\":\"${{ needs.publish.outputs.version }}\",\"branch\":\"${{ github.event.pull_request.base.ref }}\"}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Publish main | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- ci/** | ||
|
||
jobs: | ||
publish: | ||
uses: ./.github/workflows/publish-containers.yml | ||
with: | ||
prefix: unstable- | ||
secrets: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CLOUD_CI_WEBHOOK_URL }} | ||
SLACK_MENTION_GROUP_ID: ${{ secrets.SLACK_CORE_SUPPORT_GROUP_ID }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Publish release tag | ||
|
||
on: | ||
push: | ||
tags: | ||
# Matches stable and pre-releases | ||
- "[0-9]+.[0-9]+.[0-9]+*" | ||
|
||
jobs: | ||
publish: | ||
uses: ./.github/workflows/publish-containers.yml | ||
secrets: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CLOUD_CI_WEBHOOK_URL }} | ||
SLACK_MENTION_GROUP_ID: ${{ secrets.SLACK_CORE_SUPPORT_GROUP_ID }} | ||
|
||
deploy: | ||
runs-on: ubuntu-20.04 | ||
needs: | ||
- publish | ||
steps: | ||
- name: Trigger staging deployment for tagged release | ||
run: | | ||
curl -f -X POST \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
-H "Authorization: Bearer ${{ secrets.SALEOR_RELEASE_TOKEN }}" \ | ||
https://api.github.com/repos/saleor/saleor-multitenant/dispatches \ | ||
-d "{\"event_type\":\"deploy-staging\",\"client_payload\":{\"version\":\"${{ needs.publish.outputs.version }}\"}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import logging | ||
from celery.utils.log import get_task_logger | ||
|
||
def same_name_using___name__(): | ||
# Using the same name (__name__) should match. | ||
# ruleid: task-logger-without-suffix | ||
logger = logging.getLogger(__name__) | ||
task_logger = get_task_logger(__name__) | ||
|
||
def same_name_with_celery_first(): | ||
# Using the same name (__name__) should match, | ||
# even if get_task_logger() is called before logging.getLogger(). | ||
# ruleid: task-logger-without-suffix | ||
task_logger = get_task_logger(__name__) | ||
logger = logging.getLogger(__name__) | ||
|
||
def different_name_get_task_logger(): | ||
# Using a different name in `get_task_logger()` shouldn't match. | ||
# ok: task-logger-without-suffix | ||
task_logger = get_task_logger(f"{__name__}.celery") | ||
|
||
def different_name_logging_getlogger(): | ||
# Using a different name in logging.getLogger shouldn't match. | ||
# ok: task-logger-without-suffix | ||
logger = logging.getLogger("foo") | ||
task_logger = get_task_logger(__name__) | ||
|
||
def same_name_hardcoded(): | ||
# Using the same name as a string literal should match. | ||
# ruleid: task-logger-without-suffix | ||
logger = logging.getLogger("foo") | ||
task_logger = get_task_logger("foo") | ||
|
||
def same_name_without_variables(): | ||
# Using the same name without creating variables should match. | ||
# ruleid: task-logger-without-suffix | ||
logging.getLogger("foo") | ||
get_task_logger("foo") | ||
|
Oops, something went wrong.