Skip to content

feat(workflow): integrate prepare-sources post-export (RHIDP-15846) - #169

Open
polasudo wants to merge 9 commits into
redhat-developer:mainfrom
polasudo:RHIDP-15846-workflow-integration
Open

polasudo wants to merge 9 commits into
redhat-developer:mainfrom
polasudo:RHIDP-15846-workflow-integration

Conversation

@polasudo

@polasudo polasudo commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds prepare-downstream-sources (boolean, default false) to export-dynamic.yaml and passes it through export-workspaces-as-dynamic.yaml.
  • When enabled after a successful export, runs prepare-sources with:
    • --workspace-path = source-repo/${{ plugins-root }} (. for flat, workspaces/<name> for non-flat)
    • --overlay-path = overlay-repo/${{ overlay-root }}
  • Uploads the prepared tree as a GitHub Actions artifact (prepared downstream sources…) until construct-artifact (RHIDP-15845) can publish OCI.
  • Default false leaves existing export behavior unchanged.

Test plan

  • Call export with prepare-downstream-sources: false (or omit) — confirm no prepare/upload steps run
  • Non-flat workspace (e.g. topology): set prepare-downstream-sources: true, confirm CLI gets …/source-repo/workspaces/topology + overlay path, artifact uploads
  • Flat workspace (e.g. backstage): confirm CLI gets …/source-repo/. (or …/source-repo) + overlay path
  • Failed export / skipped unchanged workspace — prepare step does not run

Resolves RHIDP-15846

Made with Cursor

@jonkoops
jonkoops force-pushed the RHIDP-15846-workflow-integration branch from bb8104c to 6b80db5 Compare September 30, 2026 09:51
@jonkoops
jonkoops self-requested a review September 30, 2026 09:51
uses: redhat-developer/rhdh-plugin-export-utils/.github/workflows/export-dynamic.yaml@main
# Relative path keeps export-dynamic in lockstep with this workflow's ref
# (needed for new inputs like prepare-downstream-sources; avoids @main drift).
uses: ./.github/workflows/export-dynamic.yaml

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.

Are you sure this work form reusable workflows (at call side in the overlay) ?

@polasudo polasudo Oct 1, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks David when overlays call this reusable workflow, a nested ./ can resolve against the top level or root caller repo (overlays), not utils.

Switched to $/.github/workflows/export-dynamic.yaml (same-repo, same commit as this workflow): https://docs.github.com/en/actions/how-tos/reuse-automations/reuse-workflows

We need lock it on some SHA rather than @main because this PR adds prepare-downstream-sources on both files; pinning the nested call at @main would reject that input until both are merged.

Validated end-to-end locally, I will test it our from overlays once this lands on main.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up after GHA retest on this PR head:

uses: cannot take github.* expressions, so prepare-sources now follows the same pattern as the compatibility helpers: checkout redhat-developer/rhdh-plugin-export-utils at ${{ github.job_workflow_sha }} into _export-utils-prepare-sources, then uses: ./_export-utils-prepare-sources/prepare-sources. Nested workspaces→dynamic stays on $/ so overlays don't resolve ./ against themselves.

Harness (fork dispatch → nested $/ → export-dynamic → prepare-sources → artifact):

Ready for another look when you have a moment.

polasudo and others added 6 commits October 1, 2026 12:27
…tream-sources

Add optional post-export steps in export-dynamic that invoke the prepare-sources
action with workspace/overlay paths derived from plugins-root (flat vs non-flat)
and upload the prepared tree as a workflow artifact until construct-artifact lands.
Pass the new input through export-workspaces-as-dynamic; default false keeps
existing export behavior unchanged (RHIDP-15846).

Co-authored-by: Cursor <cursoragent@cursor.com>
Same-repo reusable call so we can exercise RHIDP-15846 path wiring on
topology/backstage without depending on cross-fork workflow_call (startup_failure).

Co-authored-by: Cursor <cursoragent@cursor.com>
Pinning the nested reusable workflow to @main dropped new inputs such as
prepare-downstream-sources and caused caller startup_failure. Same-repo
relative uses keeps both workflows on the same ref.

Co-authored-by: Cursor <cursoragent@cursor.com>
upload-artifact rejects paths ending in "/." which is what we built for
flat workspaces (plugins-root=.). Resolve "." to source-repo before
invoking prepare-sources and uploading the artifact.

Co-authored-by: Cursor <cursoragent@cursor.com>
Nested "./" can resolve against the top-level overlays caller. Use "$/"
so export-dynamic stays on the same commit as export-workspaces when
called as a reusable workflow (RHIDP-15846).

Co-authored-by: Cursor <cursoragent@cursor.com>
@main pulls setup-vp cache hashing that fails under _actions/. Use a
same-repo relative action path and turn off the lockfile cache so
prepare-downstream-sources can run from export-dynamic (RHIDP-15846).

Co-authored-by: Cursor <cursoragent@cursor.com>
@polasudo
polasudo force-pushed the RHIDP-15846-workflow-integration branch from 8e5b566 to 8527150 Compare October 1, 2026 10:27
Relative ./prepare-sources looks in the job workspace (source/overlay
checkouts), not utils. Pin the composite action to this workflow's commit
and keep setup-vp cache off so lockfile hashing under _actions succeeds.

Co-authored-by: Cursor <cursoragent@cursor.com>
GitHub rejects github.* in uses:; mirror the compatibility-helpers
pattern — checkout utils at this workflow commit, then run the local
composite action.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sonarqubecloud

sonarqubecloud Bot commented Oct 1, 2026

Copy link
Copy Markdown

Replace the runtime checkout of this repository at github.job_workflow_sha
with the documented $/ self repository reference, which resolves to the
workflow file's repository at the running commit without a checkout step.
This removes the dynamic ref that tripped the SonarCloud action-pinning
alert — the reference is commit-locked by definition — and follows the
GitHub-recommended syntax for same-repository actions.
@polasudo
polasudo requested a review from davidfestal November 6, 2026 15:17
@sonarqubecloud

sonarqubecloud Bot commented Nov 6, 2026

Copy link
Copy Markdown

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.

3 participants