Skip to content
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

MINOR: Capture build scans on ge.apache.org to benefit from deep build insights #13676

Merged
merged 4 commits into from
Jul 12, 2023

Conversation

clayburn
Copy link
Contributor

@clayburn clayburn commented May 4, 2023

This PR publishes a build scan for every CI build on Jenkins and GitHub Actions and for every local build from an authenticated Apache committer. The build will not fail if publishing fails.

The build scans of the Apache Kafka project are published to the Gradle Enterprise instance at ge.apache.org, hosted by the Apache Software Foundation and run in partnership between the ASF and Gradle. This Gradle Enterprise instance has all features and extensions enabled and is freely available for use by the Apache Kafka project and all other Apache projects.

This pull request enhances the functionality of publishing build scans to the publicly available scans.gradle.com by instead publishing build scans to ge.apache.org. On this Gradle Enterprise instance, Apache Kafka will have access not only to all of the published build scans but other aggregate data features such as:

  • Dashboards to view all historical build scans, along with performance trends over time
  • Build failure analytics for enhanced investigation and diagnosis of build failures
  • Test failure analytics to better understand trends and causes around slow, failing, and flaky tests

If interested in exploring a fully populated Gradle Enterprise instance, please explore the builds already connected to ge.apache.org, the Spring project’s instance, or any number of other OSS projects for which we sponsor instances of Gradle Enterprise.

Please let me know if there are any questions about the value of Gradle Enterprise or the changes in this pull request and I’d be happy to address them.

Committer Checklist (excluded from commit message)

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

@@ -39,7 +39,6 @@ plugins {
id "io.swagger.core.v3.swagger-gradle-plugin" version "2.2.8"

id "com.github.spotbugs" version '5.0.13' apply false
id 'org.gradle.test-retry' version '1.5.2' apply false
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The test-retry plugin is bundled with the Gradle Enterprise plugin.

Copy link
Contributor

Choose a reason for hiding this comment

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

@clayburn is apache Kafka using Gradle entreprise ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's what this PR proposes, publishing build scans to the Gradle Enterprise instance at https://ge.apache.org. You can see the configuration in the settings.gradle portion of the PR.

Because the Gradle Enterprise Gradle Plugin bundles in the test-retry plugin, it is necessary to remove these lines. Otherwise test-retry will be loaded twice and fail. The retry functionality remains the same.

Copy link
Contributor

Choose a reason for hiding this comment

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

What's the license for the gradle enterprise plugin?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question, usage of the Gradle Enterprise Gradle Plugin is covered by a license agreement between Gradle and the ASF.

Copy link
Contributor

@divijvaidya divijvaidya left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution.

It would be super helpful (perhaps outside of this PR) if you could add a section in our documentation [1] on how to monitor the result of the scans. I am asking this because we had a similar question from a new contributor recently in the email list [2] and you sound like an expert in the CI build(s) at Apache :)

[2] https://lists.apache.org/thread/hsclzdpk623c0t473prtnnh5y1ps8p79
[1] https://kafka.apache.org/contributing

settings.gradle Outdated
@@ -13,6 +13,38 @@
// See the License for the specific language governing permissions and
// limitations under the License.

plugins {
id 'com.gradle.enterprise' version '3.13.1'
Copy link
Contributor

Choose a reason for hiding this comment

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

Would these plugins be loaded for local builds as well (I understand that they won't be used based on code below)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, they would be loaded and applied, but they will essentially be a no-op if a build scan will not be published. The Gradle Enterprise Gradle Plugin only monitors the build without affecting the build at all, unless you opt-in to certain features (such as test-retry, for example).

settings.gradle Show resolved Hide resolved
Copy link
Contributor

@divijvaidya divijvaidya left a comment

Choose a reason for hiding this comment

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

Thank you for addressing the comment. The documentation can be taken up outside this PR.

I like this improvement and looking forward to use the new UI to debug our flaky test failures. The infra is hosted by Apache, so I don't see any compliance concerns as well regarding this change.

Here is an example build after this change: https://ge.apache.org/s/6ewlyxy4pt6ii

@clayburn
Copy link
Contributor Author

clayburn commented May 5, 2023

Thank you for the contribution.

It would be super helpful (perhaps outside of this PR) if you could add a section in our documentation [1] on how to monitor the result of the scans. I am asking this because we had a similar question from a new contributor recently in the email list [2] and you sound like an expert in the CI build(s) at Apache :)

I would not classify myself as an expert in Apache CI builds 🙂, but we have quite a bit of experience helping OSS projects with setup and usage of Gradle Enterprise to benefit from the build insights.

I would be happy to contribute the documentation updates in a future PR.

I like this improvement and looking forward to use the new UI to debug our flaky test failures. The infra is hosted by Apache, so I don't see any compliance concerns as well regarding this change.

We've worked quite closely with the infra team on this rollout.

@clayburn
Copy link
Contributor Author

I updated this PR to the latest version of Gradle Enterprise Gradle Plugin. Is there anything else I need to do to get this PR integrated?

@divijvaidya
Copy link
Contributor

The next step here is to get attention of a committer to look into this PR. Usually @ijuma is interested in reviewing build related improvements. Or perhaps @mimaison may be interested to review this.

@divijvaidya divijvaidya requested a review from ijuma May 24, 2023 09:16
@clayburn
Copy link
Contributor Author

The test failures appear to come from these two test cases across the following JDKs:

I'm not familiar with these tests, but I suspect these changes did not introduce these failures.

@divijvaidya
Copy link
Contributor

@ijuma do you have any other questions wrt this PR? This is a useful feature to debug our flaky tests and I would like to ensure that your questions are addressed since you were involved in this review earlier.

@mimaison
Copy link
Member

Thanks, this is a useful improvement. I was not aware the ASF had a GE instance. The changes look good to me.

@ijuma any concerns?

@ijuma
Copy link
Contributor

ijuma commented Jun 20, 2023

As long as there are no restrictions due to this proprietary plugin, I am ok with it. That is, others (including several companies) run these builds too. Is there some official comms from Apache with regards to this?

@mimaison
Copy link
Member

I did a quick search on the wiki and a few MLs and I can't find an official announcement. All I can find are a few ML threads mentioning ge.apache.org, several projects (Beam, Pulsar, Groovy, etc) already using it and a few Jiras about scans in INFRA .

@clayburn
Copy link
Contributor Author

@ijuma - good question. I do not have an answer myself, but I can get in touch with those involved in the agreement between ASF and Gradle and get back to you on that case.

@clayburn
Copy link
Contributor Author

@ijuma Under our Software License and Sponsorship Agreement, Apache's users and contributors may use the Gradle Enterprise instance and run any ASF builds with GE enabled solely in connection with the development of any ASF open source project. This applies even if the users are employed by a third party or making such contributions to an ASF open source project as part of their work as directed by a third party employer.

@clayburn
Copy link
Contributor Author

@ijuma / @mimaison - does my previous answer address your concerns regarding licensing?

@mimaison
Copy link
Member

Thanks for the clarifications @clayburn

@mimaison mimaison merged commit 451fff8 into apache:trunk Jul 12, 2023
@clayburn clayburn deleted the connect-to-ge.apache.org branch July 17, 2023 13:07
jolshan added a commit to confluentinc/kafka that referenced this pull request Jul 18, 2023
@ijuma
Copy link
Contributor

ijuma commented Jul 18, 2023

If I'm reading this right, it seems very restrictive. It's very common for other companies to build AK for their own purposes. If they're not allowed to use gradle enterprise, then it should be disabled by default and enabled via a parameter in the Apache CI build.

Cerchie pushed a commit to Cerchie/kafka that referenced this pull request Jul 25, 2023
…d insights (apache#13676)


Reviewers: Mickael Maison <mickael.maison@gmail.com>, Ismael Juma <ismael@juma.me.uk>, Divij Vaidya <diviv@amazon.com>
honshu added a commit to confluentinc/kafka that referenced this pull request Aug 27, 2023
Fixed the conflict causing the jenkins job failure from AK-> CCS.
Below are the PR which caused the conflict.

In AK
apache#14286
apache#13676

In CCS
#901

For #901 and apache#14286 conflict
I have kept the versioning changes of CCS in files
       settings.gradle
       streams/quickstart/java/pom.xml
       streams/quickstart/java/src/main/resources/archetype-resources/pom.xml
       streams/quickstart/pom.xml
       tests/kafkatest/__init__.py

For apache#13676 i don't an actual conflict except few function added in AK.
so i brought changes from AK
honshu added a commit to confluentinc/kafka that referenced this pull request Aug 27, 2023
Fixed the conflict causing the jenkins job failure from AK-> CCS.
Below are the PR which caused the conflict.

In AK
apache#14286
apache#13676

In CCS
#901

For #901 and apache#14286 conflict
I have kept the versioning changes of CCS in files
       gradle.properties
       settings.gradle
       streams/quickstart/java/pom.xml
       streams/quickstart/java/src/main/resources/archetype-resources/pom.xml
       streams/quickstart/pom.xml
       tests/kafkatest/__init__.py
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.

5 participants