Skip to content

Commit

Permalink
docs publishing CI Action for 3 6 x micro releases (#12716)
Browse files Browse the repository at this point in the history
* add debug log to GH Action

* add deprecation notice

* build docs on latest minor

* cleanup

* fix the script tests

* lint changes
  • Loading branch information
vcidst committed Aug 15, 2023
1 parent 210d7ef commit 2c2d712
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 24 deletions.
2 changes: 1 addition & 1 deletion docs/docs/markers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This feature is currently experimental and might change or be removed in the fut

:::

:::danger
:::danger Deprecated

In the upcoming release version 3.7 of Rasa Open Source, we鈥檙e removing this experimental feature. For documentation on the markers feature in Rasa Pro, please [click here](./monitoring/analytics/realtime-markers.mdx)

Expand Down
26 changes: 9 additions & 17 deletions scripts/evaluate_release_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,34 +38,26 @@ def git_plain_tag_versions(versions: List[Version]) -> List[Version]:
"""Return non-alpha/rc existing tags"""
return [version for version in versions if is_plain_version(version)]


def filter_non_alpha_releases(tags: List[Version]) -> List[Version]:
return [tag for tag in tags if tag.is_alpha is False]
def filter_ga_relases(tags: List[Version]) -> List[Version]:
"""Return all general availability (GA) releases"""
return [tag for tag in tags if tag.is_alpha is False and tag.is_beta is False and tag.is_release_candidate is False]


def should_build_docs(tag: Version) -> bool:
"""Docs should be built only for the latest GA release tags"""
existing_tags = git_existing_tag_versions()

non_alpha_releases = filter_non_alpha_releases(existing_tags)
non_alpha_releases.sort()
latest_version = non_alpha_releases[-1]
print(f"The latest non-alpha/rc/nightly tag is {latest_version}.")

previous_major = latest_version.major - 1
previous_major_versions = [tag for tag in non_alpha_releases if tag.major == previous_major]
previous_major_latest_version = previous_major_versions[-1]
print(f"The latest tag on the previous major is {previous_major_latest_version}.")

ga_releases = filter_ga_relases(existing_tags)
ga_releases.sort()
latest_version = ga_releases[-1]
print(f"The latest General Availability release tag is {latest_version}.")
need_to_build_docs = False

if not is_plain_version(tag):
print(f"Tag {tag} is an alpha, rc, nightly, or otherwise non-standard version.")
print(f"Tag {tag} is an alpha, beta, rc, nightly, or otherwise non-standard version.")
elif tag >= latest_version:
print(f"Tag {tag} is the latest version. Docs should be built.")
need_to_build_docs = True
elif tag.major == previous_major and tag > previous_major_latest_version:
print(f"Tag {tag} is higher than the latest version for the previous major. Docs should be built.")
need_to_build_docs = True

return need_to_build_docs

Expand Down
28 changes: 22 additions & 6 deletions tests/scripts/test_evaluate_release_tag.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from scripts.evaluate_release_tag import filter_non_alpha_releases, should_build_docs
from scripts.evaluate_release_tag import filter_ga_relases, should_build_docs
import pytest
from pep440_version_utils import Version
from typing import List
Expand All @@ -17,13 +17,19 @@
[Version("1.1.0"), Version("2.2.0")],
),
(
[Version("1.1.0"), Version("2.2.0"), Version("1.1.1a1")],
[
Version("1.1.0"),
Version("2.2.0"),
Version("1.1.1a1"),
Version("1.1.1b1"),
Version("1.1.1rc1"),
],
[Version("1.1.0"), Version("2.2.0")],
),
],
)
def test_filter_non_alpha_releases(releases: List[Version], expected: List[Version]):
result = filter_non_alpha_releases(releases)
def test_filter_ga_releases(releases: List[Version], expected: List[Version]):
result = filter_ga_relases(releases)
assert result == expected


Expand All @@ -40,15 +46,25 @@ def test_filter_non_alpha_releases(releases: List[Version], expected: List[Versi
Version("2.2.1"),
True,
),
(
[
Version("1.1.0"),
Version("2.2.0"),
Version("2.3.0b1"),
Version("2.4.0a1"),
],
Version("2.2.1"),
True,
),
(
[Version("1.1.0"), Version("2.2.0"), Version("2.3.0")],
Version("1.2.0"),
True,
False,
),
(
[Version("1.1.0"), Version("1.2.0a1"), Version("2.3.0")],
Version("1.1.2"),
True,
False,
),
(
[Version("1.1.0"), Version("2.2.0"), Version("2.3.0")],
Expand Down

0 comments on commit 2c2d712

Please sign in to comment.