Skip to content
This repository was archived by the owner on Aug 20, 2025. It is now read-only.

Conversation

@justinleet
Copy link
Contributor

@justinleet justinleet commented Nov 20, 2019

Contributor Comments

Discovered in #1554

Travis should work the same as local now. Couple changes happened

  • Readded JUnit dep, since it does occur as part of metron-integration-test
  • Run a build step before verify is called
  • Adjusted the npm scripts to not fail if we provide -Dskip.npm. This ensures that all the modules are built for the verify, but we don't bother with anything related to npm.
  • Adjusted the build scripts to properly relay issues if maven fails. We could probably add various quiet options to maven if we want.

Pull Request Checklist

Thank you for submitting a contribution to Apache Metron.
Please refer to our Development Guidelines for the complete guide to follow for contributions.
Please refer also to our Build Verification Guidelines for complete smoke testing guides.

In order to streamline the review of the contribution we ask you follow these guidelines and ask you to double check the following:

For all changes:

  • Is there a JIRA ticket associated with this PR? If not one needs to be created at Metron Jira.
  • Does your PR title start with METRON-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
  • Has your PR been rebased against the latest commit within the target branch (typically master)?

For code changes:

  • Have you included steps to reproduce the behavior or problem that is being changed or addressed?

  • Have you included steps or a guide to how the change may be verified and tested manually?

  • Have you ensured that the full suite of tests and checks have been executed in the root metron folder via:

    mvn -q clean integration-test install && dev-utilities/build-utils/verify_licenses.sh 
    
  • Have you written or updated unit tests and or integration tests to verify your changes?

  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?

  • Have you verified the basic functionality of the build by building and running locally with Vagrant full-dev environment or the equivalent?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered by building and verifying the site-book? If not then run the following commands and the verify changes via site-book/target/site/index.html:

    cd site-book
    mvn site
    
  • Have you ensured that any documentation diagrams have been updated, along with their source files, using draw.io? See Metron Development Guidelines for instructions.

Note:

Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.
It is also recommended that travis-ci is set up for your personal repository such that your branches are built there before submitting a pull request.

@justinleet justinleet mentioned this pull request Nov 20, 2019
11 tasks
@justinleet
Copy link
Contributor Author

@nickwallen Check out the ticket itself, I explain a bit more exactly what's happening there, re: why build.

https://jira.apache.org/jira/browse/METRON-2324

@ottobackwards
Copy link
Contributor

Can't we just run it as part of the root pom? Like the last module in the list or something? And forget about the if's and but's?

Copy link
Contributor Author

@justinleet justinleet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ottobackwards I'm not sure there's any easy way to enforce that it would run last. Other than creating a module and making it depend on every other module or something odd like that. There's not a post-install phase or anything we could easily hook into, it's just deploy afterwards. I'm inclined to just go with Nick's idea of just running maven in the script. Having said that, I do like the idea of having it hook in like that in general a lot, I just don't know a clean way to do it off the top of my head.

@justinleet
Copy link
Contributor Author

I moved over to skip.npm in the Travis builds. I haven't run that locally, I'm just letting Travis do it.

I also added the build step @nickwallen suggested to the file directly. If we have another way to do it, I'm open to options. As noted above, I like the idea of getting it done in the pom, but I'm not sure how to do it cleanly.

@ottobackwards
Copy link
Contributor

@justinleet
Copy link
Contributor Author

I believe package is insufficient, it needs to be install, because the deps are pulled from the local repo when another module is depended on for dependency:list.

Even then the issue is still that the parent module actually runs first in our case (and this is not a directly controllable or guaranteed thing to the best of my knowledge; it's entirely reactor's call). This means that verify would essentially be immediately called and fail because the build hasn't been done.

nickwallen pushed a commit to nickwallen/metron that referenced this pull request Dec 6, 2019
…operly handle maven failures (justinleet via nickwallen) closes apache#1568
@nickwallen
Copy link
Contributor

All the changes are looking good. I am just seeing one issue with the validation. I took this branch and removed the junit addition to dependencies_with_url.csv. I would expect validation to fail in this case.

Unfortunately, when running in Travis CI the job does not fail.

When running locally everything builds correctly and I see an error message, but the return code is still 0, when it should probably be non-zero.

$ time ./dev-utilities/build-utils/verify_licenses.sh
...
Determining dependencies
Traceback (most recent call last):
  File "dev-utilities/build-utils/verify_license.py", line 44, in <module>
    raise ValueError("Unable to find these components: \n  " + "\n  ".join(components_not_found) + "\nin the acceptable list of components: " + sys.argv[1])
ValueError: Unable to find these components:
  junit:junit:jar:4.12:compile
in the acceptable list of components: ./dependencies_with_url.csv
Finished validating dependencies.

real	2m29.260s
user	9m8.852s
sys	0m32.922s

$ echo $?
0

@justinleet
Copy link
Contributor Author

@nickwallen Should be fixed with a proper exit code in the main script and a more useful message.

https://travis-ci.org/justinleet/metron/builds/621750687 succeeds.

https://travis-ci.org/justinleet/metron/jobs/621751002 fails (off a branch that is missing the JUnit dep. It doesn't have the changed message commit, but I tested that locally afterwards).

@nickwallen
Copy link
Contributor

+1 Thanks @justinleet

@justinleet
Copy link
Contributor Author

@ottobackwards Are you okay with this approach, or should we keep looking for an alternative?

@ottobackwards
Copy link
Contributor

No, I am fine with any improvement.

@ottobackwards ottobackwards self-requested a review December 6, 2019 20:56
@asfgit asfgit closed this in 83effe4 Dec 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants