Improve path resolution#168
Conversation
| return False | ||
|
|
||
|
|
||
| def get_log_file_path(plain_file_path: Optional[str], log_file_name: str) -> Optional[str]: |
There was a problem hiding this comment.
This function is not needed anymore since args.log_file_name is now an absolute path to the file.
| logging.getLogger("transitions").setLevel(logging.ERROR) | ||
| logging.getLogger("transitions.extensions.diagrams").setLevel(logging.ERROR) | ||
|
|
||
| log_file_path = get_log_file_path(plain_file_path, log_file_name) |
There was a problem hiding this comment.
This is not needed anymore since args.log_file_name is now an absolute path to the file.
68f9aec to
869eb78
Compare
pedjaradenkovic
left a comment
There was a problem hiding this comment.
A couple of todos before we proceed:
- Fix the bug when calling the plain_module from different folder
- Since we are changing tests scripts, we would like to move temporary test folders to temp folders if possible. We can discuss with Vitjan if the paths should be filtered out.
869eb78 to
baf55b0
Compare
e197769 to
eb21bb7
Compare
|
This will release important improvements to Codeplain's path resolution system that fix Windows compatibility issues and enhance cross-platform support. These changes affect the test scripts included with Codeplain.
Do I Need to Do Anything?If you're using Codeplain's default test scripts: ✅ No action needed - they're already updated! If you've created custom test scripts based on our templates: 📝 Yes, please update them using our migration guide. The updates are straightforward: For Bash Scripts (.sh):
For PowerShell Scripts (.ps1):
Example UpdateBefore: PYTHON_BUILD_SUBFOLDER=python_$1After: PYTHON_BUILD_SUBFOLDER="/tmp/python_$(basename "$1")"
trap 'rm -rf "$PYTHON_BUILD_SUBFOLDER"' EXITThese are some example diffs that you can use to update your custom test scripts: |
18fa887 to
5dda310
Compare
|
It's also important to know how a client's render would fail in case they upgraded the codeplain tool but didn't update their test scripts. It gets stuck fixing the tests and the tests log files will usually report that the path for the build subfolders is incorrect like: |
pedjaradenkovic
left a comment
There was a problem hiding this comment.
I prepared changes for Incode's repo (we can take a look at them tomorrow together) and left a couple of small comments. Rebase, we can test it and check Incode's changes tomorrow and merge!
There was a problem hiding this comment.
This line is not needed anymore.
There was a problem hiding this comment.
Because you have an eraly return on line 464 https://github.com/Codeplain-ai/codeplain/pull/168/changes#diff-053d4fc90f367f8473ae9173df2ffa4c14be1c87e7906ff24447896959c08928R464
There was a problem hiding this comment.
Ah of course. Thanks.
Now I improved this a little but so that it still handles the case where --status or --version are used with --dry-run or --full-plain.
1523c81 to
fae6686
Compare
fae6686 to
85fc9b1
Compare
This makes change to how we resolve path parameters (e.g.: build_folder, log_file_name, conformance_tests_folder).
The main change to the user is that now the parameter path is resolved based on where the parameter was provided:
config.yaml, CLI argument. If parameter is not provided in either of those, the parameter's default value will be relative to the spec file.
Until now some parameters were relative to the config file even if provided as CLI argument (e.g.:
conformance-tests-script,log-file-name...).