Skip to content

Commit

Permalink
AUTO docusaurus 20230721
Browse files Browse the repository at this point in the history
  • Loading branch information
GitHub CI committed Jul 21, 2023
1 parent ddf9125 commit 7181240
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 9 deletions.
34 changes: 27 additions & 7 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 @@ -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 }}"

2 changes: 1 addition & 1 deletion docs/docs/sources/rasa_interactive___help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ options:
--conversation-id CONVERSATION_ID
Specify the id of the conversation the messages are
in. Defaults to a UUID that will be randomly
generated. (default: 483d2707f2e644bbad6f3797c8fd568d)
generated. (default: 0cd6d9eaff4349da8ec7ce2eaad8baba)
--endpoints ENDPOINTS
Configuration file for the model server and the
connectors as a yml file. (default: endpoints.yml)
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/sources/rasa_shell___help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ options:
-h, --help show this help message and exit
--conversation-id CONVERSATION_ID
Set the conversation ID. (default:
1353d21a9c5a47fb8637400246fe3a21)
dd5f96c67e5445f5be2dc42ac8b666b6)
-m MODEL, --model MODEL
Path to a trained Rasa model. If a directory is
specified, it will use the latest model in this
Expand Down
38 changes: 38 additions & 0 deletions scripts/get_version_from_toml.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import os
from pathlib import Path
import sys
import toml


PYPROJECT_FILE_PATH = "pyproject.toml"


def project_root() -> Path:
"""Root directory of the project."""
return Path(os.path.dirname(__file__)).parent


def pyproject_file_path() -> Path:
"""Path to the pyproject.toml."""
return project_root() / PYPROJECT_FILE_PATH


def get_rasa_version_from_pyproject(pyproject_file=None) -> str:
"""Fetch rasa version from pyproject."""
if pyproject_file is None:
pyproject_file = pyproject_file_path()

try:
data = toml.load(pyproject_file)
rasa_oss_version = data["tool"]["poetry"]["version"]
return rasa_oss_version
except (FileNotFoundError, TypeError):
print(f"Unable to fetch from {pyproject_file}: file not found.")
sys.exit(1)
except toml.TomlDecodeError:
print(f"Unable to parse {pyproject_file}: incorrect TOML file.")
sys.exit(1)


if __name__ == "__main__":
print(get_rasa_version_from_pyproject())
23 changes: 23 additions & 0 deletions tests/scripts/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[build-system]
requires = [ "poetry-core>=1.0.4",]
build-backend = "poetry.core.masonry.api"

[tool.black]
line-length = 88
target-version = [ "py37", "py38", "py39", "py310",]
exclude = "((.eggs | .git | .pytest_cache | build | dist))"

[tool.poetry]
name = "rasa"
version = "3.7.1rc1"
description = "Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants"
authors = [ "Rasa Technologies GmbH <hi@rasa.com>",]
maintainers = [ "Tom Bocklisch <tom@rasa.com>",]
homepage = "https://rasa.com"
repository = "https://github.com/rasahq/rasa"
documentation = "https://rasa.com/docs"
classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Topic :: Software Development :: Libraries",]
keywords = [ "nlp", "machine-learning", "machine-learning-library", "bot", "bots", "botkit", "rasa conversational-agents", "conversational-ai", "chatbot", "chatbot-framework", "bot-framework",]
include = [ "LICENSE.txt", "README.md", "rasa/shared/core/training_data/visualization.html", "rasa/cli/default_config.yml", "rasa/shared/importers/*", "rasa/utils/schemas/*", "rasa/keys",]
readme = "README.md"
license = "Apache-2.0"
9 changes: 9 additions & 0 deletions tests/scripts/test_get_version_from_toml.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from scripts.get_version_from_toml import get_rasa_version_from_pyproject
import os


def test_version_from_toml():
pyproject_file_path = os.path.dirname(__file__) + "/test.toml"
expected = "3.7.1rc1"
version = get_rasa_version_from_pyproject(pyproject_file=pyproject_file_path)
assert version == expected

0 comments on commit 7181240

Please sign in to comment.