--description="This is a demo project"
"""
- gerrit_project = urllib.parse.quote(gerrit_project, encoding=None, errors=None)
+ gerrit_project = urllib.parse.quote(gerrit_project, safe="", encoding=None, errors=None)
access_str = "projects/?query=name:{}".format(gerrit_project)
result = self.get(access_str)[0]
"""Add a file to the current git repo."""
if filepath.find("/") >= 0:
try:
+ log.debug("Making directories for {}".format(filepath[0]))
os.makedirs(os.path.split(filepath)[0])
except FileExistsError:
- pass
+ log.debug("Directories already exist, skipping")
with open(filepath, "w") as newfile:
newfile.write(content)
self.repo.git.add(filepath)
+ log.debug(self.repo.git.status())
def add_symlink(self, filepath, target):
"""Add a symlink to the current git repo."""
)
log.debug("File contents:\n{}".format(content))
- filepath = os.path.join(self.repo.working_tree_dir, "jjb/{0}/{0}.yaml".format(gerrit_project_dashed))
+ filepath = "jjb/{0}/{0}.yaml".format(gerrit_project_dashed)
self.add_file(filepath, content)
commit_msg = "Chore: Automation adds {}".format(filename)
self.commit(commit_msg, issue_id, push=True)
--- /dev/null
+---
+fixes:
+ - |
+ Correct the file path for the JJB info file job. This was incorrectly set as
+ an absolute path, but it needs to be relative to the git repo root.
+ - |
+ Add the "safe" parameter to URL parsing in create_project. This removes the
+ default safe value which includes the forward slash. In this case, we do
+ want to escape slashes that are part of the repo name.