Skip to content

Add speculative build support: auto-detect and source staging - #90

Closed
rebtoor wants to merge 1 commit into
openstack-k8s-operators:mainfrom
rebtoor:feature/speculative-source-staging
Closed

Add speculative build support: auto-detect and source staging#90
rebtoor wants to merge 1 commit into
openstack-k8s-operators:mainfrom
rebtoor:feature/speculative-source-staging

Conversation

@rebtoor

@rebtoor rebtoor commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add build.sh auto-detect <project> [stream] command that scans sources.txt files to determine which container images are affected by a given upstream OpenStack project.
  • Add Ansible playbooks for Zuul integration: auto-image resolution (resolve-auto-images.yaml) and source staging (stage-zuul-sources.yaml).
  • Add comprehensive unit tests for the auto-detect logic (9 tests including consistency validation against all sources.txt files).

This is a lightweight alternative to the OIB Python package from PR #49, implementing only the two features required for speculative testing of upstream OpenStack changes (RHOSRFE-466):

  1. Auto-detection: Given a Zuul project (e.g., openstack/tempest), determine which images need rebuilding by parsing sources.txt manifests. Uses exact URL-path matching to avoid false positives.
  2. Source staging: Copy Zuul-checked-out (patched) source repositories into container src/ directories so builds use the speculative code instead of pinned hashes.

How it works

When the content provider runs with s2i_ci_images: auto:

  1. resolve-auto-images.yaml inspects the Zuul queue to find which external projects triggered the build.
  2. For each project, it runs build.sh auto-detect to find affected images.
  3. stage-zuul-sources.yaml copies Zuul's patched checkouts into the container build contexts.
  4. The normal build proceeds with patched sources.

Dependencies

Depends-On: #85

Made with Cursor

@openshift-ci

openshift-ci Bot commented Aug 18, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign amoralej for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@centosinfra-prod-github-app

Copy link
Copy Markdown

Merge Failed.

This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset.
Warning:
Error merging github.com/openstack-k8s-operators/s2i-openstack-containers for 90,a493a1669643a0d8f0514952e8992d0e7278fa6d

Enable the s2i content provider to automatically determine which images
to build based on the triggering Zuul project, and to stage patched
source checkouts from the Zuul workspace into container build contexts.

This is a lightweight alternative to the OIB Python package from PR openstack-k8s-operators#49,
implementing only the two features needed for RHOSRFE-466 (speculative
testing of upstream OpenStack changes):

1. `build.sh auto-detect <project> [stream]` — scans sources.txt files
   to find which container images reference a given upstream project.
   Uses exact URL-path matching to avoid false positives (e.g.,
   openstack/watcher does not match openstack/watcher-tempest-plugin).

2. Ansible playbooks for Zuul integration:
   - resolve-auto-images.yaml: resolves `s2i_ci_images: auto` by
     running auto-detect for each changed project in the Zuul queue.
   - stage-zuul-sources.yaml: copies Zuul-checked-out source repos
     into container src/ directories for speculative builds.

Depends-On: openstack-k8s-operators#85

Related-Issue: RHOSRFE-466

Co-Authored-By: Sean Mooney <smooney@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@rebtoor
rebtoor force-pushed the feature/speculative-source-staging branch from a493a16 to fa821a1 Compare August 18, 2026 07:51
@centosinfra-prod-github-app

Copy link
Copy Markdown

Merge Failed.

This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset.
Warning:
Error merging github.com/openstack-k8s-operators/s2i-openstack-containers for 90,fa821a12ef70a00cb872a522138a365c5441473c

@rebtoor

rebtoor commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

Folded into PR #85 — the speculative build support (auto-detect, list-sources, source staging) is now part of the content provider PR.

@rebtoor rebtoor closed this Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant