Skip to content

Offline Gradle: local branches.json fallback#142606

Merged
breskeby merged 1 commit intoelastic:mainfrom
breskeby:hachi/issue-28-hachi-when-running-in-gradle-off
Feb 24, 2026
Merged

Offline Gradle: local branches.json fallback#142606
breskeby merged 1 commit intoelastic:mainfrom
breskeby:hachi/issue-28-hachi-when-running-in-gradle-off

Conversation

@breskeby
Copy link
Copy Markdown
Contributor

Fixes #139048.

Summary

  • When Gradle runs with --offline and org.elasticsearch.build.branches-file-location is not explicitly set, fall back to the repo-root branches.json (if present) and log a warning.
  • Add a Gradle functional test covering offline fallback and ensuring non-offline behavior is unchanged.

Test plan

  • ./gradlew :build-tools-internal:check

Made with Cursor

When Gradle runs with --offline and no explicit branches file location is
configured, use the repo-root branches.json if it exists and log a warning.
Add a Gradle functional test that verifies offline fallback and preserves
existing failure behavior otherwise.

Co-authored-by: Cursor <cursoragent@cursor.com>
@breskeby breskeby requested a review from a team as a code owner February 17, 2026 15:36
@breskeby breskeby added >bug :Delivery/Build Build or test infrastructure Team:Delivery Meta label for Delivery team labels Feb 17, 2026
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-delivery (Team:Delivery)

@breskeby
Copy link
Copy Markdown
Contributor Author

Self-review

  • Core change: Offline fallback logic in looks narrowly-scoped and preserves behavior for non-offline runs and explicit overrides.
  • Logging: Warning message is actionable and includes local path + remote URL + override property.
  • Functional coverage: TestKit-based integ test covers the expected matrix (offline+local present => success+warn; offline+missing => fail; non-offline => no fallback).

Follow-ups / nits

  • Unrelated diff? permissions assertion change appears unrelated to branches.json/offline fallback. If it’s not required for this fix, consider dropping it to keep the PR tightly scoped.
  • CI: currently fails with (even though a label appears present). Might need label adjustment or check expectation update.

Self-review by Cursor

@breskeby
Copy link
Copy Markdown
Contributor Author

Self-review (corrected)

(My previous comment lost inline code formatting due to shell quoting; this is the corrected version.)

  • Core change: Offline fallback logic in GlobalBuildInfoPlugin#getDevelopmentBranches() looks narrowly-scoped and preserves behavior for non-offline runs and explicit org.elasticsearch.build.branches-file-location overrides.
  • Logging: Warning message is actionable and includes local path + remote URL + override property.
  • Functional coverage: TestKit-based integ test covers the expected matrix (offline+local present => success+warn; offline+missing => fail; non-offline => no fallback).

Follow-ups / nits

  • Unrelated diff? build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/EmptyDirTaskTests.java permissions assertion change appears unrelated to branches.json/offline fallback. If it’s not required for this fix, consider dropping it to keep the PR tightly scoped.
  • CI: Check labels currently fails with Missing: [version] (even though a v9.4.0 label appears present). Might need label adjustment or check expectation update.

Self-review by Cursor

@breskeby breskeby added v9.4.0 and removed v9.4.0 labels Feb 17, 2026
@breskeby
Copy link
Copy Markdown
Contributor Author

breskeby commented Feb 17, 2026

Self-review

  • Verified the fallback is only active when running with --offline, the branches location property is not explicitly set, and the location is an http/https URL; this matches the requested scope and preserves override behavior.
  • The warning message is actionable (includes local path and the property name to override).
  • Functional test coverage is solid and exercises the plugin via TestKit with deterministic “no network” via broken proxy JVM args; this is a good fit since URL openStream bypasses Gradle dependency offline resolution.
  • The EmptyDirTaskTests test tweak looks correct for the root-user case, and remains guarded to skip on Windows.

Self-review by Cursor

@breskeby breskeby merged commit 8e69b2b into elastic:main Feb 24, 2026
36 checks passed
szybia added a commit to szybia/elasticsearch that referenced this pull request Feb 24, 2026
…on-sliced-reindex

* upstream/main:
  Activity logging improvements (elastic#142901)
  Fix serialization of NodeGpuStatsResponse when no GPU is present (elastic#142937)
  Add doc on master elections in DistributedArchitectureGuide (elastic#142435)
  ESQL: Account for missing StubRelation due to SurrogateExpressions replacement (elastic#142882)
  Add BulkByScrollTask Serialization Tests (elastic#142697)
  Rebalance CI test partitions to reduce Part3 bottleneck (elastic#142930)
  Mute org.elasticsearch.xpack.esql.qa.multi_node.EsqlClientYamlIT test {p0=esql/40_tsdb/to_aggregate_metric_double with multi_values} elastic#142964
  Bump OpenTelemetry dependencies (elastic#142323)
  SQL: add support for API key to JDBC and CLI (elastic#142021)
  Ensure requested capability exists (elastic#142695)
  Warn and fall back to local branches.json (elastic#142606)
  [CI] Mute testWithFetchFailures, testAddCompletionListenerScheduleErr… (elastic#142926)
  ESQL: Add support for ORC file format (elastic#142900)
  Update wolfi (versioned) (elastic#142948)
  Add BulkByScrollResponse Serialization Tests (elastic#142688)
  Run 25_id_generation with and without synthetic id (elastic#142770)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :Delivery/Build Build or test infrastructure Team:Delivery Meta label for Delivery team v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Building in offline mode not working

2 participants