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

Fix assuming "Feature" answer on CI when generating docs #23640

Merged
Merged
Changes from all commits
Commits
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
16 changes: 14 additions & 2 deletions dev/provider_packages/prepare_provider_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
from functools import lru_cache
from os.path import dirname, relpath
from pathlib import Path
from random import choice
from shutil import copyfile
from typing import Any, Dict, Iterable, List, NamedTuple, Optional, Set, Tuple, Union

Expand Down Expand Up @@ -1138,12 +1139,23 @@ class TypeOfChange(Enum):
SKIP = "s"


def get_type_of_changes() -> TypeOfChange:
def get_type_of_changes(answer: Optional[str]) -> TypeOfChange:
"""
Ask user to specify type of changes (case-insensitive).
:return: Type of change.
"""
given_answer = ""
if answer and answer.lower() in ["yes", "y"]:
# Simulate all possible non-terminal answers
return choice(
[
TypeOfChange.DOCUMENTATION,
TypeOfChange.BUGFIX,
TypeOfChange.FEATURE,
TypeOfChange.BREAKING_CHANGE,
TypeOfChange.SKIP,
]
)
while given_answer not in [*[t.value for t in TypeOfChange], "q"]:
console.print(
"[yellow]Type of change (d)ocumentation, (b)ugfix, (f)eature, (x)breaking "
Expand Down Expand Up @@ -1223,7 +1235,7 @@ def update_release_notes(
console.print()
return False
else:
type_of_change = get_type_of_changes()
type_of_change = get_type_of_changes(answer=answer)
if type_of_change == TypeOfChange.DOCUMENTATION:
if isinstance(latest_change, Change):
mark_latest_changes_as_documentation_only(provider_package_id, latest_change)
Expand Down