Skip to content

Commit

Permalink
Merge branch 'main' into merge-3.6.x-main-6019299
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchariGr authored Jan 17, 2024
2 parents 6019299 + cca30d4 commit 5f451fc
Show file tree
Hide file tree
Showing 176 changed files with 3,785 additions and 832 deletions.
34 changes: 0 additions & 34 deletions .codeclimate.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/scripts/download_pretrained.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def get_model_name_and_weights_from_config(
if model_name not in model_class_dict:
raise KeyError(
f"'{model_name}' not a valid model name. Choose from "
f"{str(list(model_class_dict.keys()))} or create"
f"{list(model_class_dict.keys())!s} or create"
f"a new class inheriting from this class to support your model."
)

Expand Down
20 changes: 15 additions & 5 deletions .github/tests/test_download_pretrained.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ def test_download_pretrained_lmf_exists_with_model_name():
config = yaml.load(CONFIG_FPATH)

steps = config.get("pipeline", [])
step = list(filter(lambda x: x["name"] == download_pretrained.COMP_NAME, steps))[0]
step = list( # noqa: RUF015
filter(lambda x: x["name"] == download_pretrained.COMP_NAME, steps)
)[0]
step["model_name"] = "roberta"
step["cache_dir"] = "/this/dir"

Expand All @@ -41,7 +43,9 @@ def test_download_pretrained_unknown_model_name():
config = yaml.load(CONFIG_FPATH)

steps = config.get("pipeline", [])
step = list(filter(lambda x: x["name"] == download_pretrained.COMP_NAME, steps))[0]
step = list( # noqa: RUF015
filter(lambda x: x["name"] == download_pretrained.COMP_NAME, steps)
)[0]
step["model_name"] = "unknown"

with tempfile.NamedTemporaryFile("w+") as fp:
Expand All @@ -56,7 +60,9 @@ def test_download_pretrained_multiple_model_names():
config = yaml.load(CONFIG_FPATH)

steps = config.get("pipeline", [])
step = list(filter(lambda x: x["name"] == download_pretrained.COMP_NAME, steps))[0]
step = list( # noqa: RUF015
filter(lambda x: x["name"] == download_pretrained.COMP_NAME, steps)
)[0]
step_new = deepcopy(step)
step_new["model_name"] = "roberta"
steps.append(step_new)
Expand All @@ -74,7 +80,9 @@ def test_download_pretrained_with_model_name_and_nondefault_weight():
config = yaml.load(CONFIG_FPATH)

steps = config.get("pipeline", [])
step = list(filter(lambda x: x["name"] == download_pretrained.COMP_NAME, steps))[0]
step = list( # noqa: RUF015
filter(lambda x: x["name"] == download_pretrained.COMP_NAME, steps)
)[0]
step["model_name"] = "bert"
step["model_weights"] = "bert-base-uncased"

Expand All @@ -91,7 +99,9 @@ def test_download_pretrained_lmf_doesnt_exists():
config = yaml.load(CONFIG_FPATH)

steps = config.get("pipeline", [])
step = list(filter(lambda x: x["name"] == download_pretrained.COMP_NAME, steps))[0]
step = list( # noqa: RUF015
filter(lambda x: x["name"] == download_pretrained.COMP_NAME, steps)
)[0]
steps.remove(step)

with tempfile.NamedTemporaryFile("w+") as fp:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-model-regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ jobs:
echo "to_ts=$TIME_UNIX_NOW" >> $GITHUB_OUTPUT
- name: Publish results as a PR comment
uses: marocchino/sticky-pull-request-comment@f61b6cf21ef2fcc468f4345cdfcc9bda741d2343 # v2.6.2
uses: marocchino/sticky-pull-request-comment@f6a2580ed520ae15da6076e7410b088d1c5dddd9 # v2.7.0
if: ${{ always() }}
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
54 changes: 30 additions & 24 deletions .github/workflows/continous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -553,8 +553,8 @@ jobs:
path: |
${{ github.workspace }}/${{ matrix.test }}-coverage
upload_coverage_reports:
name: Upload coverage reports to codeclimate
prepare_coverage_reports_analyse_with_sonarcloud:
name: Prepare coverage reports and Analyse coverage with Sonarcloud
if: github.ref_type != 'tag'
runs-on: ubuntu-22.04
# Always upload results even if tests failed
Expand Down Expand Up @@ -595,15 +595,19 @@ jobs:
coverage combine "${final_dir}/"*
coverage xml
- name: Upload reports to codeclimate
if: needs.changes.outputs.backend == 'true'
uses: paambaati/codeclimate-action@b649ad206d2e83dafb9ed130deba698aa1b41d78
- name: Analyse code with SonarCloud
uses: sonarsource/sonarcloud-github-action@5875562561d22a34be0c657405578705a169af6c
env:
CC_TEST_REPORTER_ID: ${{ secrets.CODECLIMATE_REPORTER_ID }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
coverageLocations: |
${{ github.workspace }}/coverage.xml:coverage.py
debug: true
args: >
-Dsonar.organization=rasahq
-Dsonar.projectKey=RasaHQ_rasa
-Dsonar.sources=.
-Dsonar.python.coverage.reportPaths=${{ github.workspace }}/tests_coverage
-Dsonar.host.url=https://sonarcloud.io
-Dsonar.verbose=true
integration_test:
name: Run Non-Sequential Integration Tests
Expand Down Expand Up @@ -876,7 +880,7 @@ jobs:
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2.2.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@ecf95283f03858871ff00b787d79c419715afc34 # v2.7.0
uses: docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55 # v2.7.0

- name: Read Poetry Version 🔢
run: |
Expand Down Expand Up @@ -1061,7 +1065,7 @@ jobs:
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2.2.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@ecf95283f03858871ff00b787d79c419715afc34 # v2.7.0
uses: docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55 # v2.7.0

- name: Free disk space
if: needs.changes.outputs.docker == 'true'
Expand Down Expand Up @@ -1117,19 +1121,21 @@ jobs:
docker buildx bake --set *.platform=linux/amd64,linux/arm64 -f docker/docker-bake.hcl ${{ matrix.image }} --push
# # Tag the image as latest
# if [[ "${IS_NEWEST_VERSION}" == "true" ]]; then
# if [[ "${{ matrix.image }}" == "default" ]]; then
# RELEASE_TAG="${IMAGE_TAG}"
# else
# RELEASE_TAG="${IMAGE_TAG}-${{ matrix.image }}"
# fi
#
# LATEST_TAG=$(echo $RELEASE_TAG | sed 's/'$IMAGE_TAG'/latest/g')
#
# docker tag rasa/rasa:${RELEASE_TAG} rasa/rasa:${LATEST_TAG}
# docker push rasa/rasa:${LATEST_TAG}
# fi
# Tag the image as latest
if [[ "${IS_NEWEST_VERSION}" == "true" ]]; then
if [[ "${{ matrix.image }}" == "default" ]]; then
RELEASE_TAG="${IMAGE_TAG}"
else
RELEASE_TAG="${IMAGE_TAG}-${{ matrix.image }}"
fi
LATEST_TAG=$(echo $RELEASE_TAG | sed 's/'$IMAGE_TAG'/latest/g')
# This will not build the image from ground up, but will only tag the existing image with LATEST_TAG
IMAGE_TAG=${LATEST_TAG} docker buildx bake --set *.platform=linux/amd64,linux/arm64 -f docker/docker-bake.hcl ${{ matrix.image }}
# Push tagged image
IMAGE_TAG=${LATEST_TAG} docker buildx bake --set *.platform=linux/amd64,linux/arm64 -f docker/docker-bake.hcl ${{ matrix.image }} --push
fi
deploy:
name: Deploy to PyPI
Expand Down
36 changes: 28 additions & 8 deletions .github/workflows/nightly_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install Python module
run: |
python3 -m pip install pluggy
python3 -m pip install ruamel.yaml
- name: Set up Python ${{ env.DEFAULT_PYTHON_VERSION }} 🐍
uses: actions/setup-python@57ded4d7d5e986d7296eab16560982c6dd7c923b
with:
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}

- name: Compose tag name
id: set_tagname
Expand All @@ -31,7 +31,8 @@ jobs:
# Find latest rasa-oss version
echo "Trying to find the latest rasa-oss version..."
LATEST_RASA_MINOR=$(python -c "import sys; import os; sys.path.append('${{ github.workspace }}/rasa'); from rasa.version import __version__; print(__version__)")
pip install toml
LATEST_RASA_MINOR=$(python scripts/get_version_from_toml.py)
echo "Current RASA version: ${LATEST_RASA_MINOR}"
LATEST_NIGHTLY_VERSION=$(echo ${LATEST_RASA_MINOR})
Expand Down Expand Up @@ -61,10 +62,10 @@ jobs:
- name: Checkout git repository 🕝
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c

- name: Set up Python 3.9 🐍
- name: Set up Python ${{ env.DEFAULT_PYTHON_VERSION }} 🐍
uses: actions/setup-python@57ded4d7d5e986d7296eab16560982c6dd7c923b
with:
python-version: 3.9
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}

- name: Read Poetry Version 🔢
run: |
Expand Down Expand Up @@ -140,7 +141,7 @@ jobs:
shell: bash

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c
uses: docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55
id: buildx
with:
version: v0.5.1
Expand Down Expand Up @@ -176,3 +177,22 @@ jobs:
- name: Push image to release registry
run: |
docker push ${{env.DEV_REGISTRY}}/rasa:${IMAGE_TAG}
send_slack_notification_on_failure:
name: Notify Slack
runs-on: ubuntu-22.04
if: always()
needs:
- docker
- deploy

steps:
- name: Notify Slack of failure ⛔️
# send notification if 'deploy' or 'docker' is skipped (previous needed job failed) or failed
if: needs.docker.result != 'success' || needs.deploy.result != 'success'
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASE_ASSISTANT_ATOM_ALERTS_WEBHOOK }}
uses: Ilshidur/action-slack@689ad44a9c9092315abd286d0e3a9a74d31ab78a
with:
args: "⛔️ *Rasa nightly release* failed 😱! Please check out GitHub Actions: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"

10 changes: 10 additions & 0 deletions .github/workflows/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Organization and project keys are displayed in the right sidebar of the project homepage
sonar.organization=rasahq
sonar.projectKey=RasaHQ_rasa
sonar.host.url=https://sonarcloud.io/project/overview?id=RasaHQ_rasa

sonar.python.coverage.reportPaths=./tests_coverage/coverage.xml

# relative paths to source directories. More details and properties are described
sonar.tests=./tests/
sonar.verbose=true
Loading

0 comments on commit 5f451fc

Please sign in to comment.