-
Notifications
You must be signed in to change notification settings - Fork 275
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
Targets' add_target(s)
methods do not correctly check passed paths
#957
Comments
- Correctly show that repo.get_filepaths_in_directory() returns absolute and not relative paths - Pass absolute path to repo.targets.add_target() to fix exception - Also see theupdateframework#957 Signed-off-by: Lukas Puehringer <[email protected]>
IIUC target files don't get hashed right away, i.e. on
|
A possible disadvantage of this proposal may be that it's harder to debug if the errors come at a seemingly unrelated call site. Path related failures when you add those paths in Is it safe to infer from the issue report that all four of the current behaviour examples should succeed? I'd be happy to have a go at implementing a fix for this. Aside: I've worked on projects in the past where we had to implement an alternative path joining function, due to the |
I agree with your debugging concern, @joshuagl. I am concerned with least surprise. :) To me, and this should answer your other question, none of above cases seems fully surprise-free. Here are some concerns:
|
- Correctly show that repo.get_filepaths_in_directory() returns absolute and not relative paths - Pass absolute path to repo.targets.add_target() to fix exception - Also see #957 Signed-off-by: Lukas Puehringer <[email protected]>
This feels like a sensible approach, that handles @lukpueh's least-surprise concerns above and we can address my debugability concern with appropriate logging. |
For consistency we should adopt whatever behavior we want for
|
Fixed in #1008 |
Description of issue or feature request:
Judging from the docstrings and comments,
add_target
andadd_targets
are expected to update aTargets
object with passed target paths, if they are relative to a targets directory base path (i.e.self._targets_directory
).However, they don't seem to take into account that Python's
os.path.join
ignores all path component arguments prior to a component that looks like an absolute path.Current behavior:
Expected behavior:
Revise intended behavior, update implementation accordingly.
The text was updated successfully, but these errors were encountered: