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

Move ogr&specfile first; warn user to wait for builds #370

Merged
merged 3 commits into from
Aug 23, 2022
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
28 changes: 24 additions & 4 deletions scripts/move_stable.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@

NAMESPACE: str = "packit"
REPOSITORIES: List[str] = [
"ogr",
"specfile",
"packit",
"packit-service-fedmsg",
"sandcastle",
"dashboard",
"tokman",
"packit-service",
"hardly",
"ogr",
"specfile",
]
REPOS_FOR_BLOG: List[str] = [
"packit",
Expand Down Expand Up @@ -119,6 +119,8 @@ def move_repository(repository: str, remote: str, repo_store: str) -> None:
get_git_log(path_to_repository, remote, stable_hash, main_hash)
click.echo()

specific_instructions(repository)

new_stable_hash = click.prompt(
f"Enter new hash for {STABLE_BRANCH}", default=main_hash
)
Expand Down Expand Up @@ -289,10 +291,10 @@ def create_blogpost(
# merged this week Monday.
till_week_number = till.isocalendar().week - 1
if since_week_number != till_week_number:
title_text = f"Weeks {since_week_number}{till_week_number}"
title_text = f"Weeks {since_week_number}{till_week_number}"
else:
title_text = f"Week {since_week_number}"
click.echo(f"## {title_text} ({format_date(since)}{format_date(till)})\n")
click.echo(f"## {title_text} ({format_date(since)}{format_date(till)})\n")
for repo in REPOS_FOR_BLOG:
path_to_repository = Path(repo_store, repo).absolute()
git_repo = Repo(path_to_repository)
Expand Down Expand Up @@ -352,5 +354,23 @@ def push_stable_branch(path_to_repository: Path, remote: str, commit_sha: str) -
subprocess.run(["git", "push", remote, STABLE_BRANCH], cwd=path_to_repository)


def specific_instructions(repository: str):
if repository == "packit":
click.echo(
"Please wait for ogr & specfile builds "
"https://copr.fedorainfracloud.org/coprs/packit/packit-stable/builds/ "
"before you proceed (it's not strictly needed, but better)."
)

elif repository == "packit-service":
click.echo(
"packit-service images install ogr/specfile/packit from "
"https://copr.fedorainfracloud.org/coprs/packit/packit-stable/builds/ "
"so make sure the builds are done before you proceed!\n"
"You can also proceed now and rebuild the stable images later in "
"https://github.com/packit/packit-service/actions"
)


if __name__ == "__main__":
cli()