mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benno Evers <bev...@mesosphere.com>
Subject Re: Review Request 64683: Updated support/mesos-style.py to build the virtualenv less often.
Date Thu, 21 Dec 2017 15:15:22 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/64683/#review194342
-----------------------------------------------------------




support/mesos-style.py
Line 408 (original), 408 (patched)
<https://reviews.apache.org/r/64683/#comment273105>

    The docstring needs to be updated.



support/mesos-style.py
Lines 438 (patched)
<https://reviews.apache.org/r/64683/#comment273104>

    The regex feels a bit obscure, and it can actually crash if the file name contains unbalanced
parenthesis (not that anybody would make commit a file like this, but still :D)
    
    I believe the pythonic way would be more like (in pseudo-code)
    
    ```
    # The virtualenv needs to be rebuilt if we modified a js or a python file and the directory
doesn't exist
    
    if set([js_and_python_files]) & set(basenames):
      return os.path.isdir(os.path.join('support', '.virtualenv'))
    ```
    
    On the other hand, if the source_files variables actually contain regex-like search patterns,
ignore the above comment ;)
    
    In any case, I think the message saying that the virtualenv is being built should be moved
to the place where the virtualenv is actually being built.


- Benno Evers


On Dec. 20, 2017, 4:31 p.m., Armand Grillet wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/64683/
> -----------------------------------------------------------
> 
> (Updated Dec. 20, 2017, 4:31 p.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov, Benno Evers, Kevin Klues, and Till Toenshoff.
> 
> 
> Bugs: MESOS-8217
>     https://issues.apache.org/jira/browse/MESOS-8217
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Instead of just checking if the virtual environment exists, we now
> also check if it is required to lint the modified files or not.
> 
> The virtual environment will thus be built when using the script as
> a git hook only if JavaScript or Python files have been modified.
> 
> 
> Diffs
> -----
> 
>   support/mesos-style.py 315955e3533fce0cbf820fad03b3707049cdffe0 
> 
> 
> Diff: https://reviews.apache.org/r/64683/diff/3/
> 
> 
> Testing
> -------
> 
> Tested the commit hook with multiple combinations and checked that the result was the
one expected:
> 
> 1. Removed support/.virtualenv.
> 2. Updated a .cpp file, commit, the virtualenv is not built.
> 3. Updated a .hpp file and a .md file, commit, the virtualenv is not built.
> 4. Updated a .hpp file, a .md file, and a .py file, commit, the virtualenv is built.
> 5. Removed support/.virtualenv.
> 6. Updated a .cpp file, commit --amend, the virtualenv is built.
> 7. Removed support/.virtualenv.
> 8. Updated a .py file, commit, the virtualenv is built.
> 9. Removed support/.virtualenv.
> 10. Updated a .py file and a .js file, commit, the virtualenv is built.
> 11. Removed support/.virtualenv.
> 12. Updated a .hpp file, a .md file, and a .js file, commit, the virtualenv is built.
> 13. Removed support/.virtualenv.
> 14. Updated a .js file, commit, the virtualenv is built.
> 
> 
> Thanks,
> 
> Armand Grillet
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message