Repository navigation
OSAC-1733: Scope component build context to its own subdirectory - #284
Conversation
The "Build and load component images" step's podman build (and the
OSAC-CLI go build and CRD-directory check next to it) used the whole
component checkout as their working root, which is wrong for a monorepo
caller: a components[] entry like {"containerfile":
"fulfillment-service/Containerfile"} clones the entire osac-project/osac
checkout, but the Containerfile, go.mod, cmd/, and config/crd/bases/ it
needs all live under fulfillment-service/, not at the checkout root.
Confirmed on real infra: osac PR osac-project#14's first real e2e run against the new
components array failed both vmaas and caas with "building at STEP COPY
go.mod go.sum ...: no such file or directory" -- podman was building with
the whole monorepo checkout as context instead of the component's own
subdirectory.
Fixed by deriving a build_dir from the containerfile's directory (same
scoping already used in replace-installer-submodule.sh) and using it for
the podman build context/file, the go build cwd, and the CRD directory
check. Standalone (non-monorepo) callers are unaffected, since
build_dir falls back to the checkout root when containerfile has no
directory component.
|
@eliorerz: This pull request references OSAC-1733 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: eliorerz The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Warning Review limit reached
Next review available in: 2 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository: osac-project/coderabbit/.coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
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. Comment |
Summary
Fixes a real bug found via the first actual end-to-end run of
osac's new e2e workflows (PR #14) against thecomponentsarray added in #283: the "Build and load component images" step'spodman build(plus the OSAC-CLIgo buildand CRD-directory check next to it) used the whole component checkout as their working root. That's wrong for a monorepo caller — acomponents[]entry like{"containerfile": "fulfillment-service/Containerfile"}clones the entireosac-project/osaccheckout, but the Containerfile,go.mod,cmd/, andconfig/crd/bases/it needs all live underfulfillment-service/, not at the checkout root.Confirmed failure on real infra
Both the
vmaasandcaase2e runs onosacPR #14 failed with:podman buildwas given the whole monorepo checkout as its context instead of the component's own subdirectory.Fix
Derive a
build_dirfrom the containerfile's directory (the same scoping already used inreplace-installer-submodule.shfor the exact same reason) and use it for:podman build/ansible-buildercontext and file pathgo buildworking directoryconfig/crd/basesCRD-directory checkStandalone (non-monorepo) callers are unaffected —
build_dirfalls back to the checkout root whencontainerfilehas no directory component, so nothing changes for them.Verification
go.mod, and CRD directory all resolve correctly under the scopedbuild_dir, and that the standalone case is unchanged.pre-commit run --all-filespasses (Docker-dependent shellcheck hook skipped, as in the companion OSAC-1733: Build multiple components from one checkout via a components array #283 work; ran localshellcheckdirectly on the extracted "Build and load component images" step instead — no issues).e2e-bmaas-full-install.yml,e2e-vmaas-full-install.yml, ande2e-caas-full-install.yml.