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

moved import out of type check #8739

Closed
wants to merge 195 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
195 commits
Select commit Hold shift + click to select a range
f85134c
Change --data type in 'rasa data validate' command
martasls Mar 17, 2021
85754b4
Merge branch 'main' into change-validate-data-type
ArjaanBuijk Mar 18, 2021
7658a36
Merge branch 'main' into change-validate-data-type
martasls Mar 19, 2021
ff8917e
Merge branch 'main' into change-validate-data-type
martasls Mar 23, 2021
aadd823
Merge branch 'main' into change-validate-data-type
martasls Mar 23, 2021
a3a6542
Add changelog entry
martasls Mar 23, 2021
d2c45bd
Update templates used for the model regression tests
Mar 30, 2021
10ffbb2
Add suport for Core and external dataset
Mar 30, 2021
c992e5a
Use main ref for external datasets
Mar 30, 2021
0292eec
Use corrent variable
Mar 30, 2021
f16f083
Don't check if config exists for external dataset
Mar 31, 2021
a4b3850
Change paths to dataset
Mar 31, 2021
89c02c6
Set directories vars
Mar 31, 2021
bf369b3
Set directories vars
Mar 31, 2021
6184374
Update templates
Mar 31, 2021
559848c
Add all-nlu and all-core shortcuts
Mar 31, 2021
d539e89
Update templates
Apr 1, 2021
42379c1
Update templates
Apr 1, 2021
f49acbe
Don't print a table if a given type is not avaiable
Apr 1, 2021
2e7a8cd
Add changes for CPU runner
Apr 1, 2021
20905b2
Add missing step
Apr 1, 2021
319eace
Update templates
Apr 1, 2021
48425df
Merge branch 'main' into change-validate-data-type
martasls Apr 3, 2021
2a9b90d
Fix data path in convert data method
martasls Apr 3, 2021
4bc12a3
Merge branch 'change-validate-data-type' of github.com:martasls/rasa …
martasls Apr 3, 2021
6babee5
Fix for missing intent warnings when running rasa test
b-quachtran Apr 7, 2021
17a5a0c
Merge branch 'main' into rasa_test_missing_intent_warning
b-quachtran Apr 8, 2021
84028cd
update loss type docs
indam23 Apr 9, 2021
40c3b9e
Add changes based on a code review
Apr 13, 2021
9472728
Remove useless env variable
Apr 13, 2021
63782d3
revert changes
Apr 13, 2021
7a043d1
Test new image
Apr 13, 2021
ef3d44f
Update paths used by the rasa command
Apr 13, 2021
b57ff22
Merge branch 'main' into mrt_prediction_policies
Apr 13, 2021
49c9a8b
Merge branch 'main' into loss_type_docs
indam23 Apr 13, 2021
7d6d896
Apply changes to the scheduled version
Apr 15, 2021
8f10950
Merge branch 'main' into mrt_prediction_policies
Apr 15, 2021
fbad836
add sleep to avoid race condition
wochinge Apr 19, 2021
e697716
Merge branch 'main' into misc/flaky-performance-test
wochinge Apr 19, 2021
81d0461
Merge branch 'main' into rasa_test_missing_intent_warning
b-quachtran Apr 20, 2021
479cf9d
Upload results as an artifact
Apr 21, 2021
5f44413
Use correct train directory
Apr 21, 2021
3c11c94
Add support for external dataset repository branch
Apr 22, 2021
d2f6645
Checkout external dataset with defined branch name
Apr 22, 2021
9e73490
Export additionalenv variables from configuration_variables.tmpl
Apr 22, 2021
5d112f9
Fix publish results script
Apr 22, 2021
2e38976
Update template for results
Apr 22, 2021
f38774b
Update publish script
Apr 22, 2021
0ab83a9
Add support for all-core and all-nlu shortcuts for datasets
Apr 22, 2021
b834273
Refactoring variables
Apr 22, 2021
dd139d9
Added default domain file exist check
b-quachtran Apr 22, 2021
1c2006a
Merge branch 'main' into rasa_test_missing_intent_warning
b-quachtran Apr 22, 2021
0f7ded4
Set default domain path for test data importers
b-quachtran Apr 23, 2021
96e296b
Merge branch 'rasa_test_missing_intent_warning' of https://github.com…
b-quachtran Apr 23, 2021
e203058
Removed unused import
b-quachtran Apr 23, 2021
01cf7ca
Added changelog
b-quachtran Apr 23, 2021
c20f804
Added Agent model directory check
b-quachtran Apr 23, 2021
e9e3285
Use accuracy field of micro avg is not available
Apr 23, 2021
fb8ebc7
Skip job if a given type is not available for a given dataset
Apr 23, 2021
880e781
Merge branch 'main' into mrt_prediction_policies
Apr 23, 2021
692adde
Fix a typo
Apr 23, 2021
3136615
Back to method
jppgomes Apr 29, 2021
5b63023
Check if port is int and raise exception
jppgomes Apr 29, 2021
de29352
import rasa excpetion
jppgomes Apr 29, 2021
c7126a6
remove unused import
jppgomes Apr 29, 2021
9b69e1d
Merge branch 'main' into 8309/check_if_port_is_int
jppgomes Apr 29, 2021
a7f01af
Update .pre-commit-config.yaml
jppgomes Apr 30, 2021
2fc00d9
Add tolerance for automatic alerts for the model regression tests
May 3, 2021
22db2a5
Merge branch 'main' into misc/flaky-performance-test
wochinge May 3, 2021
2e8c41d
improve performance analyse method
HotThoughts May 3, 2021
0a53e4d
move the fake data up a bit
HotThoughts May 3, 2021
a02b9a6
use single quote
HotThoughts May 3, 2021
770acfa
close if
HotThoughts May 3, 2021
a64dc14
test the case where the performance does not drop
HotThoughts May 3, 2021
b9788b3
test the case where the performance does not drop
HotThoughts May 3, 2021
eabfa2c
don't alert if there is already an issue for it
HotThoughts May 3, 2021
1f93bdd
uncomment notify slack steps
HotThoughts May 4, 2021
7fe3ef5
extend if condition
HotThoughts May 4, 2021
9ba96b0
test the case where the test run fails and performance drops
HotThoughts May 4, 2021
cd19a74
Remove test line
HotThoughts May 4, 2021
3e26e83
remove fake data + add test line
HotThoughts May 4, 2021
2809a6d
clean testing lines
HotThoughts May 4, 2021
e06bea1
Merge branch 'main' into add-tolerance-to-automatic-alerts-on-schedul…
HotThoughts May 4, 2021
c2aa8d8
Merge branch 'main' into add-tolerance-to-automatic-alerts-on-schedul…
HotThoughts May 4, 2021
eb0aca4
Adding tests and get exception
jppgomes May 4, 2021
6c14405
Merge branch '8309/check_if_port_is_int' of https://github.com/FGA-GC…
May 4, 2021
4f27931
remove unused vars from test
jppgomes May 4, 2021
bd0de44
remove parameter from test
jppgomes May 4, 2021
0234050
call factory and fix changelog
jppgomes May 4, 2021
b3447f6
Merge branch 'main' into refactoring_clean_code
jppgomes May 5, 2021
7dca056
remove unused import
jppgomes May 5, 2021
6e18dd8
assert on test
jppgomes May 5, 2021
e087d6f
Merge branch 'main' into 8309/check_if_port_is_int
jppgomes May 5, 2021
1789025
remove accidentally added lines
jppgomes May 5, 2021
939bac2
as e on with raise exception to get msg
jppgomes May 5, 2021
fdef0c9
Merge branch '8309/check_if_port_is_int' of https://github.com/FGA-GC…
May 5, 2021
b21a447
duplicate import
jppgomes May 6, 2021
a95fac0
Merge branch 'main' into change-validate-data-type
martasls May 6, 2021
3364a3a
Adapt code to unit tests
martasls May 6, 2021
d054053
Merge branch 'change-validate-data-type' of github.com:martasls/rasa …
martasls May 6, 2021
b6a87db
Merge branch 'main' into misc/flaky-performance-test
wochinge May 7, 2021
635dc2c
wait until process is created
wochinge May 7, 2021
9650bb2
Prepare release 2.6.0 (#8621) (#8627)
joejuzl May 7, 2021
ceee2e5
Bump sentry-sdk from 0.19.5 to 1.1.0
dependabot[bot] May 7, 2021
0cebeab
Merge pull request #8629 from RasaHQ/dependabot-pip-sentry-sdk-1.1.0
alwx May 7, 2021
64d8df4
Bump tensorflow-addons from 0.12.0 to 0.12.1
dependabot[bot] May 7, 2021
537a91b
Merge pull request #8159 from RasaHQ/dependabot-pip-tensorflow-addons…
alwx May 7, 2021
88d25db
Bump joblib from 0.15.1 to 1.0.1
dependabot[bot] May 7, 2021
e864fd1
Merge branch 'main' into change-validate-data-type
martasls May 7, 2021
189fe7a
Add missing import
martasls May 7, 2021
32b640f
Merge pull request #8181 from RasaHQ/dependabot-pip-joblib-1.0.1
alwx May 7, 2021
0eaa63f
Merge branch 'main' into change-validate-data-type
ArjaanBuijk May 7, 2021
4411a6c
Check date_file type on convert_training_data
martasls May 8, 2021
c653663
Fix RegexEntityExtractor subclass loading
Mazyod May 9, 2021
5379916
Merge branch 'main' into misc/flaky-performance-test
wochinge May 11, 2021
bdd97f2
Merge pull request #8495 from RasaHQ/misc/flaky-performance-test
wochinge May 11, 2021
4f14b39
Merge branch 'main' into change-validate-data-type
martasls May 11, 2021
10f2980
Added unit test
b-quachtran May 11, 2021
7bc4adb
Merge branch 'main' into rasa_test_missing_intent_warning
b-quachtran May 11, 2021
a9d4ac7
fix docstring
Mazyod May 11, 2021
554ee45
changelog
Mazyod May 11, 2021
4a5d2a7
Merge branch 'main' into bugfix/regex-subclass
Mazyod May 11, 2021
51c48b6
Merge pull request #8641 from Mazyod/bugfix/regex-subclass
wochinge May 12, 2021
60f2c5a
Merge branch 'main' into change-validate-data-type
martasls May 12, 2021
31a4fe3
Merge main into post-2.6.1 code; recreate poetry.lock.
samsucik May 12, 2021
f9d229f
Merge pull request #8671 from RasaHQ/merge-2.6.1-into-main
samsucik May 12, 2021
69e34bc
Add docstrings to convert_training_data method
martasls May 12, 2021
124ad18
Merge branch 'main' into change-validate-data-type
martasls May 12, 2021
c5ecf3d
add verify actions method and tests
ancalita May 10, 2021
6ee0070
add verify form slots in domain and tests
ancalita May 10, 2021
3d89c8e
remove whitespace in tests
ancalita May 10, 2021
d83a9d4
fix linter error in validator
ancalita May 10, 2021
71ca0a0
add changelog
ancalita May 10, 2021
177a501
rename changelog and make form slot method changes
ancalita May 12, 2021
9f7b0ca
bump pydoc-markdown
m-vdb May 12, 2021
18c77d8
Merge main to mrt_prediction_policies and resolve conflicts
May 12, 2021
7a8f3ea
Change order for the set datset commit step
May 12, 2021
8b50a96
Fix rule conflict bug (#8612)
May 12, 2021
69ef57f
Merge branch 'main' into fix-docs-code-reference-ordering
m-vdb May 12, 2021
68ab1d0
Merge pull request #8674 from RasaHQ/fix-docs-code-reference-ordering
May 12, 2021
3838fae
Merge branch 'main' into rasa-validate-7799
ancalita May 12, 2021
2974dde
Merge branch 'main' into change-validate-data-type
martasls May 12, 2021
5d35f6c
Update linting
martasls May 12, 2021
7de3aad
Merge branch 'change-validate-data-type' of github.com:martasls/rasa …
martasls May 12, 2021
35b39e2
Add missing brackets
May 12, 2021
93e8c5b
add domain fixture and valid tests
ancalita May 12, 2021
eaca487
Remove other (binary) file
martasls May 12, 2021
a6020fc
Remove blank line after docstrings
martasls May 12, 2021
ec07286
remove visited items set
ancalita May 12, 2021
03b3236
Rearrange attention output to have batch dimension on the 0th axis (#…
dakshvar22 May 12, 2021
d2762d8
Merge branch 'main' into change-validate-data-type
ArjaanBuijk May 12, 2021
abf0eef
Make sure data_file is a string when passed to os.path.exists()
martasls May 12, 2021
f0941a9
Merge branch 'change-validate-data-type' of github.com:martasls/rasa …
martasls May 12, 2021
cc3415a
Merge pull request #8225 from martasls/change-validate-data-type
ArjaanBuijk May 12, 2021
4fa14e7
Merge branch 'main' into 8309/check_if_port_is_int
jppgomes May 14, 2021
a9573c7
Merge branch 'main' into mrt_prediction_policies
May 14, 2021
b2cb34e
Merge branch 'main' into loss_type_docs
indam23 May 14, 2021
256c28d
Merge pull request #8430 from RasaHQ/loss_type_docs
indam23 May 14, 2021
159b17b
Merge branch 'main' into mrt_prediction_policies
May 14, 2021
04bab32
Merge pull request #8338 from RasaHQ/mrt_prediction_policies
May 14, 2021
ab98ef1
Remove test ref for the model regression tests
May 14, 2021
9b1e87f
Fix result formatting
May 14, 2021
c8e6c6b
Merge pull request #8696 from RasaHQ/remove_hardcoded_ref
May 15, 2021
58e309a
Move env THRESHOLD to top
HotThoughts May 17, 2021
f8966e8
fix a grammer mistake
HotThoughts May 17, 2021
6afa279
use Git SHA to refer GitHub Action
HotThoughts May 17, 2021
b72bed6
Merge branch 'main' into add-tolerance-to-automatic-alerts-on-schedul…
HotThoughts May 17, 2021
b30f05f
Merge branch 'main' into misc/merge-2.6.x-main
wochinge May 17, 2021
e05c77e
Merge branch 'main' into 8309/check_if_port_is_int
jppgomes May 17, 2021
327851b
Merge pull request #8575 from FGA-GCES/8309/check_if_port_is_int
ancalita May 17, 2021
a91886a
Merge branch 'main' into refactoring_clean_code
jppgomes May 17, 2021
f1e19f5
Merge pull request #8528 from FGA-GCES/refactoring_clean_code
indam23 May 17, 2021
fdb54e8
replace exception with warning, edit current tests and add test with …
ancalita May 17, 2021
7b83ea5
remove import exception statement
ancalita May 17, 2021
dc0eb34
fix new rasa data tests
ancalita May 17, 2021
8e0eb01
remove exception import in rasa data tests
ancalita May 17, 2021
4739840
apply review changes
ancalita May 17, 2021
b6a9360
Merge branch 'main' into misc/merge-2.6.x-main
wochinge May 17, 2021
6b10890
Merge pull request #8701 from RasaHQ/misc/merge-2.6.x-main
wochinge May 17, 2021
089fd9b
Update tests/core/test_test.py
b-quachtran May 17, 2021
51736f7
Merge branch 'main' into rasa_test_missing_intent_warning
b-quachtran May 17, 2021
f1d119d
Merge pull request #8388 from RasaHQ/rasa_test_missing_intent_warning
b-quachtran May 18, 2021
57957dc
Merge branch 'main' into 2.6.x
erohmensing May 18, 2021
263cf1f
Merge pull request #8710 from RasaHQ/merge-2.6.x
erohmensing May 18, 2021
32de037
Bump pytest-xdist from 1.34.0 to 2.2.1
dependabot[bot] May 18, 2021
1f15274
Merge branch 'main' into add-tolerance-to-automatic-alerts-on-schedul…
HotThoughts May 18, 2021
110916c
Merge pull request #8510 from RasaHQ/add-tolerance-to-automatic-alert…
May 18, 2021
2fadda6
add block_name attribute to warning message
ancalita May 18, 2021
f07b73a
Merge branch 'main' into rasa-validate-7799
ancalita May 18, 2021
1c5e35d
Merge pull request #8645 from RasaHQ/rasa-validate-7799
ancalita May 18, 2021
ae9989c
Changed the default config to train the RulePolicy before the TEDPoli…
joejuzl May 19, 2021
f004134
Merge branch 'main' into dependabot-pip-pytest-xdist-2.2.1
alwx May 20, 2021
41e3b22
Merge pull request #8203 from RasaHQ/dependabot-pip-pytest-xdist-2.2.1
alwx May 20, 2021
83ed6bb
moved import out of type check
May 24, 2021
0acc884
black formatting
May 24, 2021
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
6 changes: 5 additions & 1 deletion .github/configs/mr-test-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
## include:
## - dataset: ["Carbon Bot", "Sara"]
## config: ["all"]

##
## Shortcuts:
## You can use the "all" shortcut to include all available configurations or datasets.
## You can use the "all-nlu" shortcut to include all available NLU configurations or datasets.
## You can use the "all-core" shortcut to include all available core configurations or datasets.

include:
- dataset: ["Carbon Bot"]
Expand Down
2 changes: 1 addition & 1 deletion .github/runner/github-runner-deployment.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
spec:
priorityClassName: high-priority
automountServiceAccountToken: false
terminationGracePeriodSeconds: 180
terminationGracePeriodSeconds: 720
containers:
- name: github-runner
image: {{getenv "GH_RUNNER_IMAGE"}}:latest
Expand Down
20 changes: 19 additions & 1 deletion .github/scripts/mr_generate_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,46 @@
SUMMARY_FILE = os.environ["SUMMARY_FILE"]
CONFIG = os.environ["CONFIG"]
DATASET = os.environ["DATASET_NAME"]
TYPE = os.environ["TYPE"]
IS_EXTERNAL = os.environ["IS_EXTERNAL"]
CONFIG_REPOSITORY = "training-data"
CONFIG_REPOSITORY_BRANCH = os.environ["DATASET_REPOSITORY_BRANCH"]
DATASET_REPOSITORY_BRANCH = os.environ["DATASET_REPOSITORY_BRANCH"]
task_mapping = {
"intent_report.json": "intent_classification",
"CRFEntityExtractor_report.json": "entity_prediction",
"DIETClassifier_report.json": "entity_prediction",
"response_selection_report.json": "response_selection",
"story_report.json": "story_prediction",
}


def generate_json(file, task, data):
global IS_EXTERNAL
global DATASET_REPOSITORY_BRANCH

if not DATASET in data:
data = {DATASET: {CONFIG: {}}, **data}
elif not CONFIG in data[DATASET]:
data[DATASET] = {CONFIG: {}, **data[DATASET]}

if str(IS_EXTERNAL).lower() in ("yes", "true", "t", "1"):
IS_EXTERNAL = True
DATASET_REPOSITORY_BRANCH = os.environ["EXTERNAL_DATASET_REPOSITORY_BRANCH"]
else:
IS_EXTERNAL = False

data[DATASET][CONFIG] = {
"external_dataset_repository": IS_EXTERNAL,
"dataset_repository_branch": DATASET_REPOSITORY_BRANCH,
"config_repository": CONFIG_REPOSITORY,
"config_repository_branch": CONFIG_REPOSITORY_BRANCH,
"dataset_commit": os.environ["DATASET_COMMIT"],
"accelerator_type": os.environ["ACCELERATOR_TYPE"],
"test_run_time": os.environ["TEST_RUN_TIME"],
"train_run_time": os.environ["TRAIN_RUN_TIME"],
"total_run_time": os.environ["TOTAL_RUN_TIME"],
"type": TYPE,
**data[DATASET][CONFIG],
}

Expand All @@ -40,7 +58,7 @@ def read_results(file):
with open(file) as json_file:
data = json.load(json_file)

keys = ["accuracy", "weighted avg", "macro avg", "micro avg"]
keys = ["accuracy", "weighted avg", "macro avg", "micro avg", "conversation_accuracy"]
result = {key: data[key] for key in keys if key in data}

return result
Expand Down
23 changes: 22 additions & 1 deletion .github/scripts/mr_publish_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,48 @@
import json
import os

IS_EXTERNAL = os.environ["IS_EXTERNAL"]
DATASET_REPOSITORY_BRANCH = os.environ["DATASET_REPOSITORY_BRANCH"]
EXTERNAL_DATASET_REPOSITORY_BRANCH = None
CONFIG_REPOSITORY = "training-data"
CONFIG_REPOSITORY_BRANCH = os.environ["DATASET_REPOSITORY_BRANCH"]

analytics.write_key = os.environ["SEGMENT_TOKEN"]

task_mapping = {
"intent_report.json": "Intent Classification",
"CRFEntityExtractor_report.json": "Entity Prediction",
"DIETClassifier_report.json": "Entity Prediction",
"response_selection_report.json": "Response Selection",
"story_report.json": "Story Prediction",
}


def send_to_segment(context):
global IS_EXTERNAL
global DATASET_REPOSITORY_BRANCH

jobID = os.environ["GITHUB_RUN_ID"]

analytics.identify(
jobID, {"name": "model-regression-tests", "created_at": datetime.datetime.now()}
)

if str(IS_EXTERNAL).lower() in ("yes", "true", "t", "1"):
IS_EXTERNAL = True
DATASET_REPOSITORY_BRANCH = os.environ["EXTERNAL_DATASET_REPOSITORY_BRANCH"]
else:
IS_EXTERNAL = False

analytics.track(
jobID,
"results",
{
"dataset": os.environ["DATASET_NAME"],
"dataset_repository_branch": DATASET_REPOSITORY_BRANCH,
"external_dataset_repository": IS_EXTERNAL,
"config_repository": CONFIG_REPOSITORY,
"config_repository_branch": CONFIG_REPOSITORY_BRANCH,
"dataset_repository_branch": os.environ["DATASET_REPOSITORY_BRANCH"],
"dataset_commit": os.environ["DATASET_COMMIT"],
"workflow": os.environ["GITHUB_WORKFLOW"],
Expand All @@ -39,6 +59,7 @@ def send_to_segment(context):
"github_run_id": os.environ["GITHUB_RUN_ID"],
"github_sha": os.environ["GITHUB_SHA"],
"github_event": os.environ["GITHUB_EVENT_NAME"],
"type": os.environ["TYPE"],
**context,
},
)
Expand All @@ -48,7 +69,7 @@ def read_results(file):
with open(file) as json_file:
data = json.load(json_file)

keys = ["accuracy", "weighted avg", "macro avg", "micro avg"]
keys = ["accuracy", "weighted avg", "macro avg", "micro avg", "conversation_accuracy"]
result = {key: data[key] for key in keys if key in data}

return result
Expand Down
35 changes: 31 additions & 4 deletions .github/templates/configuration_variables.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,36 @@ which contain paths to file/directory.
*/ -}}
{{- $mapping := (datasource "mapping") -}}
{{- $dataset := (index $mapping.datasets (getenv "DATASET_NAME")) -}}
{{- $config := (index $mapping.configurations (getenv "CONFIG_NAME")) -}}

{{- $config := $mapping.configurations -}}
{{- if has $dataset "repository" }}
export DATASET="{{ $dataset.repository }}"
export IS_EXTERNAL="true"
echo "::add-mask::{{ $dataset.repository }}"
{{ if has $dataset "repository_branch" }}
export EXTERNAL_DATASET_REPOSITORY_BRANCH="{{ $dataset.repository_branch }}"
{{ else }}
export EXTERNAL_DATASET_REPOSITORY_BRANCH="main"
{{ end }}
{{- else if has $dataset "path" }}
export DATASET="{{ $dataset.path }}"
export CONFIG="{{ $dataset.language }}/{{ $config }}"
export IS_EXTERNAL="false"
echo "::add-mask::{{ $dataset.path }}"
echo "::add-mask::{{ $dataset.language }}/{{ $config }}"
{{ end }}

{{- if has $dataset "train" }}
export TRAIN_DIR="{{ $dataset.train }}"
{{ end }}
{{- if has $dataset "test" }}
export TEST_DIR="{{ $dataset.test }}"
{{ end }}
{{- if has $dataset "domain" }}
export DOMAIN_FILE="{{ $dataset.domain }}"
{{ end }}

{{- if (has $config.nlu (getenv "CONFIG_NAME")) }}
export CONFIG="{{ $dataset.language }}/nlu/{{ index $config.nlu (getenv "CONFIG_NAME") }}"
echo "::add-mask::{{ $dataset.language }}/nlu/{{ index $config.nlu (getenv "CONFIG_NAME") }}"
{{ else if (has $config.core (getenv "CONFIG_NAME")) }}
export CONFIG="{{ $dataset.language }}/core/{{ index $config.core (getenv "CONFIG_NAME") }}"
echo "::add-mask::{{ $dataset.language }}/core/{{ index $config.core (getenv "CONFIG_NAME") }}"
{{ end -}}
17 changes: 14 additions & 3 deletions .github/templates/model_regression_test_config_comment.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ Comment with a help message is added if a PR doesn't contain a comment
with a configuration for the model regression tests.

*/ -}}
{{ define "check_available_configuration" -}}
NLU
{{- if has .dataset "domain" -}}
, Core
{{- end -}}
{{- end -}}
Hey @{{ .Env.GITHUB_ACTOR }}! :wave: To run model regression tests, comment with the `/modeltest` command and a configuration.

_Tips :bulb:: The model regression test will be run on `push` events. You can re-run the tests by re-add `status:model-regression-tests` label or use a `Re-run jobs` button in Github Actions workflow._
Expand All @@ -23,12 +29,17 @@ You can copy this in your comment and customize:
>##########
>## Available datasets
>##########
{{range (coll.Keys (datasource "mapping").datasets)}}># - "{{.}}"{{"\n"}}{{ end -}}
{{range (coll.Keys (datasource "mapping").datasets)}}># - "{{ . }}" ({{ template "check_available_configuration" (dict "dataset" (index (datasource "mapping").datasets .)) }}){{"\n"}}{{ end -}}
>
>##########
>## Available configurations
>## Available NLU configurations
>##########
{{range (coll.Keys (datasource "mapping").configurations)}}># - "{{.}}"{{"\n"}}{{ end -}}
{{range (coll.Keys (datasource "mapping").configurations.nlu)}}># - "{{.}}"{{"\n"}}{{ end -}}
>
>##########
>## Available Core configurations
>##########
{{range (coll.Keys (datasource "mapping").configurations.core)}}># - "{{.}}"{{"\n"}}{{ end -}}
>
{{range split (file.Read ".github/configs/mr-test-example.yaml") "\n"}}>{{.}}{{"\n"}}{{ end -}}
>```
39 changes: 36 additions & 3 deletions .github/templates/model_regression_test_config_to_json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
The template reads an issue/a PR comment and transforms a YAML code block into JSON.

*/ -}}
{{ define "check_config_type" -}}
{{- if has (datasource "mapping").configurations.nlu . -}}
nlu
{{- else if has (datasource "mapping").configurations.core . -}}
core
{{- end -}}
{{- end -}}
{{- $config := ((datasource "github").body | regexp.Find "```(?s)(.*)```" | regexp.ReplaceLiteral "```.*|\r" "" | yaml | toJSON | json) -}}
{{- $dataset_branch := "main" -}}
{{- /* if a branch name for dataset repository is not defined use the main branch */ -}}
Expand All @@ -16,18 +23,44 @@ The template reads an issue/a PR comment and transforms a YAML code block into J
{{- /* use all available datasets if value is equal to all */ -}}
{{- if eq (index $pair.dataset 0) "all" -}}
{{ $dataset = (coll.Keys (datasource "mapping").datasets) }}
{{- else if eq (index $pair.dataset 0) "all-core" -}}
{{- range $dataset_name, $dataset_spec := (datasource "mapping").datasets -}}
{{- if has $dataset_spec "domain" -}}
{{ $dataset = (coll.Append $dataset_name $dataset) -}}
{{- end -}}
{{- end -}}
{{- else if eq (index $pair.dataset 0) "all-nlu" -}}
{{- range $dataset_name, $dataset_spec := (datasource "mapping").datasets -}}
{{- if not (has $dataset_spec "domain") -}}
{{ $dataset = (coll.Append $dataset_name $dataset) -}}
{{- end -}}
{{- end -}}
{{- else -}}
{{- $dataset = $pair.dataset -}}
{{- end -}}
{{- range $index_dataset, $value_dataset := $dataset -}}
{{- range $index_config, $value_config := $pair.config -}}
{{- /* use all available configurations if value is equal to all */ -}}
{{- if eq $value_config "all" -}}
{{- range $config_name, $config_file := (datasource "mapping").configurations -}}
{{ $inc = (coll.Append (dict "dataset_branch" $dataset_branch "dataset" $value_dataset "config" $config_name | toJSON) $inc) -}}
{{- range $config_type := (coll.Keys (datasource "mapping").configurations) -}}
{{- range $config_name, $config_file := (index (datasource "mapping").configurations $config_type ) -}}
{{ $inc = (coll.Append (dict "dataset_branch" $dataset_branch "dataset" $value_dataset "config" $config_name "type" $config_type | toJSON) $inc) -}}
{{- end -}}
{{- end -}}
{{- else if eq $value_config "all-core" -}}
{{- range $config_name, $config_file := (datasource "mapping").configurations.core -}}
{{ $inc = (coll.Append (dict "dataset_branch" $dataset_branch "dataset" $value_dataset "config" $config_name "type" "core" | toJSON) $inc) -}}
{{- end -}}
{{- else if eq $value_config "all-nlu" -}}
{{- range $config_name, $config_file := (datasource "mapping").configurations.nlu -}}
{{ $inc = (coll.Append (dict "dataset_branch" $dataset_branch "dataset" $value_dataset "config" $config_name "type" "nlu" | toJSON) $inc) -}}
{{- end -}}
{{- else -}}
{{ $inc = (coll.Append (dict "dataset_branch" $dataset_branch "dataset" $value_dataset "config" $value_config | toJSON) $inc) -}}
{{- if has (datasource "mapping").configurations.nlu $value_config -}}
{{ $inc = (coll.Append (dict "dataset_branch" $dataset_branch "dataset" $value_dataset "config" $value_config "type" "nlu" | toJSON) $inc) -}}
{{- else if has (datasource "mapping").configurations.core $value_config -}}
{{ $inc = (coll.Append (dict "dataset_branch" $dataset_branch "dataset" $value_dataset "config" $value_config "type" "core" | toJSON) $inc) -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
Expand Down
Loading