Skip to content

Commit

Permalink
Remove invalid chars
Browse files Browse the repository at this point in the history
  • Loading branch information
xgouchet committed Feb 25, 2021
1 parent 8d8a27e commit 315008f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions dogfood.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ def github_create_pr(repository: str, branch_name: str, base_name: str, version:
url = "https://api.github.com/repos/DataDog/" + repository + "/pulls"
response = requests.post(url=url, headers=headers, data=data)
if response.status_code == 201:
print("Pull Request created successfully")
print("Pull Request created successfully")
return 0
else:
print("pull request failed " + str(response.status_code) + '\n' + response.text)
print("pull request failed " + str(response.status_code) + '\n' + response.text)
return 1


def generate_target_code(target: str, temp_dir_path: str, version: str):
print("Generating code with version " + version)
print("Generating code with version " + version)
file_path = FILE_PATH[target]
target_file = os.path.join(temp_dir_path, file_path)
prefix = PREFIX[target]
Expand All @@ -80,19 +80,19 @@ def generate_target_code(target: str, temp_dir_path: str, version: str):


def git_clone_repository(repo_name: str, gh_token: str, temp_dir_path: str) -> Tuple[Repo, str]:
print("Cloning repository " + repo_name)
print("Cloning repository " + repo_name)
url = "https://" + gh_token + ":[email protected]/DataDog/" + repo_name
repo = Repo.clone_from(url, temp_dir_path)
base_name = repo.active_branch.name
return repo, base_name


def git_push_changes(repo: Repo, version: str):
print("Committing changes")
print("Committing changes")
repo.git.add(update=True)
repo.index.commit("Update DD SDK to " + version)

print("- Pushing branch")
print("Pushing branch")
origin = repo.remote(name="origin")
repo.git.push("--set-upstream", "--force", origin, repo.head.ref)

Expand All @@ -105,13 +105,13 @@ def update_dependant(version: str, target: str, gh_token: str) -> int:

repo, base_name = git_clone_repository(repo_name, gh_token, temp_dir_path)

print("Creating branch " + branch_name)
print("Creating branch " + branch_name)
repo.git.checkout('HEAD', b=branch_name)

generate_target_code(target, temp_dir_path, version)

if not repo.is_dirty():
print("Nothing to commit, all is in order")
print("Nothing to commit, all is in order-")
return 0

git_push_changes(repo, version)
Expand Down

0 comments on commit 315008f

Please sign in to comment.