Skip to content

Build perf: publish broker libraries directly to NewAndroid + decouple common4j sources/javadoc from assemble#3113

Open
fadidurah wants to merge 3 commits into
devfrom
fadi/publish-libraries-to-newandroid-feed
Open

Build perf: publish broker libraries directly to NewAndroid + decouple common4j sources/javadoc from assemble#3113
fadidurah wants to merge 3 commits into
devfrom
fadi/publish-libraries-to-newandroid-feed

Conversation

@fadidurah
Copy link
Copy Markdown
Contributor

@fadidurah fadidurah commented May 14, 2026

Why

Two things are slowing our broker library builds:

  1. Feed routing — we publish to AndroidADAL but consume from NewAndroid. NewAndroid has AndroidADAL as a deeper upstream, so any cross-build dep resolves through the full upstream chain.
  2. Per-build overhead in common4j — common4j is the first build in our pipeline (no internal lib deps) yet still takes ~52 min. Investigation showed assemble.dependsOn sourcesJar, javadocJar makes us generate javadoc on every CI flow (compile / test / spotbugs / etc.), even though publish already produces them through maven-publish.

What

Feed flip (publish → NewAndroid directly) — 7 build.gradle files:

  • common/build.gradle
  • common4j/build.gradle
  • keyvault/build.gradle
  • labapi/build.gradle
  • LabApiUtilities/build.gradle
  • testutils/build.gradle
  • uiautomationutilities/build.gradle

common4j perf — drop assemble.dependsOn sourcesJar, javadocJar. These tasks are already wired into the publish graph through components.java + maven-publish, so they still run when we publish. They just no longer run on every other CI flow. Local devs can still run ./gradlew sourcesJar javadocJar explicitly.

Companion changes

  • 1ES-Pipelines (ADO PR #23991): updates pipeline references for the feed flip, adds Cache@2 for Gradle caches + Robolectric SDKs, pipes --build-cache --parallel, combines Spotbugs + Publish into a single Gradle invocation.
  • broker (PR Shoatman buildconfig #172) and msal (PR Adjustments to teams app ui handling #2512): equivalent feed-flip changes for their build.gradles.
  • AndroidADAL → NewAndroid upstream relationship: will be configured manually in ADO Artifacts after merge.

Switches Maven publishing from the AndroidADAL feed to the NewAndroid feed
to eliminate the upstream-feed traversal latency that occurs when downstream
pipeline stages resolve freshly-published artifacts.

Background:
- Builds publish to AndroidADAL but consumers fetch from NewAndroid.
- NewAndroid resolves AndroidADAL only via its upstream chain, after walking
  Maven Central, Google, etc., causing first-fetch latency on every newly
  published version (which CI agents always pay due to ephemeral caches).
- AndroidADAL will be added as an upstream of NewAndroid (done outside this
  change) so any external consumers still resolving from AndroidADAL keep
  working transparently.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 14, 2026 07:04
@fadidurah fadidurah requested a review from a team as a code owner May 14, 2026 07:04
@github-actions
Copy link
Copy Markdown

❌ Work item link check failed. Description does not contain AB#{ID}.

Click here to Learn more.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR switches module Maven publishing targets from the AndroidADAL feed to the NewAndroid feed so downstream CI resolves newly published artifacts directly from the feed it consumes.

Changes:

  • Updates publishing repository URLs for Common Android/Auth support libraries to NewAndroid.
  • Leaves credentials, artifact coordinates, and existing secondary publishing repositories unchanged.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
uiautomationutilities/build.gradle Publishes UI automation utilities to NewAndroid.
testutils/build.gradle Publishes test utilities to NewAndroid.
LabApiUtilities/build.gradle Publishes lab API utilities to NewAndroid.
labapi/build.gradle Publishes lab API client library to NewAndroid.
keyvault/build.gradle Publishes keyvault library to NewAndroid.
common4j/build.gradle Publishes Common Java library to NewAndroid.
common/build.gradle Publishes Common Android artifacts to NewAndroid.

Comment thread common/build.gradle
These tasks are already wired into the publish graph through
components.java + the maven-publish plugin, so they will be
generated automatically when publish runs.

Tying them to assemble made every CI flow that just compiles or
runs tests also build javadoc, which is one of the slowest tasks
in the common4j build. Local developers who want the artifacts
can still run ./gradlew sourcesJar javadocJar explicitly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@fadidurah fadidurah changed the title Build: publish libraries directly to NewAndroid feed Build perf: publish broker libraries directly to NewAndroid + decouple common4j sources/javadoc from assemble May 14, 2026
When configure-on-demand is enabled, Gradle only configures the projects
that are actually in the dependency graph of the requested tasks. Previously
building AADAuthenticator triggered configure of broker4j, brokerHost,
java-linux-test-app, LinuxBroker, brokerautomationapp etc. — none of
which are needed for AADAuthenticator:assembleDistRelease. Logs showed
~16 min spent in unnecessary configure phases.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

2 participants