Skip to content

Commit

Permalink
Merge branch 'main' into iss-res-96-script
Browse files Browse the repository at this point in the history
  • Loading branch information
koernerfelicia authored Jan 22, 2021
2 parents 36808db + dbe31e5 commit c269257
Show file tree
Hide file tree
Showing 35 changed files with 146 additions and 139 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
**Status (please check what you already did)**:
- [ ] added some tests for the functionality
- [ ] updated the documentation
- [ ] updated the changelog (please check [changelog](https://github.com/RasaHQ/rasa/tree/master/changelog) for instructions)
- [ ] updated the changelog (please check [changelog](https://github.com/RasaHQ/rasa/tree/main/changelog) for instructions)
- [ ] reformat files using `black` (please check [Readme](https://github.com/RasaHQ/rasa#code-style) for instructions)
2 changes: 1 addition & 1 deletion .github/configs/mr-test-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
## - dataset: ["Hermit"]
## config: ["Sparse + DIET(seq) + ResponseSelector(t2t)", "BERT + DIET(seq) + ResponseSelector(t2t)"]
#
## Example: Define a branch name to check-out for a dataset repository. Default branch is 'master'
## Example: Define a branch name to check-out for a dataset repository. Default branch is 'main'
## dataset_branch: "test-branch"
## include:
## - dataset: ["Carbon Bot", "Sara"]
Expand Down
4 changes: 2 additions & 2 deletions .github/templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ The template reads a file with a report (the report file is available as an arti
#### How to run locally

```shell
gomplate -d data=report.json -d results_master=report_master.json -f .github/templates/model_regression_test_results.tmpl
gomplate -d data=report.json -d results_main=report_main.json -f .github/templates/model_regression_test_results.tmpl
```

In order to be able to use the `.github/templates/model_regression_test_results.tmpl` template you need the following files:

- `report.json` - the file with a report generated by the `CI - Model Regression` workflow run in a PR. The report is available to download as an artifact in the workflow related to the PR.
- `report_master.json` - the file with a report generated by the `CI - Model Regression` workflow that is triggered on schedule event. A list of the workflows that you can download an artifact from, can be found [here](https://github.com/RasaHQ/rasa/actions?query=workflow%3A%22CI+-+Model+Regression%22+event%3Aschedule).
- `report_main.json` - the file with a report generated by the `CI - Model Regression` workflow that is triggered on schedule event. A list of the workflows that you can download an artifact from, can be found [here](https://github.com/RasaHQ/rasa/actions?query=workflow%3A%22CI+-+Model+Regression%22+event%3Aschedule).
4 changes: 2 additions & 2 deletions .github/templates/model_regression_test_config_to_json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ The template reads an issue/a PR comment and transforms a YAML code block into J

*/ -}}
{{- $config := ((datasource "github").body | regexp.Find "```(?s)(.*)```" | regexp.ReplaceLiteral "```.*|\r" "" | yaml | toJSON | json) -}}
{{- $dataset_branch := "master" -}}
{{- /* if a branch name for dataset repository is not defined use the master branch */ -}}
{{- $dataset_branch := "main" -}}
{{- /* if a branch name for dataset repository is not defined use the main branch */ -}}
{{- if has $config "dataset_branch" -}}
{{- $dataset_branch = $config.dataset_branch -}}
{{- end -}}
Expand Down
44 changes: 22 additions & 22 deletions .github/templates/model_regression_test_results.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ The print_result template returns data depends on available fields.

*/ -}}
{{ define "print_result" -}}
{{- if and (has (index .branch "micro avg") "f1-score") (has (index .master "micro avg") "f1-score") -}}
{{ printf "%.4f" (index (index .branch "micro avg") "f1-score") }} ({{ printf "%.2f" ((index (index .master "micro avg") "f1-score") | math.Sub (index (index .branch "micro avg") "f1-score")) }})
{{- else if and (has .branch "accuracy") (has .master "accuracy") -}}
{{ printf "%.4f" .branch.accuracy }} ({{ printf "%.2f" (.master.accuracy | math.Sub .branch.accuracy) }})
{{- else if and (has .branch "accuracy") (has (index .master "micro avg") "f1-score") -}}
{{ printf "%.4f" .branch.accuracy }} ({{ printf "%.2f" ((index (index .master "micro avg") "f1-score") | math.Sub .branch.accuracy) }})
{{- else if and (has (index .branch "micro avg") "f1-score") (has .master "accuracy") -}}
{{ printf "%.4f" (index (index .branch "micro avg") "f1-score") }} ({{ printf "%.2f" (.master.accuracy | math.Sub (index (index .branch "micro avg") "f1-score")) }})
{{- if and (has (index .branch "micro avg") "f1-score") (has (index .main "micro avg") "f1-score") -}}
{{ printf "%.4f" (index (index .branch "micro avg") "f1-score") }} ({{ printf "%.2f" ((index (index .main "micro avg") "f1-score") | math.Sub (index (index .branch "micro avg") "f1-score")) }})
{{- else if and (has .branch "accuracy") (has .main "accuracy") -}}
{{ printf "%.4f" .branch.accuracy }} ({{ printf "%.2f" (.main.accuracy | math.Sub .branch.accuracy) }})
{{- else if and (has .branch "accuracy") (has (index .main "micro avg") "f1-score") -}}
{{ printf "%.4f" .branch.accuracy }} ({{ printf "%.2f" ((index (index .main "micro avg") "f1-score") | math.Sub .branch.accuracy) }})
{{- else if and (has (index .branch "micro avg") "f1-score") (has .main "accuracy") -}}
{{ printf "%.4f" (index (index .branch "micro avg") "f1-score") }} ({{ printf "%.2f" (.main.accuracy | math.Sub (index (index .branch "micro avg") "f1-score")) }})
{{- else if (has .branch "accuracy") -}}
{{ printf "%.4f" .branch.accuracy }} (`no data`)
{{- else if has (index .branch "micro avg") "f1-score" -}}
Expand All @@ -28,9 +28,9 @@ The print_result template returns data depends on available fields.
{{- end -}}
{{- end -}}

{{- $results_master := (datasource "results_master") -}}
{{- $results_main := (datasource "results_main") -}}
{{ range $dataset, $config := (datasource "data")}}
{{- $dataset_master := (index $results_master $dataset) -}}
{{- $dataset_main := (index $results_main $dataset) -}}
Dataset: `{{$dataset}}`, Dataset repository branch: `{{ (index $config (index (keys $config) 0)).dataset_repository_branch }}`

| Configuration | Intent Classification Micro F1 | Entity Recognition Micro F1 | Response Selection Micro F1 |
Expand All @@ -39,34 +39,34 @@ Dataset: `{{$dataset}}`, Dataset repository branch: `{{ (index $config (index (k
| `{{ $config_name }}`<br> test: `{{ $config_data.test_run_time }}`, train: `{{ $config_data.train_run_time }}`, total: `{{ $config_data.total_run_time }}`|
{{- if has $config_data "intent_classification" -}}
{{- /* Use results from branch if there is lack of data doesn't exist in results from scheduled version */ -}}
{{- $intent_class_master := $config_data.intent_classification -}}
{{- if has $dataset_master $config_name -}}
{{- $intent_class_master = (index $dataset_master $config_name).intent_classification -}}
{{- $intent_class_main := $config_data.intent_classification -}}
{{- if has $dataset_main $config_name -}}
{{- $intent_class_main = (index $dataset_main $config_name).intent_classification -}}
{{- end -}}
{{- $intent_class := index $config_data.intent_classification -}}
{{ template "print_result" (dict "branch" $intent_class "master" $intent_class_master) }}|
{{ template "print_result" (dict "branch" $intent_class "main" $intent_class_main) }}|
{{- else -}}
`no data`|
{{- end -}}
{{- if has $config_data "entity_prediction" -}}
{{- /* Use results from branch if there is lack of data doesn't exist in results from scheduled version */ -}}
{{- $entity_class_master := index $config_data.entity_prediction -}}
{{- if has $dataset_master $config_name -}}
{{- $entity_class_master = (index $dataset_master $config_name).entity_prediction -}}
{{- $entity_class_main := index $config_data.entity_prediction -}}
{{- if has $dataset_main $config_name -}}
{{- $entity_class_main = (index $dataset_main $config_name).entity_prediction -}}
{{- end -}}
{{- $entity_class := $config_data.entity_prediction -}}
{{ template "print_result" (dict "branch" $entity_class "master" $entity_class_master) }}|
{{ template "print_result" (dict "branch" $entity_class "main" $entity_class_main) }}|
{{- else -}}
`no data`|
{{- end -}}
{{- if has $config_data "response_selection" -}}
{{- /* Use results from branch if there is lack of data doesn't exist in results from scheduled version */ -}}
{{- $response_class_master := index $config_data.response_selection -}}
{{- if has $dataset_master $config_name -}}
{{- $response_class_master = (index $dataset_master $config_name).response_selection -}}
{{- $response_class_main := index $config_data.response_selection -}}
{{- if has $dataset_main $config_name -}}
{{- $response_class_main = (index $dataset_main $config_name).response_selection -}}
{{- end -}}
{{- $response_class := $config_data.response_selection -}}
{{ template "print_result" (dict "branch" $response_class "master" $response_class_master) }}|
{{ template "print_result" (dict "branch" $response_class "main" $response_class_main) }}|
{{- else -}}
`no data`|
{{- end }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-model-regression-on-schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout master
- name: Checkout main
uses: actions/checkout@v2

- name: Download yq
Expand Down Expand Up @@ -150,7 +150,7 @@ jobs:
if: steps.set_dataset_config_vars.outputs.is_dataset_exists == 'true' && steps.set_dataset_config_vars.outputs.is_config_exists == 'true'
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-3.8-${{ hashFiles('**/poetry.lock') }}
key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-3.8-${{ hashFiles('**/poetry.lock') }}-${{ secrets.POETRY_CACHE_VERSION }}

- name: Install Dependencies 📦
if: steps.set_dataset_config_vars.outputs.is_dataset_exists == 'true' && steps.set_dataset_config_vars.outputs.is_config_exists == 'true'
Expand Down Expand Up @@ -206,7 +206,7 @@ jobs:
TRAIN_RUN_TIME: ${{ steps.run_test.outputs.train_run_time }}
TOTAL_RUN_TIME: ${{ steps.run_test.outputs.total_run_time }}
PR_URL: ""
DATASET_REPOSITORY_BRANCH: "master"
DATASET_REPOSITORY_BRANCH: "main"
run: |-
poetry run pip install analytics-python
poetry run python .github/scripts/mr_publish_results.py
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/ci-model-regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
cleanup_runs:
name: Cancel old branch builds
runs-on: ubuntu-latest
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'"

steps:
- name: Find and cancel old builds of this branch
Expand All @@ -35,7 +35,7 @@ jobs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
configuration_id: ${{ steps.fc_config.outputs.comment-id }}
steps:
- name: Checkout master
- name: Checkout main
uses: actions/checkout@v2

- name: Checkout dataset
Expand Down Expand Up @@ -244,7 +244,7 @@ jobs:
if: steps.set_dataset_config_vars.outputs.is_dataset_exists == 'true' && steps.set_dataset_config_vars.outputs.is_config_exists == 'true'
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-3.8-${{ hashFiles('**/poetry.lock') }}
key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-3.8-${{ hashFiles('**/poetry.lock') }}-${{ secrets.POETRY_CACHE_VERSION }}

- name: Install Dependencies 📦
if: steps.set_dataset_config_vars.outputs.is_dataset_exists == 'true' && steps.set_dataset_config_vars.outputs.is_config_exists == 'true'
Expand Down Expand Up @@ -391,7 +391,7 @@ jobs:
if: steps.set_dataset_config_vars.outputs.is_dataset_exists == 'true' && steps.set_dataset_config_vars.outputs.is_config_exists == 'true'
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-3.8-${{ hashFiles('**/poetry.lock') }}
key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-3.8-${{ hashFiles('**/poetry.lock') }}-${{ secrets.POETRY_CACHE_VERSION }}

- name: Install Dependencies 📦
if: steps.set_dataset_config_vars.outputs.is_dataset_exists == 'true' && steps.set_dataset_config_vars.outputs.is_config_exists == 'true'
Expand Down Expand Up @@ -474,7 +474,7 @@ jobs:
| jq -r '.workflows[] | select(.name == "${{ github.workflow }}") | select(.path | test("schedule")) | .id')
ARTIFACT_URL=$(curl -s -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' -H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/${{ github.repository }}/actions/workflows/${SCHEDULE_ID}/runs?event=schedule&status=completed&branch=master&per_page=1" | jq -r .workflow_runs[0].artifacts_url)
"https://api.github.com/repos/${{ github.repository }}/actions/workflows/${SCHEDULE_ID}/runs?event=schedule&status=completed&branch=main&per_page=1" | jq -r .workflow_runs[0].artifacts_url)
DOWNLOAD_URL=$(curl -s -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' -H "Accept: application/vnd.github.v3+json" "${ARTIFACT_URL}" \
| jq -r '.artifacts[] | select(.name="report.json") | .archive_download_url')
Expand All @@ -483,7 +483,7 @@ jobs:
curl -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' -LJO -H "Accept: application/vnd.github.v3+json" $DOWNLOAD_URL
# Unzip and change name
unzip report.json.zip && mv report.json report_master.json
unzip report.json.zip && mv report.json report_main.json
- name: Download the report
uses: actions/download-artifact@v2
Expand All @@ -498,7 +498,7 @@ jobs:
- name: Render a comment to add
id: get_results
run: |
OUTPUT="$(gomplate -d data=report.json -d results_master=report_master.json -f .github/templates/model_regression_test_results.tmpl)"
OUTPUT="$(gomplate -d data=report.json -d results_main=report_main.json -f .github/templates/model_regression_test_results.tmpl)"
OUTPUT="${OUTPUT//$'\n'/'%0A'}"
OUTPUT="${OUTPUT//$'\r'/'%0D'}"
echo "::set-output name=result::$OUTPUT"
Expand Down Expand Up @@ -550,7 +550,7 @@ jobs:
| jq -r '.workflows[] | select(.name == "${{ github.workflow }}") | select(.path | test("schedule")) | .id')
ARTIFACT_URL=$(curl -s -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' -H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/${{ github.repository }}/actions/workflows/${SCHEDULE_ID}/runs?event=schedule&status=completed&branch=master&per_page=1" | jq -r .workflow_runs[0].artifacts_url)
"https://api.github.com/repos/${{ github.repository }}/actions/workflows/${SCHEDULE_ID}/runs?event=schedule&status=completed&branch=main&per_page=1" | jq -r .workflow_runs[0].artifacts_url)
DOWNLOAD_URL=$(curl -s -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' -H "Accept: application/vnd.github.v3+json" "${ARTIFACT_URL}" \
| jq -r '.artifacts[] | select(.name="report.json") | .archive_download_url')
Expand All @@ -559,7 +559,7 @@ jobs:
curl -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' -LJO -H "Accept: application/vnd.github.v3+json" $DOWNLOAD_URL
# Unzip and change name
unzip report.json.zip && mv report.json report_master.json
unzip report.json.zip && mv report.json report_main.json
- name: Download the report
uses: actions/download-artifact@v2
Expand All @@ -574,7 +574,7 @@ jobs:
- name: Render a comment to add
id: get_results
run: |
OUTPUT="$(gomplate -d data=report.json -d results_master=report_master.json -f .github/templates/model_regression_test_results.tmpl)"
OUTPUT="$(gomplate -d data=report.json -d results_main=report_main.json -f .github/templates/model_regression_test_results.tmpl)"
OUTPUT="${OUTPUT//$'\n'/'%0A'}"
OUTPUT="${OUTPUT//$'\r'/'%0D'}"
echo "::set-output name=result::$OUTPUT"
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/continous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Continuous Integration
on:
push:
branches:
- master
- main
tags:
- '*'
pull_request:
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
uses: actions/cache@v2
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-3.7-${{ hashFiles('**/poetry.lock') }}
key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-3.7-${{ hashFiles('**/poetry.lock') }}-${{ secrets.POETRY_CACHE_VERSION }}
restore-keys: ${{ runner.os }}-poetry-3.7

- name: Load Yarn Cached Packages ⬇
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
uses: actions/cache@v2
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-3.7-${{ hashFiles('**/poetry.lock') }}
key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-3.7-${{ hashFiles('**/poetry.lock') }}-${{ secrets.POETRY_CACHE_VERSION }}
restore-keys: ${{ runner.os }}-poetry-3.7

- name: Install Dependencies 📦
Expand Down Expand Up @@ -221,7 +221,7 @@ jobs:
uses: actions/cache@v2
with:
path: .venv
key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}-venv
key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}-venv-${{ secrets.POETRY_CACHE_VERSION }}

- name: Clear Poetry cache
if: steps.cache-poetry.outputs.cache-hit == 'true' && needs.changes.outputs.backend == 'true' && contains(github.event.pull_request.labels.*.name, 'tools:clear-poetry-cache-unit-tests')
Expand Down Expand Up @@ -337,7 +337,7 @@ jobs:
run: docker build . --file ${{ matrix.image.file }} --tag rasa/rasa:latest${{ matrix.image.tag_ext }} --cache-from rasa/rasa:latest${{ matrix.image.tag_ext }}

- name: Push image with latest tag 📦
if: needs.changes.outputs.docker == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'RasaHQ/rasa'
if: needs.changes.outputs.docker == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'RasaHQ/rasa'
run: docker push rasa/rasa:latest${{ matrix.image.tag_ext }}

- name: Push image with ${{github.ref}} tag 📦
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish Documentation
on:
push:
branches:
- 'master'
- 'main'
tags:
- '**'

Expand All @@ -20,7 +20,7 @@ jobs:
docs:
name: Build Docs
runs-on: ubuntu-latest
if: github.repository == 'RasaHQ/rasa' # don't run this for master branches of forks, would fail anyways
if: github.repository == 'RasaHQ/rasa' # don't run this for main branches of forks, would fail anyways

steps:
- name: Checkout git repository 🕝
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
uses: actions/cache@v1
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-3.6-non-full-${{ hashFiles('**/poetry.lock') }}
key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-3.6-non-full-${{ hashFiles('**/poetry.lock') }}-${{ secrets.POETRY_CACHE_VERSION }}
restore-keys: ${{ runner.os }}-poetry-3.6-non-full

- name: Load Yarn Cached Packages ⬇
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/security-scans.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
cleanup_runs:
name: Cancel old branch builds
runs-on: ubuntu-latest
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'"

steps:
- name: Find and cancel old builds of this branch
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
uses: actions/cache@v1
with:
path: .venv
key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-3.7-${{ hashFiles('**/poetry.lock') }}
key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-3.7-${{ hashFiles('**/poetry.lock') }}-${{ secrets.POETRY_CACHE_VERSION }}
restore-keys: ${{ runner.os }}-poetry-3.7

- name: Install Dependencies (Linux) 📦
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Typo CI
on:
push:
branches-ignore:
- master
- main
jobs:
spellcheck:
name: Typo CI (GitHub Action)
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ file is managed by ``towncrier``.

You **may** edit previous change logs to fix problems like typo corrections or such.
You can find more information on how to add a new change log entry at
https://github.com/RasaHQ/rasa/tree/master/changelog/ . -->
https://github.com/RasaHQ/rasa/tree/main/changelog/ . -->

<!-- TOWNCRIER -->

Expand Down
Loading

0 comments on commit c269257

Please sign in to comment.