- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 300
 
Log git diff during build #119
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
Conversation
          Codecov Report
 @@            Coverage Diff             @@
##           master     #119      +/-   ##
==========================================
+ Coverage   95.27%   95.37%   +0.10%     
==========================================
  Files          15       15              
  Lines         275      281       +6     
  Branches       58       58              
==========================================
+ Hits          262      268       +6     
  Misses         13       13              
  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice first PR @dogboydog
I think this is a very nice first iteration and I would merge it if it didn't expose new parameters. As the goal for this project is to keep things as simple as possible for everyone and have as much functionality as possible work out of the box, we might need to make some small changes before merging it.
I think we should come to some common sense amount of files or lines of which we'd show the diff and that way prevent having to add another parameter to the workflow.
My suggestion would be to always show the first 20~100 lines of diff across files.
To answer your points:
- Issue git --no-pager diff if logDiffifDirty is specified for a build, whether or not you allow dirty builds.
 
I like it!
- I know "DiffIf" looks a little hard to read. I can refactor it to a different name if you have a better idea.
 
This would be prevented too by the suggestion, but otherwise i'd probably have suggested something like logDifference or logDiff (as the idea was not always log it either way).
- allowDirtyBuild was missing from action.yml. I don't know if this was intentional, but I added it with the information from README.md
 
This was not intentional. Thank you for coding inclusively.
| 
           Thanks. 
 Okay, sure. So when you say across files, do you mean 20-100 lines total? Not that many lines per file? Would this number be configurable (like via an environmental variable) or just a constant? 
 Now that you mention it, the diff would just be blank if the repository were not dirty, so just logDiff would still seem to explain the concept to me and be much easier to read.  | 
    
          
 Yes I meant in total, because we have to weight log pollution vs ease of use. I wouldn't make this number configurable, at least not yet. For your use case this solves the problem and I think it will for most other cases where only 1 or 2 files change too. Making things variable would only make it harder to maintain, so I'd suggest we wait for a valid use case for it.  | 
    
| 
           Cool. My plan is to refactor the option to be "logDiff", and limit it to whatever number of lines you want. 60?  | 
    
          
 I still think we shouldn't expose an extra parameter but just enable this functionality by default.  | 
    
| 
           Oh I see. I misread your first message, sorry. Okay I will do it unconditionally and remove the parameter.  | 
    
| 
           Okay, I have your suggestions working. Diff lines are capped at 60 for now. Let me know what you think. Thanks for the feedback. Beginning of diff: I can move these questions to a different issue if you want, but I was curious about a few things. 
  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect. Thanks you for the nice cleanup!
          
 Yes I think that would be better  | 
    


git --no-pager diffif logDiffifDirty is specified for a build, whether or not you allow dirty builds.Working screenshot:
Side note... any idea why ProjectSettings.asset is being modified during the build? I am using the same Unity version in the branch as I am specifying to the Unity Actions. It seems like the defaults used by unity-builder override the ProjectSettings. I wonder if you should ignore "dirtiness" if the only dirty file is ProjectSettings if that's the case.
Fix #117