Skip to content

feat(ci): expose the lifecycle helper as a GitHub Action - #5981

Merged
openshift-merge-bot[bot] merged 3 commits into
redhat-developer:mainfrom
gustavolira:rhidp-19630-lifecycle-action
Dec 4, 2026
Merged

openshift-merge-bot[bot] merged 3 commits into
redhat-developer:mainfrom
gustavolira:rhidp-19630-lifecycle-action

Conversation

@gustavolira

Copy link
Copy Markdown
Member

Summary

Adds .github/actions/lifecycle, a composite action around scripts/lifecycle.ts (#5962). Reviewers of the overlays change (redhat-developer/rhdh-plugin-export-overlays#5053) asked for an action instead of curling the script in each workflow.

- id: lifecycle
  uses: redhat-developer/rhdh/.github/actions/lifecycle@main
  with:
    command: active-branches          # or previous-y-stream / is-eol
    stream: "2.1"                     # for previous-y-stream and is-eol
    repository-url: ${{ github.server_url }}/${{ github.repository }}  # default: redhat-developer/rhdh
# ${{ steps.lifecycle.outputs.result }}
#   active-branches  -> "release-1.10 release-2.1 main"
#   previous-y-stream -> "1.10"
#   is-eol            -> "true" / "false"
  • The action sets up the current Node LTS (setup-node with lts/*) and runs the script from the same ref as the action, since a remote action is checked out with its whole repository.
  • is-eol reports true or false instead of an exit code. Any other failure, including bad input, fails the step with an ::error::.
  • Midstream runs on GitLab and keeps fetching the script directly.

Which issue(s) does this PR fix

Testing

  • The E2E Tests workflow now smoke-tests the action: previous-y-stream 99.0 must answer an X.Y stream.
  • Ran the action's script locally for every command: active-branches → release-1.10 release-2.1 main, previous-y-stream 2.1 → 1.10, is-eol 1.9 → true, is-eol 2.1 → false, and is-eol 1.9.1 and an unknown command fail with exit code 2.
  • actionlint and prettier are clean; node --test scripts/lifecycle.test.ts passes (29).

Merge Danger

Door: two-way

Blast radius: CI only (new action, no existing caller)

How to revert

git revert the PR.

🤖 Generated with Claude Code

Reviewers of the overlays change asked for an action instead of curling
scripts/lifecycle.ts in each workflow. .github/actions/lifecycle sets up the
current Node LTS and runs the script, so other repositories can call
  uses: redhat-developer/rhdh/.github/actions/lifecycle@main
with command (active-branches, previous-y-stream, is-eol), an optional
stream and repository-url, and read steps.<id>.outputs.result. is-eol
reports true or false instead of an exit code; any other failure, including
bad input, fails the step. A remote action is checked out with its whole
repository, so it runs the script from the same ref.

The E2E Tests workflow smoke-tests the action (previous-y-stream 99.0 must
answer an X.Y stream). Midstream runs on GitLab and keeps fetching the
script directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification

This PR uses the pipeline controller for second-stage tests. Selection and triggering follow the repository configuration.

Use /test ? to list jobs and /pipeline help for commands.

gustavolira added a commit to gustavolira/rhdh-plugin-export-overlays that referenced this pull request Dec 4, 2026
Review: call redhat-developer/rhdh/.github/actions/lifecycle (rhdh#5981)
like any other action rather than fetching scripts/lifecycle.ts with curl.
The action sets up Node itself, so this workflow drops its setup-node step,
and it only runs when no release-branch-pattern input is given.

Needs redhat-developer/rhdh#5981 merged first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.41%. Comparing base (dcfe9cb) to head (0877ce9).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5981      +/-   ##
==========================================
- Coverage   82.04%   78.41%   -3.64%     
==========================================
  Files          71       64       -7     
  Lines         908      755     -153     
  Branches      139      122      -17     
==========================================
- Hits          745      592     -153     
  Misses        162      162              
  Partials        1        1              
Flag Coverage Δ *Carryforward flag
rhdh 75.57% <ø> (-4.20%) ⬇️
rhdh-e2e-frontend 69.33% <ø> (ø) Carriedforward from cc19940

*This pull request uses carry forward flags. Click here to find out more.

Components Coverage Δ
Backend plugins ∅ <ø> (∅)
Backend app 88.03% <ø> (ø)
Frontend app 66.46% <ø> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dcfe9cb...0877ce9. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Image was built and published successfully. It is available at:

Comment thread .github/actions/lifecycle/action.yml Resolved
Review: take Node from rhdh's .nvmrc instead of lts/*, so the action is
upgraded together with the rest of the project. setup-node resolves an
absolute node-version-file, so the action reads it from its own checkout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread .github/actions/lifecycle/action.yml Resolved
Comment thread .github/actions/lifecycle/action.yml Resolved
Comment thread .github/actions/lifecycle/action.yml Resolved
Comment thread .github/actions/lifecycle/action.yml Resolved
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Image was built and published successfully. It is available at:

Review suggestion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@openshift-ci openshift-ci Bot removed the lgtm label Dec 4, 2026
@sonarqubecloud

sonarqubecloud Bot commented Dec 4, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Image was built and published successfully. It is available at:

@jonkoops
jonkoops self-requested a review December 4, 2026 13:36
@openshift-ci openshift-ci Bot added the lgtm label Dec 4, 2026
@zdrapela

zdrapela commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

/hold so that tide merges another PR first and doesn't get stuck here (will unhold in a minute)

@zdrapela

zdrapela commented Dec 4, 2026

Copy link
Copy Markdown
Member

/unhold

@openshift-merge-bot
openshift-merge-bot Bot merged commit 8406348 into redhat-developer:main Dec 4, 2026
28 checks passed
gustavolira added a commit to redhat-developer/rhdh-plugin-export-overlays that referenced this pull request Dec 4, 2026
…#5053)

* Read supported release branches from the shared RHDH lifecycle helper (RHIDP-19630)

Instead of another inline copy of the Product Life Cycles API check, fetch
scripts/lifecycle.ts from redhat-developer/rhdh at a pinned commit and ask
it for this repository's active release branches, keeping the three newest.

The helper reads phase dates rather than the "type" field, which lags
behind them: on 2026-11-09 the API still typed 1.10 "Full Support" and 1.9
"Maintenance Support" although both phases had ended on 2026-11-03. Today it
selects release-1.10 and release-2.1, as the type-based check does.

One difference: if the API is down, the helper keeps every branch, so this
step keeps the three newest instead of failing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Send the no-supported-branches error to stderr

Sonar: redirect this error message to stderr.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Fetch the lifecycle helper from rhdh main and set up the current Node LTS

Review: pulling the script from main picks up its fixes without a pin to
bump; LIFECYCLE_REF still accepts a SHA to pin it. setup-node follows lts/*
so a Node upgrade needs no change here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Use the rhdh lifecycle action instead of curling the script

Review: call redhat-developer/rhdh/.github/actions/lifecycle (rhdh#5981)
like any other action rather than fetching scripts/lifecycle.ts with curl.
The action sets up Node itself, so this workflow drops its setup-node step,
and it only runs when no release-branch-pattern input is given.

Needs redhat-developer/rhdh#5981 merged first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Rename the release branch step to Compute Release Branches

Review: it either reads the pattern override or computes the branches with
the lifecycle helper. The step id stays, since the job outputs use it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants