Skip to content

Dockerfiles: set OBA_VERSION after the package installs - #151

Merged
aaronbrethorst merged 2 commits into
OneBusAway:mainfrom
omlahore:build/oba-version-cache
Nov 2, 2026
Merged

aaronbrethorst merged 2 commits into
OneBusAway:mainfrom
omlahore:build/oba-version-cache

Conversation

@omlahore

@omlahore omlahore commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #145. All four stages set ARG/ENV OBA_VERSION right before first use now, or after the package installs and user setup in the runtime and server stages, so a version bump stops rerunning apt-get and pip. build_bundle.sh still sees the variable at runtime.

I couldn't build this locally (Docker wasn't running here), so CI is the real check.

Summary by CodeRabbit

  • Chores
    • Adjusted when version settings are applied during container image builds. This changes the sequence of build setup steps, while leaving the application’s features and behavior unchanged. No end-user-facing changes are included in this update.

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 23 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9c5b653b-5732-4988-ae5f-64936dd58686
Commits

Reviewing files that changed from the base of the PR and between 0f66454 and 35642f5.

Files selected for processing: 2
  • bundler/Dockerfile
  • oba/Dockerfile

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a055468f-f43d-423f-af19-235e909b5385
Commits

Reviewing files that changed from the base of the PR and between d6ce8a8 and 0f66454.

Files selected for processing: 2
  • bundler/Dockerfile
  • oba/Dockerfile

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

Both Dockerfiles move OBA_VERSION declarations later in their builder and runtime stages. The builder-stage declarations now follow project setup. The runtime-stage declarations now follow user setup.

Changes: Dockerfile version placement

Layer / File(s) Summary
Builder-stage declarations
bundler/Dockerfile, oba/Dockerfile
The bundler builder declares OBA_VERSION after copying project files. The oba builder declares it before Maven installs dependencies.
Runtime-stage declarations
bundler/Dockerfile, oba/Dockerfile
The bundler and server stages declare OBA_VERSION after user setup.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: aaronbrethorst

Merge Risk: Minimal · previous review 0f664

The relocation preserves build-time and runtime OBA_VERSION behavior while avoiding unnecessary package-install invalidation.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title accurately describes moving OBA_VERSION declarations later in the Dockerfiles, especially after package installation in the runtime stages. It does not describe the builder-stage placement p…
Linked Issues check Passed Direct issue [#145] requires moving ARG OBA_VERSION and ENV OBA_VERSION in four stages. The diff moves the pair after dependency-file copies and before Maven use in bundler/Dockerfile builder, a…
Out of Scope Changes check Passed The whole-PR diff changes only the placement of ARG OBA_VERSION and ENV OBA_VERSION in the four stages named by [#145]. It contains no unrelated source, dependency, configuration, or behavior chan…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Title check

Explanation

The title accurately describes moving OBA_VERSION declarations later in the Dockerfiles, especially after package installation in the runtime stages. It does not describe the builder-stage placement precisely, but it remains clearly related to the main change.

Full details: Linked Issues check

Explanation

Direct issue [#145] requires moving ARG OBA_VERSION and ENV OBA_VERSION in four stages. The diff moves the pair after dependency-file copies and before Maven use in bundler/Dockerfile builder, and before Maven use in oba/Dockerfile builder. It moves the pair after package installation and user setup in both runtime/server stages. The diff preserves the later runtime configuration, so build_bundle.sh can still use OBA_VERSION. No additional coding or automated-test requirement is stated in [#145].

Full details: Out of Scope Changes check

Explanation

The whole-PR diff changes only the placement of ARG OBA_VERSION and ENV OBA_VERSION in the four stages named by [#145]. It contains no unrelated source, dependency, configuration, or behavior changes.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@aaronbrethorst

Copy link
Copy Markdown
Member

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

@aaronbrethorst aaronbrethorst left a comment

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.

Thanks for this. Moving the ARG/ENV OBA_VERSION pair below the apt, user-setup and connector layers in all four stages is the right call. A version bump will stop rebuilding those package layers. I checked that every use of OBA_VERSION (the mvn dependency:get/cp in the bundler builder, the mvn install and retrieve_maven_artifacts.sh in the oba builder, and the runtime ENV in both final images) still comes after the new declaration. Nothing in between depended on it. Approved on the merits.

Heads up: I just merged the Dependabot base image bumps (#146, #147, #148, #149) into main. They touched the FROM lines right next to the lines you moved, so this branch now has merge conflicts. Please merge or rebase main in and resolve them. The resolution should just be keeping the new tomcat:9.0.123-jdk11-temurin-jammy / golang:1.27.2-bookworm tags alongside your reordering. Once it's mergeable it's good to go. No re-review is needed unless the resolution changes behavior.

@aaronbrethorst
aaronbrethorst merged commit 0baa4d9 into OneBusAway:main Nov 2, 2026
8 checks passed
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.

Dockerfiles: move OBA_VERSION ENV below apt layers so version bumps keep the cache

2 participants