Support for air-gapped envs for backup sources#125
Conversation
|
I think a bit of context is needed in the description of the PR and a test with an example os usage will be nice as well if possible (maybe it is difficult to mock). Otherwise, an example for documentation |
Co-authored-by: Uilian Ries <uilianries@gmail.com>
memsharded
left a comment
There was a problem hiding this comment.
I think I was reading this wrong. This is intended to be done after the user has manually downloaded and verified the file checksum, isn't it?
Otherwise, do we want to provide the possibility to download it too from a URL?
Though maybe if we want this, it would be 2 commands:
- 1 command download + verify checksum (this wouldn't be necessary for Linux/OSX users, though Windows bare users might benefit? Probably not worth
- 1 command for upload
| json.dump({"references": {args.reference: [args.url] if args.url else []}, | ||
| "timestamp": timestamp_now()}, f) | ||
|
|
||
| conan_api.upload.upload_backup_sources([new_path, json_path]) |
There was a problem hiding this comment.
This will silently return if url = config.get("core.sources:upload_url", check_type=str) is not defined. Most likely we want to check this and error?
| This command will upload the backup sources of a package to the server. | ||
| """ | ||
| parser.add_argument("reference", help="Reference of the package to backup") | ||
| parser.add_argument("path", help="Path to source files for this reference") |
There was a problem hiding this comment.
Provide the possibility to download it too from a URL?
| if not os.path.isfile(args.path): | ||
| raise ConanException(f"File not found: {args.path}") | ||
|
|
||
| with open(args.path, "rb") as f: |
There was a problem hiding this comment.
I'd say to include the checksum input and verification as well? Not just read the local one, could be tampered?
No description provided.