Skip to content

KAFKA-7766: Fail fast PR builds#6059

Merged
ijuma merged 5 commits intoapache:trunkfrom
mumrah:KAFKA-7766
Feb 2, 2019
Merged

KAFKA-7766: Fail fast PR builds#6059
ijuma merged 5 commits intoapache:trunkfrom
mumrah:KAFKA-7766

Conversation

@mumrah
Copy link
Copy Markdown
Member

@mumrah mumrah commented Dec 21, 2018

Split the Gradle invocation in the jenkins.sh script into two commands so we can fail fast for validation checks such as compile errors and checkstyle errors.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@mumrah
Copy link
Copy Markdown
Member Author

mumrah commented Dec 21, 2018

Demonstration of new fast feedback: https://builds.apache.org/job/kafka-pr-jdk11-scala2.12/1292/console. The build only ran for 8 minutes instead of 2 hours to report a checkstyle error.

Comment thread jenkins.sh Outdated
@ijuma
Copy link
Copy Markdown
Member

ijuma commented Dec 21, 2018

What problem are we trying to solve, people don't run checkstyle before submitting their PRs?

@mumrah
Copy link
Copy Markdown
Member Author

mumrah commented Dec 21, 2018

@ijuma more or less, yea. I think faster feedback into PRs is generally a useful thing. If you have a silly mistake that trips the checkstyle/findbugs/rat, its better to see that sooner than later.

@ijuma
Copy link
Copy Markdown
Member

ijuma commented Dec 21, 2018

I'm just trying to understand the use case as there may be things we can do to improve the feedback cycle even further. In a sense, if you have to wait for a PR to find out about a checkstyle failure, you sort of lost already. It wastes the time of the reviewer and it's definitely slower than if you had seen it before submitting the change. And running it locally is very fast.

With regards to the --continue flag, I added that because people would often fix one test and then there would be more to fix. It made the review cycle really slow. And since the tests take so long to run, it's harder to encourage people to actually run the whole test suite locally before submitting the changes.

Another option would be to have multiple jobs, one for validation and one for tests.

@mumrah
Copy link
Copy Markdown
Member Author

mumrah commented Dec 21, 2018

I agree developers should run the unit tests and validation checks at a minimum, but that probably isn't always going to happen. Unless we add git hooks requiring certain gradle tasks before sync'ing, it will occasionally get missed. The point of this check/test separation is really just to cover that case and get fast feedback to the developer.

Comment thread jenkins.sh

# Run tests
./gradlew unitTest integrationTest \
--profile --no-daemon --continue -PtestLoggingEvents=started,passed,skipped,failed "$@" \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It seems like the --profile information is printed to a file. How would one see that for a Jenkins build?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@mumrah Can you elaborate on this one? Apart from that, I think we are good to merge.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sure: the --profile flag tells gradle to time all of the tasks in during a build. It breaks it down so you can see how much time is spent during the different task phases. It's quite useful when investigating slow builds. The HTML reports generated by the profiling could be archived by Jenkins and/or published using the HTML publisher plugin (similar to a coverage report or junit results)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you please file a JIRA with details about what we should do in Jenkins to make this useful?

@ijuma ijuma changed the title KAFKA-7766 Fail fast builds KAFKA-7766: Fail fast PR builds Jan 7, 2019
@ijuma
Copy link
Copy Markdown
Member

ijuma commented Jan 7, 2019

There are a couple of ways we could improve this for developers:

  1. Run checkstyle/findBugs automatically during building instead of when tests are executed.
  2. Do the same in IntelliJ (something along the lines of https://medium.com/@jayanga/how-to-configure-checkstyle-and-findbugs-plugins-to-intellij-idea-for-wso2-products-c5f4bbe9673a)

In any case, we don't have to block on those. This PR seems fine, I just had a question.

@ijuma ijuma merged commit 64b2d4f into apache:trunk Feb 2, 2019
jarekr pushed a commit to confluentinc/kafka that referenced this pull request Apr 18, 2019
* AK/trunk:
  fix typo (apache#5150)
  MINOR: Reduce replica.fetch.backoff.ms in ReassignPartitionsClusterTest (apache#5887)
  KAFKA-7766: Fail fast PR builds (apache#6059)
  KAFKA-7798: Expose embedded clientIds (apache#6107)
  KAFKA-7641; Introduce "group.max.size" config to limit group sizes (apache#6163)
  KAFKA-7433; Introduce broker options in TopicCommand to use AdminClient (KIP-377)
  MINOR: Fix some field definitions for ListOffsetReponse (apache#6214)
  KAFKA-7873; Always seek to beginning in KafkaBasedLog (apache#6203)
  KAFKA-7719: Improve fairness in SocketServer processors (KIP-402) (apache#6022)
  MINOR: fix checkstyle suppressions for generated RPC code to work on Windows
  KAFKA-7859: Use automatic RPC generation in LeaveGroups (apache#6188)
  KAFKA-7652: Part II; Add single-point query for SessionStore and use for flushing / getter (apache#6161)
  KAFKA-3522: Add RocksDBTimestampedStore (apache#6149)
  KAFKA-3522: Replace RecordConverter with TimestampedBytesStore (apache#6204)
pengxiaolong pushed a commit to pengxiaolong/kafka that referenced this pull request Jun 14, 2019
Split the Gradle invocation in the jenkins.sh script into two commands so
we can fail fast for validation checks such as compile errors and checkstyle
errors.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Ismael Juma <ismael@juma.me.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants