Skip to content

Build scripts: run checks only when commit changes files with certain type #423

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

Closed
php-coder opened this issue Jul 29, 2016 · 4 comments
Closed
Assignees
Milestone

Comments

@php-coder
Copy link
Owner

php-coder commented Jul 29, 2016

Most of our checks are checking only files with a certain type. We'll have a benefit if we run them only when user modified files with certain types.

Examples:

  • sortpom checks only pom.xml
  • bootlint checks only *.html files
  • html5validator checks only *.html files
  • jasmine needs to be run only when we changed *.js
  • license plugin checks only *.java and *.groovy files
  • probably we need to run enforcer only when pom.xml has changed
  • codenarc should run only for *.groovy files
  • checkstyle/pmd should be run only for *.java (and maybe *.properties) files
  • we need to check Ansible playbooks only when they were modified (Build scripts: add syntax checking for Ansible playbooks #422)
@php-coder
Copy link
Owner Author

If only tests on Groovy were modified then only unit tests and CodeNarc checking should be performed.

@php-coder php-coder added this to the 0.5 milestone May 17, 2017
@php-coder
Copy link
Owner Author

  • the checks that are performed by the maven plugins also should be run when pom.xml has been modified to catch the changes in the plugin version/configuration
  • the checks that are performed by the maven plugins and that use external configuration also should be run when configuration files have been modified to catch the changes in the plugin configuration
  • the tools that are installed manually from .travis.yml also should be run when .travis.yml has been changed to catch the possible changes in their versions/configuration

@php-coder php-coder modified the milestones: 0.4, 0.5 Jul 21, 2017
@php-coder php-coder self-assigned this Jul 21, 2017
@php-coder
Copy link
Owner Author

I'm going to merge my implementation. Here are some details:

  • unit and integration tests run always, regardless what files were modified. There are too many possible factors that can affect application behavior and and I decided to solve only the trivial cases for a now.
  • there is no way to disable skipping logic and if you need to run specific check there is no way to force that. I was thinking about introducing environment variable or using a special magic comment from the commit message but decided to leave it as-is for a now (although it can be added later).

@php-coder
Copy link
Owner Author

php-coder commented Jul 21, 2017

unit and integration tests run always

Actually, we can run unit tests only when one of these were modified: pom.xml, java or groovy files.

Anyway, unit test will be run again during publishing code coverage (see #391).

bodom91 pushed a commit to bodom91/mystamps that referenced this issue Aug 2, 2017
…t modified.

Now the checks will be run only when the files with the following patterns were modified:

- sortpom:    pom.xml
- enforcer:   pom.xml
- checkstyle: pom.xml, *.java, *.properties, checkstyle.xml, checkstyle-suppressions.xml
- findbugs:   pom.xml, *.java, findbugs-filter.xml
- pmd:        pom.xml, *.java, pmd.xml
- unit tests: pom.xml, *.java, *.groovy
- license:    pom.xml, *.java, *.groovy, license_header.txt
- codenarc:   pom.xml, *.groovy
- jasmine:    pom.xml, *.js
- rflint:    .travis.yml, *.robot
- bootlint:  .travis.yml *.html
- html5validator: .travis.yml *.html

Integration tests are executed always.

Fix php-coder#423
bodom91 pushed a commit to bodom91/mystamps that referenced this issue Aug 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant