Skip to content

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

Draft
rebtoor wants to merge 1 commit into
openstack-k8s-operators:mainfrom
rebtoor:feature/content-provider-speculative
Draft

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

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.

Note

This PR includes the content provider infrastructure from PR #85 and is intended to supersede it once validated.

@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 rebtoor 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

@rebtoor
rebtoor force-pushed the feature/content-provider-speculative branch from 14823b1 to 77dfb5b Compare August 18, 2026 08:12
@rebtoor rebtoor changed the title Add Zuul image content provider with speculative build support Add speculative build support: auto-detect and source staging Aug 18, 2026
@rebtoor
rebtoor force-pushed the feature/content-provider-speculative branch from 77dfb5b to fd37ed7 Compare August 18, 2026 08:21
@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 91,fd37ed76d30fcc1e8a352e0ed4efbfb8cdb1b41e

@rebtoor

rebtoor commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

recheck

@rebtoor
rebtoor force-pushed the feature/content-provider-speculative branch from fd37ed7 to 7ecf7e8 Compare August 18, 2026 08:55
@rebtoor
rebtoor force-pushed the feature/content-provider-speculative branch 5 times, most recently from 36e58a3 to 9e3951d Compare August 18, 2026 13:41
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.

Related-Issue: RHOSRFE-466

Co-Authored-By: Sean Mooney <work@seanmooney.info>
Assisted-By: Claude (Anthropic)
Co-authored-by: Cursor <cursoragent@cursor.com>
@rebtoor
rebtoor force-pushed the feature/content-provider-speculative branch from 9e3951d to aac5d56 Compare August 18, 2026 13:42
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