Closed wingyplus closed 3 years ago
Hi @wingyplus!
This has been brought up in the past too. I was avoiding adding this to the lib because it could create a directory anywhere on the system and that might open a plethora of other issues. For example, write permission, possible attacks in CI infrastructure (just guessing here) and so on.
Since it seems this is a very wanted feature perhaps we should just hide it in a very big warning + options. Not 100% sure about things here but generally I'd tend to walk the safest way.
What do you think?
Since it seems this is a very wanted feature perhaps we should just hide it in a very big warning + options. Not 100% sure about things here but generally I'd tend to walk the safest way.
Do you mean we should introduce a new configuration for creating directory and warn them if it's set right? If it's this case, I think it's good to try. :)
Yep! That is what I thought. PRs welcome! If nobody steps up I might focus on this later on.
@victorolinasc I prototype PR here https://github.com/victorolinasc/junit-formatter/pull/44. Feels free to comment.
Sorry for the delay... I'll be looking into it this week. I was thinking about checking if the file already exists... but it is on my todo list :)
Sorry for the delay... I'll be looking into it this week. I was thinking about checking if the file already exists... but it is on my todo list :)
I was thinking that we should cleanup report_dir before making a new one to make sure the report is correct result. What do you think?
I think deleting files is always dangerous... that was the main issue about doing this in the first place =/
Imagine someone configures it badly and ends up deleting _build or deps or something even worse...
You're right. :)
So The only thing I can do with the PR might be check an error against mkdir_p and raise the error if it's not allow to create.
Currently, we need to create a directory specified in report_dir if it doesn't exists. So my proposal is try creating that directory before generating reports.
Thoughts?