Skip to content

feat: OpenMFP Release flows#226

Open
akafazov wants to merge 7 commits intomainfrom
feat/release
Open

feat: OpenMFP Release flows#226
akafazov wants to merge 7 commits intomainfrom
feat/release

Conversation

@akafazov
Copy link
Copy Markdown
Member

@akafazov akafazov commented Mar 19, 2026

Changes

  • disable continous npmjs release push by default
  • new reusable jobs (job-github-release and job-release-node) to create github release for individual core repository
  • new pipeline(release-openmfp) to trigger new release

How it works

Continuous Build Flow

  • Continuous build flow pushes to main never publish to npmjs (publish defaults to false)
  push to main              push to main                    
       │                         │                                                                                                                                                                                                              
       ▼                         ▼                                                                                                                                                                                                              
  portal-ui-lib           portal-server-lib                                                                                                                                                                                                     
  pipeline.yaml           pipeline.yaml                                                                                                                                                                                                         
       │                         │                                                                                                                                                                                                              
       └────────────┬────────────┘                                                                                                                                                                                                              
                    ▼                                                                                                                                                                                                                           
       pipeline-node-module.yml                                                                                                                                                                                                                 
           (publish: false)                                                                                                                                                                                                                     
                    │                                                                                                                                                                                                                           
            ┌───────┴───────┐                                                                                                                                                                                                                   
            ▼               ▼                                                                                                                                                                                                                   
      job-auto-        job-node-test.yml                                                                                                                                                                                                        
      labeler.yml      (build + test only,                                                                                                                                                                                                      
      (on PR)           no publish)                                                                                                                                                                                                             

Release Flow

  • release-openmfp.yml is the single manual entry point for a coordinated release
  • both core repos are triggered sequentially — if portal-ui-lib fails, portal-server-lib is not triggered
  • the version flows unchanged from the manual input through to both npm publishes and GitHub Releases
  Manual trigger in openmfp/gha                             
  (input: version e.g. 1.2.0)                                                                                                                                                                                                                   
            │                                                                                                                                                                                                                                   
            ▼                                                                                                                                                                                                                                   
  release-openmfp.yml                                                                                                                                                                                                                           
  [GitHub App token]                                                                                                                                                                                                                            
            │                                               
            ├──────────────────────────────────────┐                                                                                                                                                                                            
            │                                      │                                                                                                                                                                                            
            ▼ (1st)                                ▼ (2nd)                                                                                                                                                                                      
  portal-ui-lib                         portal-server-lib                                                                                                                                                                                       
  release.yml                           release.yml                                                                                                                                                                                             
  (workflow_dispatch)                   (workflow_dispatch)                                                                                                                                                                                     
            │                                      │                                                                                                                                                                                            
            ▼                                      ▼                                                                                                                                                                                            
  job-release-node.yml              job-release-node.yml                                                                                                                                                                                        
  (version: 1.2.0)                  (version: 1.2.0)                                                                                                                                                                                            
            │                                      │                                                                                                                                                                                            
            ▼                                      ▼                                                                                                                                                                                            
  job-node-test.yml                 job-node-test.yml                                                                                                                                                                                           
  (build + test,                    (build + test,                                                                                                                                                                                              
   upload artifact)                  upload artifact)                                                                                                                                                                                           
            │                                      │                                                                                                                                                                                            
            ▼                                      ▼                                                                                                                                                                                            
  job-node-publish.yml              job-node-publish.yml                                                                                                                                                                                        
  (npm version 1.2.0,               (npm version 1.2.0,                                                                                                                                                                                         
   npm publish)                      npm publish)                                                                                                                                                                                               
            │                                      │                                                                                                                                                                                            
            ▼                                      ▼                                                                                                                                                                                            
  job-github-release.yml            job-github-release.yml                                                                                                                                                                                      
  (GH Release v1.2.0                (GH Release v1.2.0                                                                                                                                                                                          
   with changelog)                   with changelog)                                                                                                                                                                                            

Implements openmfp/portal#741

Summary by CodeRabbit

  • Chores
    • Added an automated GitHub Release workflow to create/update releases from a provided version.
    • Added a reusable Node release workflow with configurable inputs for build, publish, and artifact steps.
    • Added a cross-repository release orchestration workflow to trigger coordinated releases in related projects.
    • Changed the pipeline default so publishing is disabled unless explicitly enabled.

On-behalf-of: @SAP angel.kafazov@sap.com
Signed-off-by: Angel Kafazov <akafazov@cst-bg.net>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d2940ca0-8fbb-443b-b7dd-f154d719a52e

📥 Commits

Reviewing files that changed from the base of the PR and between c37dc56 and 90984fb.

📒 Files selected for processing (2)
  • .github/workflows/job-release-node.yml
  • .github/workflows/release-openmfp.yml
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/release-openmfp.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/job-release-node.yml

📝 Walkthrough

Walkthrough

Adds three reusable GitHub Actions workflows for Node release orchestration and GitHub Releases, a cross-repository release dispatcher using a GitHub App installation token, and flips a pipeline input default to make publishing opt-in.

Changes

Cohort / File(s) Summary
GitHub Release Job
.github/workflows/job-github-release.yml
New reusable workflow_call workflow that creates/updates a GitHub Release from a required version input using ncipollo/release-action (allow updates, auto-generate release notes).
Node Release Orchestration
.github/workflows/job-release-node.yml, .github/workflows/job-node-test.yml, .github/workflows/job-node-publish.yml
New reusable workflow_call (job-release-node.yml) that sequences build → publish → github-release, exposes inputs (version, environment, workingDirectory, publishFromDist, node_version, prefix, artifactPath, workingDirectoryDist, hasBuild) and forwards secrets/inputs to delegated workflows.
Pipeline Input Default
.github/workflows/pipeline-node-module.yml
Changed inputs.publish default from truefalse, making publish-related jobs disabled by default unless explicitly set.
Cross-Repo Release Trigger
.github/workflows/release-openmfp.yml
New workflow_dispatch workflow that creates a GitHub App installation token and triggers release workflows in openmfp/portal-ui-lib and openmfp/portal-server-lib via gh workflow run, polling for and waiting on the triggered runs, passing the provided version.

Sequence Diagram(s)

sequenceDiagram
  participant Caller as Caller (workflow_call)
  participant Reusable as Release Node Workflow
  participant BuildWF as job-node-test.yml
  participant PublishWF as job-node-publish.yml
  participant GHRelease as job-github-release.yml

  Caller->>Reusable: invoke(version, environment, ...)
  Reusable->>BuildWF: run build (hasBuild, artifactPath, node_version)
  BuildWF-->>Reusable: artifacts / status
  Reusable->>PublishWF: run publish (version, artifacts, publishFromDist, environment)
  PublishWF-->>Reusable: publish result
  Reusable->>GHRelease: create/update GitHub Release (version)
  GHRelease-->>Reusable: release created/updated
Loading
sequenceDiagram
  participant User as User (workflow_dispatch)
  participant Trigger as release-openmfp.yml
  participant GitHubApp as actions/create-github-app-token
  participant GHCLI as gh (GitHub CLI)
  participant RepoA as openmfp/portal-ui-lib
  participant RepoB as openmfp/portal-server-lib

  User->>Trigger: trigger with version
  Trigger->>GitHubApp: create installation token (app-id, private key)
  GitHubApp-->>Trigger: returns token (GITHUB_TOKEN)
  Trigger->>GHCLI: gh workflow run release.yml `@RepoA` (VERSION)
  Trigger->>GHCLI: poll & watch run for RepoA
  Trigger->>GHCLI: gh workflow run release.yml `@RepoB` (VERSION)
  Trigger->>GHCLI: poll & watch run for RepoB
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hopped through YAML, version held so tight,

Built and published under the moonlight.
Tokens hummed, workflows danced in queue,
Releases sprung — with a carrot-shaped view! 🎉

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding new OpenMFP release workflows. It directly relates to the primary focus of the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/release

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@akafazov akafazov changed the title feat(pipeline-node-module): set publish=false by default feat: OpenMFP Release flows Mar 19, 2026
On-behalf-of: @SAP angel.kafazov@sap.com
Signed-off-by: Angel Kafazov <akafazov@cst-bg.net>
On-behalf-of: @SAP angel.kafazov@sap.com
Signed-off-by: Angel Kafazov <akafazov@cst-bg.net>
Comment thread .github/workflows/release-openmfp.yml Fixed
@akafazov akafazov marked this pull request as ready for review March 20, 2026 08:54
@akafazov akafazov requested a review from a team as a code owner March 20, 2026 08:54
On-behalf-of: @SAP angel.kafazov@sap.com
Signed-off-by: Angel Kafazov <akafazov@cst-bg.net>
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
.github/workflows/release-openmfp.yml (1)

11-13: ⚠️ Potential issue | 🟡 Minor

Add explicit permissions block.

The workflow should define an explicit permissions block to limit the default GITHUB_TOKEN scope, even though you're using a GitHub App token for the actual operations. This follows the principle of least privilege.

🔒 Proposed fix
 jobs:
   trigger-releases:
     runs-on: ubuntu-latest
+    permissions:
+      contents: read
     steps:
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release-openmfp.yml around lines 11 - 13, Add an explicit
top-level permissions block to the release-openmfp.yml workflow to limit the
default GITHUB_TOKEN scope for the trigger-releases job; update the workflow
(release-openmfp.yml) to include a minimal permissions section (for example:
permissions: contents: read and other scopes set to none or only those required)
so the trigger-releases job runs with least privilege while your GitHub App
token is still used for actual operations.
🧹 Nitpick comments (2)
.github/workflows/pipeline-node-module.yml (1)

64-71: Consider forwarding publish input to job-node-test.yml.

The build job does not forward the publish input to job-node-test.yml. Since job-node-test.yml defaults publish to true (per .github/workflows/job-node-test.yml:27-31), artifacts will be uploaded even when this pipeline runs with publish: false. This causes unnecessary artifact uploads during non-publishing builds.

♻️ Proposed fix to forward publish input
   build:
     uses: ./.github/workflows/job-node-test.yml
     secrets: inherit
     with:
       workingDirectory: ${{ inputs.workingDirectory }}
       release_branch: ${{ inputs.release_branch }}
       artifactPath: ${{ inputs.artifactPath }}
       hasBuild: ${{ inputs.hasBuild }}
+      publish: ${{ inputs.publish }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pipeline-node-module.yml around lines 64 - 71, The build
job currently calls the reusable workflow job-node-test.yml but does not forward
the publish input, so the reusable workflow's default publish=true persists;
update the build job's with-block to forward the publish input (add publish: ${{
inputs.publish }}) so the publish flag from this pipeline is respected when
invoking job-node-test.yml.
.github/workflows/release-openmfp.yml (1)

22-32: Consider using a matrix strategy to reduce duplication.

The repository list is duplicated in the token scope (lines 22-24) and the release trigger steps (lines 26, 30). A matrix strategy would make it easier to add or remove repositories.

♻️ Alternative approach using matrix
jobs:
  trigger-releases:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        repo: [portal-ui-lib, portal-server-lib]
      fail-fast: true
    steps:
      - name: Generate a token
        id: generate-token
        uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3
        with:
          app-id: "838464"
          private-key: ${{ secrets.OPENMFP_PUBLISHER_PRIVATE_KEY }}
          owner: ${{ github.repository_owner }}
          repositories: ${{ matrix.repo }}
      - name: Release ${{ matrix.repo }}
        run: gh workflow run release.yml --repo openmfp/${{ matrix.repo }} --field version="${{ inputs.version }}"
        env:
          GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}

Note: This runs releases in parallel. If you need sequential execution, use a different approach or set max-parallel: 1 in the strategy.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release-openmfp.yml around lines 22 - 32, Replace the
duplicated repository listing and duplicated release steps by converting the
trigger-releases job to use a strategy.matrix (e.g., matrix.repo) so the
Generate a token step (id: generate-token) uses repositories: ${{ matrix.repo }}
and the release step (currently named "Release portal-ui-lib" / "Release
portal-server-lib") runs once per matrix entry with run: gh workflow run
release.yml --repo openmfp/${{ matrix.repo }} --field version="${{
inputs.version }}" and env GITHUB_TOKEN from steps.generate-token.outputs.token;
set fail-fast and/or max-parallel: 1 on the strategy if you need sequential
execution.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/job-release-node.yml:
- Around line 52-61: Add a release_branch input to the workflow's build job and
forward it to the reusable workflow so artifacts can be published from non-main
branches: update the jobs.build inputs to include release_branch: ${{
inputs.release_branch }} (matching the existing pattern for
workingDirectory/artifactPath/hasBuild/node_version/publish) so the reusable
workflow job-node-test.yml receives inputs.release_branch; follow the same
wiring used in pipeline-node-module.yml to ensure the artifact upload condition
checks the correct branch.

---

Duplicate comments:
In @.github/workflows/release-openmfp.yml:
- Around line 11-13: Add an explicit top-level permissions block to the
release-openmfp.yml workflow to limit the default GITHUB_TOKEN scope for the
trigger-releases job; update the workflow (release-openmfp.yml) to include a
minimal permissions section (for example: permissions: contents: read and other
scopes set to none or only those required) so the trigger-releases job runs with
least privilege while your GitHub App token is still used for actual operations.

---

Nitpick comments:
In @.github/workflows/pipeline-node-module.yml:
- Around line 64-71: The build job currently calls the reusable workflow
job-node-test.yml but does not forward the publish input, so the reusable
workflow's default publish=true persists; update the build job's with-block to
forward the publish input (add publish: ${{ inputs.publish }}) so the publish
flag from this pipeline is respected when invoking job-node-test.yml.

In @.github/workflows/release-openmfp.yml:
- Around line 22-32: Replace the duplicated repository listing and duplicated
release steps by converting the trigger-releases job to use a strategy.matrix
(e.g., matrix.repo) so the Generate a token step (id: generate-token) uses
repositories: ${{ matrix.repo }} and the release step (currently named "Release
portal-ui-lib" / "Release portal-server-lib") runs once per matrix entry with
run: gh workflow run release.yml --repo openmfp/${{ matrix.repo }} --field
version="${{ inputs.version }}" and env GITHUB_TOKEN from
steps.generate-token.outputs.token; set fail-fast and/or max-parallel: 1 on the
strategy if you need sequential execution.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4b228c40-9c5b-48e7-806f-e63badf8ee2b

📥 Commits

Reviewing files that changed from the base of the PR and between 06a4033 and 392f208.

📒 Files selected for processing (4)
  • .github/workflows/job-github-release.yml
  • .github/workflows/job-release-node.yml
  • .github/workflows/pipeline-node-module.yml
  • .github/workflows/release-openmfp.yml

Comment thread .github/workflows/job-release-node.yml
Pass inputs.version through an environment variable instead of
interpolating it directly into the shell script, avoiding injection
via crafted workflow_dispatch input values.

Signed-off-by: Bastian Echterhölter <bastian.echterhoelter@sap.com>
On-behalf-of: @SAP <bastian.echterhoelter@sap.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
.github/workflows/release-openmfp.yml (1)

11-13: ⚠️ Potential issue | 🟠 Major

Add explicit permissions to restrict default token scope.

This workflow omits a permissions block, so GITHUB_TOKEN gets broader default scopes than necessary. Even though release dispatch uses the app token, lock down workflow/job permissions explicitly.

Suggested hardening
 name: Release OpenMFP
 
 on:
   workflow_dispatch:
@@
+permissions: {}
+
 jobs:
   trigger-releases:
     runs-on: ubuntu-latest
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release-openmfp.yml around lines 11 - 13, Add an explicit
permissions block to the workflow or to the trigger-releases job to restrict the
GITHUB_TOKEN scope (e.g., set minimal permissions like contents: read, actions:
read, id-token: write only as required) instead of relying on broad defaults;
update the jobs.trigger-releases definition to include a permissions mapping so
the GITHUB_TOKEN used by this workflow is limited to the least privilege
necessary.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/release-openmfp.yml:
- Around line 25-34: The workflow currently dispatches "Release portal-ui-lib"
and immediately dispatches "Release portal-server-lib" (using gh workflow run),
which is asynchronous and doesn't gate on success; modify the "Release
portal-ui-lib" step to capture the run URL/ID returned by gh workflow run (or
parse output), then wait for that run to finish and verify success (e.g. with gh
run watch / gh run view --json status/conclusion or by polling the run URL)
before executing the "Release portal-server-lib" step; keep the existing env
inputs.version and generated token usage but only run the second gh workflow run
after confirming the first run's conclusion is successful.

---

Duplicate comments:
In @.github/workflows/release-openmfp.yml:
- Around line 11-13: Add an explicit permissions block to the workflow or to the
trigger-releases job to restrict the GITHUB_TOKEN scope (e.g., set minimal
permissions like contents: read, actions: read, id-token: write only as
required) instead of relying on broad defaults; update the jobs.trigger-releases
definition to include a permissions mapping so the GITHUB_TOKEN used by this
workflow is limited to the least privilege necessary.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 31db21c3-b73d-4c25-a3a5-3ffa56a0e719

📥 Commits

Reviewing files that changed from the base of the PR and between 392f208 and 6713105.

📒 Files selected for processing (1)
  • .github/workflows/release-openmfp.yml

Comment thread .github/workflows/release-openmfp.yml
gh workflow run is fire-and-forget. Record a timestamp before
triggering, poll for the new run ID, then use gh run watch
--exit-status to block until completion. If portal-ui-lib fails,
portal-server-lib is never triggered.

Signed-off-by: Bastian Echterhölter <bastian.echterhoelter@sap.com>
On-behalf-of: @SAP <bastian.echterhoelter@sap.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
.github/workflows/release-openmfp.yml (1)

11-13: ⚠️ Potential issue | 🟠 Major

Add explicit permissions for least privilege.

There is still no workflow/job permissions block, so GITHUB_TOKEN gets default scopes. Please set explicit minimal permissions.

🔐 Suggested patch
 name: Release OpenMFP

 on:
   workflow_dispatch:
@@
 jobs:
   trigger-releases:
+    permissions:
+      contents: read
     runs-on: ubuntu-latest
     steps:
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release-openmfp.yml around lines 11 - 13, The workflow job
"trigger-releases" lacks an explicit permissions block so GITHUB_TOKEN gets
default overly-broad scopes; add a permissions entry under the job
(jobs.trigger-releases) that declares only the minimal scopes needed for this
release workflow (for example, restrict to contents: read, packages: write,
id-token: write or whatever specific actions you actually use) and remove any
other default privileges—adjust the exact permission keys to match the actions
used in the job.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In @.github/workflows/release-openmfp.yml:
- Around line 11-13: The workflow job "trigger-releases" lacks an explicit
permissions block so GITHUB_TOKEN gets default overly-broad scopes; add a
permissions entry under the job (jobs.trigger-releases) that declares only the
minimal scopes needed for this release workflow (for example, restrict to
contents: read, packages: write, id-token: write or whatever specific actions
you actually use) and remove any other default privileges—adjust the exact
permission keys to match the actions used in the job.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2f14819b-748c-4c56-98a9-f0613cee1dd1

📥 Commits

Reviewing files that changed from the base of the PR and between 6713105 and c37dc56.

📒 Files selected for processing (1)
  • .github/workflows/release-openmfp.yml

Add explicit empty permissions block to release-openmfp.yml to
restrict default GITHUB_TOKEN scope per least privilege principle.

Add release_branch input to job-release-node.yml and forward it
to job-node-test.yml so artifact uploads work for non-main branches.

Signed-off-by: Bastian Echterhölter <bastian.echterhoelter@sap.com>
On-behalf-of: @SAP <bastian.echterhoelter@sap.com>
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