doorstop icon indicating copy to clipboard operation
doorstop copied to clipboard

Multiple changes: custom item validator per folder, override settings through a CLI option, and hash reference per file reference

Open lbiaggi opened this issue 1 year ago • 9 comments
trafficstars

Hi @jacebrowning, we have been using doorstop to manage our ISO 26262 requirements, it is part of our core workflow.

We have improved certain areas of the software to match our requirements, and we think it would be useful to share with upstream these changes.

  • Load a file as a python module
  • A new section inside .doorstop.yml to enable them (we called them extension, as we intend to add more features if necessary) - Where we can define a custom validator for the items from a specific folder - If file references from this folder should calculate the SHA-256 for them (During review / validate without -W) - Change the buffer size for when doing the SHA
  • Override doorstop settings from a file through CLI parameter.

We made these changes because we didn't want to override most of the default behaviour from doorstop, and yet we wanted to be able to tweak certain validations for specific items.

lbiaggi avatar Jan 13 '24 10:01 lbiaggi

@lbiaggi I've had a quick look and it looks very useful! I will do a deeper review and some testing as soon as possible.

neerdoc avatar Jan 15 '24 22:01 neerdoc

The changes looks good as far as I can see, and would possibly fix #564.

The only issue I have is that there are no tests included for the added functionality.

Please add relevant test cases for the added functionality.

Ok!

lbiaggi avatar Jan 22 '24 09:01 lbiaggi

Codecov Report

Attention: Patch coverage is 57.14286% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 96.16%. Comparing base (b94019a) to head (70f610d). Report is 2 commits behind head on develop.

Files Patch % Lines
doorstop/core/document.py 57.14% 5 Missing and 1 partial :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #617   +/-   ##
========================================
  Coverage    96.15%   96.16%           
========================================
  Files           41       41           
  Lines         5173     5185   +12     
  Branches      1214     1217    +3     
========================================
+ Hits          4974     4986   +12     
+ Misses         127      126    -1     
- Partials        72       73    +1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Jan 22 '24 13:01 codecov-commenter

Can you re-review @neerdoc? I've inserted tests, updated the sample reqs project and documentation.

lbiaggi avatar Jan 22 '24 16:01 lbiaggi

@neerdoc no worries, I understand.

How can I propose more drastic changes? (I'm looking to improve and expand references type to be more generic and customizable, e.g., to support external links from another repo.) or at least an interface to create custom references.

lbiaggi avatar Jan 25 '24 16:01 lbiaggi

How can I propose more drastic changes? (I'm looking to improve and expand references type to be more generic and customizable, e.g., to support external links from another repo.) or at least an interface to create custom references.

I would suggest that you first read through all open issues to get a good grasp of what other peoples' opinions are regarding where the software is going. Jump in to whatever discussions there already are and voice you suggestions. If you have new ideas, just open an issue on the subject and we will have a discussion about it!

neerdoc avatar Jan 25 '24 17:01 neerdoc

Should I rebase and fix the conflict?

lbiaggi avatar Jan 29 '24 08:01 lbiaggi

Yes please, that would be very helpful!

neerdoc avatar Jan 29 '24 12:01 neerdoc

Done, if a conflict appears, and I did not update the PR, please ping me

lbiaggi avatar Jan 29 '24 15:01 lbiaggi

Friendly ping reminder @jacebrowning

lbiaggi avatar Mar 11 '24 15:03 lbiaggi

@lbiaggi sorry, I haven't had a chance to look at this until now.

I think we should stick to one feature per pull request (and corresponding issue for discussion, if applicable). Since there are three distinct features here, I'd like to see this split up into three separate pull requests that can be reviewed and applied independently.

jacebrowning avatar Mar 11 '24 19:03 jacebrowning

OK, but bear in mind that I rely on the first one to do the other two

Can I signalize they are dependent? (at least from the first)

lbiaggi avatar Mar 12 '24 23:03 lbiaggi

Yeah, you can identify that they are dependent or just open the base pull request first.

jacebrowning avatar Mar 12 '24 23:03 jacebrowning

@jacebrowning done

lbiaggi avatar Mar 14 '24 00:03 lbiaggi

@jacebrowning ping

lbiaggi avatar Mar 20 '24 10:03 lbiaggi

@lbiaggi this pull request still seems to contain multiple features: custom item validation and something about changing the SHA that I don't fully understand. I'd like to see this split into two separate pull requests for further review. Thanks!

jacebrowning avatar Mar 21 '24 00:03 jacebrowning

@lbiaggi this pull request still seems to contain multiple features: custom item validation and something about changing the SHA that I don't fully understand. I'd like to see this split into two separate pull requests for further review. Thanks!

Sorry, IMO they were the same feature because without the SHA, custom validator doesn't seem to be doing something interesting.

I'm not changing the SHA, I'm just calculating the SHA for each file reference...

I will do it now.

lbiaggi avatar Mar 21 '24 02:03 lbiaggi

@jacebrowning done, sorry for misinterpreting what you meant

lbiaggi avatar Mar 21 '24 03:03 lbiaggi