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

Create a new branch from origin #130

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
with:
dockerfiles: ./Dockerfile
image: betka
tags: latest 1 ${{ github.sha }} 0.9.3
tags: latest 1 ${{ github.sha }} 0.9.4

- name: Push betka image to Quay.io
id: push-to-quay
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM quay.io/fedora/fedora:37

ENV NAME=betka-fedora \
RELEASE=0.9.3 \
RELEASE=0.9.4 \
ARCH=x86_64 \
SUMMARY="Syncs changes from upstream repository to downstream" \
DESCRIPTION="Syncs changes from upstream repository to downstream" \
Expand Down
11 changes: 8 additions & 3 deletions betka/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ def prepare_downstream_git(self, project_info: ProjectInfo) -> bool:
self.downstream_dir = Git.clone_repo(
project_info.ssh_url_to_repo, self.betka_tmp_dir.name
)
self.info("Downstream directory %r", self.downstream_dir)
self.info(f"Downstream directory {self.downstream_dir}")
if self.downstream_dir is None:
self.error("!!!! Cloning downstream repo %s FAILED.", self.image)
return False
Expand Down Expand Up @@ -571,7 +571,6 @@ def _copy_cloned_downstream_dir(self):
)

def _get_bot_cfg(self, branch: str) -> bool:
Git.call_git_cmd(f"checkout {branch}", msg="Change downstream branch")
self.debug(f"Config before getting bot-cfg.yaml {self.config}")
self.config = self.gitlab_api.get_bot_cfg_yaml(branch=branch)
self.debug(f"Downstream 'bot-cfg.yml' file {self.config}.")
Expand Down Expand Up @@ -659,9 +658,15 @@ def _sync_valid_branches(self, valid_branches):
if self.is_fork_enabled():
self.downstream_git_branch = branch
self.downstream_git_origin_branch = ""
Git.call_git_cmd(f"checkout {branch}", msg="Change downstream branch")
else:
self.downstream_git_branch = f"betka-{branch}"
self.downstream_git_branch = f"betka-{datetime.now().strftime('%Y%m%d%H%M%S')}{branch}"
self.downstream_git_origin_branch = branch
Git.call_git_cmd(
f"checkout -b {self.downstream_git_branch} {branch}",
msg="Create a new downstream branch"
)

# This loads downstream bot-cfg.yml file
# and update betka's dictionary (self.config).
# We need to have information up to date
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def get_requirements():

setup(
name="betka",
version="0.9.3",
version="0.9.4",
packages=find_packages(exclude=["examples", "tests"]),
url="https://github.com/sclorg/betka",
license="GPLv3+",
Expand Down
Loading