Skip to content

ci: Ensure OpenAPI client is built#1631

Merged
PeterC89 merged 4 commits intomainfrom
fix/build-openapi-client
Feb 4, 2026
Merged

ci: Ensure OpenAPI client is built#1631
PeterC89 merged 4 commits intomainfrom
fix/build-openapi-client

Conversation

@PeterC89
Copy link
Contributor

@PeterC89 PeterC89 commented Feb 4, 2026

About the Contributor

This pull request is posted on behalf of the TSC.

Type of Contribution

This is a: Bug fix

Current Behavior

OpenAPI build fails

New Behavior

OpenAPI build completes

Testing

  • I have added one or more unit tests for this PR
  • I have updated the relevant unit tests
  • No unit test changes are needed for this PR

Affected areas

This PR affects CI

Time Frame

This bug fix needs to be merged into 26.03

Other Information

Status

  • PR is ready to be reviewed.
  • The functionality has been tested by the author.
  • Relevant unit tests has been added / updated.
  • Relevant documentation (code comments, system documentation) has been added / updated.

Changes to .github/workflows/publish-libs.yml

The test-packages workflow job's build step has been updated to conditionally build the OpenAPI package differently from other packages:

  • For the openapi package: Runs yarn workspace @sofie-automation/openapi run build
  • For other packages: Runs the standard yarn build:single ${{ matrix.package-name }}/tsconfig.build.json

This conditional logic (lines 123–127) ensures the OpenAPI client is built in the test-packages job, which uses Java-dependent tooling required for OpenAPI generation. The workflow file uses tabs for indentation throughout.

The change resolves a CI failure where the OpenAPI build was not completing, while maintaining the existing build process for other packages (blueprints-integration, server-core-integration, shared-lib) that do not require Java.

@PeterC89 PeterC89 requested a review from a team as a code owner February 4, 2026 13:39
@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@coderabbitai
Copy link

coderabbitai bot commented Feb 4, 2026

Caution

Review failed

The pull request is closed.

Walkthrough

The .github/workflows/publish-libs.yml workflow is updated to add conditional logic to the test-packages job's build step. When the matrix package is "openapi", it executes a workspace-specific build command; otherwise, it uses the existing build command for other packages.

Changes

Cohort / File(s) Summary
Workflow Conditional Logic
.github/workflows/publish-libs.yml
Added conditional check in the build step: if package is "openapi", run yarn workspace @sofie-automation/openapi run build; otherwise use the existing yarn build:single command.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • Sofie-Automation/sofie-core#1631: Adds build-preparation script inside the OpenAPI package to ensure the package's build succeeds in CI in conjunction with this workflow update.

Suggested reviewers

  • Julusian

Poem

🐰 The openapi path splits off with flair,

While others trot along their pathway there,

One command for the special, one for the rest,

CI knows which build is best! ✨

🚥 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 identifies the primary change: adding a build script to ensure the OpenAPI client is built in CI, which directly addresses the bug fix objective.
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
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/build-openapi-client

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.

@Julusian
Copy link
Member

Julusian commented Feb 4, 2026

I believe we explicitly do not build this all the time because building the openapi client requires java, and due to licensing reasons some devs have been reluctant to install and use that

@PeterC89
Copy link
Contributor Author

PeterC89 commented Feb 4, 2026

Problem is this fails without it: https://github.com/Sofie-Automation/sofie-core/actions/runs/21671643804

@Julusian
Copy link
Member

Julusian commented Feb 4, 2026

I would be tempted to change

yarn build:single ${{ matrix.package-name }}/tsconfig.build.json
to something like:

  if [ "${{ matrix.package-name }}" = "openapi" ]; then
            yarn workspace @sofie-automation/openapi run build
  else
          yarn build:single ${{ matrix.package-name }}/tsconfig.build.json
  fi

The general build workflow is doing that already https://github.com/Sofie-Automation/sofie-core/blob/92b183b201041bdb1197b3763b421e1a84c4bf1e/.github/workflows/node.yaml#L515C9-L519

@PeterC89
Copy link
Contributor Author

PeterC89 commented Feb 4, 2026

Yeah, seems reasonable, have updated

@Julusian
Copy link
Member

Julusian commented Feb 4, 2026

I didnt really like having to do these special cases for openapi, instead I want to propose rebuilding the package with a different generator so that we can remove the reliance on java entirely.
But havent explored it enough yet

@PeterC89 PeterC89 merged commit 75a0e14 into main Feb 4, 2026
65 of 68 checks passed
@PeterC89 PeterC89 deleted the fix/build-openapi-client branch February 4, 2026 14:10
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 4, 2026

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.

2 participants