-
Notifications
You must be signed in to change notification settings - Fork 17
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
Configuration migrations #176
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely structured, LGTM
dir_path = os.path.join(config_dir, dir_name) | ||
|
||
Path(dir_path).mkdir(parents=True, exist_ok=True) | ||
|
||
file_path = os.path.join(dir_path, repo.package_config_path) | ||
with open(file_path, "w") as config_file: | ||
config_file.write(repo.package_config) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dir_path = os.path.join(config_dir, dir_name) | |
Path(dir_path).mkdir(parents=True, exist_ok=True) | |
file_path = os.path.join(dir_path, repo.package_config_path) | |
with open(file_path, "w") as config_file: | |
config_file.write(repo.package_config) | |
dir_path = repo_store_path / dir_name | |
dir_path.mkdir(parents=True, exist_ok=True) | |
file_path = dir_path / repo.package_config_path | |
file_path.write_text(repo.package_config) |
url_file = os.path.join(directory, URL_FILE_NAME) | ||
if not os.path.isfile(url_file): | ||
return None | ||
|
||
with open(url_file) as file: | ||
url = file.read() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
url_file = os.path.join(directory, URL_FILE_NAME) | |
if not os.path.isfile(url_file): | |
return None | |
with open(url_file) as file: | |
url = file.read() | |
url_file = directory / URL_FILE_NAME | |
if not url_file.is_file(): | |
return None | |
url = url_file.read_text() |
The script provides 3 commands (see particular command's --help for more info): 1. download-configs - to download the configs of the repos that used Packit Service in the past year 2. list-affected - to list the projects affected by particular migration 3. migrate - to update the config and create PR Related to packit#159 Related to packit/packit-service#1775
108b16f
to
17b03b8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is really impressive
would be amazing to move all the code in a dedicated project: I have a sense we'll use it more in the future :)
@TomasTomecek yes, agreed, I will move it to a new dedicated repo; so now the harder part, what should be the name 😀 :
|
I think this makes sense. |
The content of this PR was moved to the new repo, therefore closing. |
See commit messages and help of the commands for more info
TODO: