Skip to content

Commit

Permalink
[BACKPORT 2.20.3][DEVOPS-3090] build: remove unecessary checks in man…
Browse files Browse the repository at this point in the history
…aged build

Summary:
Original commit: 2e9523c / D34375
Checks are very old checks against master branch, not current release
branch.

Test Plan:
Jenkins: skip
Will test with dev-build-job to go through packaging workflow.

Reviewers: aaruj, jharveysmith

Reviewed By: jharveysmith

Subscribers: devops, yugaware

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D34886
  • Loading branch information
svarnau committed May 9, 2024
1 parent 72ca4dd commit ced9fbe
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions managed/devops/opscli/ybops/release_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,39 +56,6 @@ def fetch_release_manifest(self):

return release_manifest

def check_for_uncommitted_changes(self):
"""This method checks if the git repository isn't dirty.
"""
local_changes = subprocess.check_output(
["git", "diff", "origin/master"]).decode("utf-8").strip()

if not local_changes:
return

ybutils.log_message(logging.ERROR,
"Repository {} appears to have uncommitted changes. "
"The source release will not include your local changes."
.format(self.repository))
if not self.force_yes:
ybutils.confirm_prompt("Continue?")

def check_for_local_commits(self):
"""This method checks if there is local commits which haven't been pushed upstream.
"""
subprocess.call(["git", "fetch", "origin"])
local_commits = subprocess.check_output(
["git", "log", "origin/master..HEAD", "--oneline"]).decode("utf-8")
if not local_commits:
return

ybutils.log_message(logging.ERROR,
"Repository {} appears to have local commits:\n {} "
"This should not be an official release!"
.format(self.repository, local_commits))

if not self.force_yes:
ybutils.confirm_prompt("Continue?")

def create_tarball(self):
"""This method creates a tar file based on the release manifest.
Returns:
Expand Down Expand Up @@ -137,8 +104,6 @@ def generate_release(self):
current_dir = os.getcwd()
try:
os.chdir(self.repository)
self.check_for_uncommitted_changes()
self.check_for_local_commits()
tar_file = self.create_tarball()
ybutils.log_message(logging.INFO, "Release generation succeeded!")
finally:
Expand Down

0 comments on commit ced9fbe

Please sign in to comment.