Skip to content

ci: add workflow to verify yarn create-workspace - #5468

Open
christoph-jerolimov wants to merge 4 commits into
mainfrom
ci/create-workspace-workflow
Open

christoph-jerolimov wants to merge 4 commits into
mainfrom
ci/create-workspace-workflow

Conversation

@christoph-jerolimov

Copy link
Copy Markdown
Member

Summary

  • Follow-up to fix(repo-tools): fix yarn create-workspace #4882: add a CI workflow that exercises yarn create-workspace from the repo root
  • Runs on PRs that change root package.json, yarn.lock, workspaces/repo-tools/**, or the workflow itself
  • Installs with --immutable, scaffolds a throwaway workspace, checks expected files, then installs and builds it

Test plan

  • Confirm the workflow appears on this PR (workflow file path change)
  • Verify the job creates ci-create-workspace-test, finds scaffold files, and completes yarn build:all

Made with Cursor

@christoph-jerolimov
christoph-jerolimov requested review from a team as code owners November 5, 2026 21:50
@rhdh-qodo-merge

Copy link
Copy Markdown

PR Summary by Qodo

Add CI coverage for yarn create-workspace

🧪 Tests ⚙️ Configuration changes 🕐 10-20 Minutes

Grey Divider

AI Description

• Run workspace-creation CI when root dependencies, repo-tools, or the workflow change.
• Scaffold a throwaway workspace and verify its expected files.
• Install dependencies and build the generated workspace to catch end-to-end regressions.
Diagram

graph TD
  A["Relevant PR"] --> B["Root install"] --> C["Repo-tools install"] --> D["Create workspace"] --> E{"Files present?"} --> F["Workspace install"] --> G["Build workspace"]
Loading
High-Level Assessment

Keep this as a path-filtered, standalone workflow. The existing workspace CI targets changed workspaces, whereas this check must create a new one from the repository root; folding it into that matrix would obscure its distinct trigger and setup requirements.

Files changed (1) +79 / -0

Tests (1) +79 / -0
ci-create-workspace.ymlAdd end-to-end workspace-creation CI +79/-0

Add end-to-end workspace-creation CI

• Adds a path-filtered pull-request job that installs root and repo-tools dependencies, runs yarn create-workspace, and checks the generated files. It then performs an immutable install and build in the new workspace.

.github/workflows/ci-create-workspace.yml

@rhdh-qodo-merge

rhdh-qodo-merge Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Code Review by Qodo


View medium (2)
Remediation recommended
1. Scaffold check no longer verifies the generated lockfile 🐞 Bug
Description
The step at line 74 runs yarn install --no-immutable, so Yarn is allowed to rewrite the scaffolded
workspace's yarn.lock and resolve dependencies fresh on every run. The template lockfile is only
the one-line placeholder # intentionally left empty, so the job's only lockfile check (file
existence at line 56) passes for an empty seed, and yarn build:all then builds against whatever
versions resolve that day.
Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

Issue description
The CI step `Install new workspace dependencies` uses `yarn install --no-immutable` so it can rewrite the placeholder template `yarn.lock`. This disables lockfile verification for the whole scaffold job, and the file-existence check accepts the placeholder file, so the job cannot catch a broken or drifting generated lockfile.

Fix Focus Areas
- .github/workflows/ci-create-workspace.yml[70-80]
- .github/workflows/ci-create-workspace.yml[52-68]
- workspaces/repo-tools/packages/cli/src/lib/workspaces/templates/workspace/yarn.lock[1-1]

Recommended Fix
Either (a) have `create-workspace` generate a real lockfile during scaffolding and keep `--immutable` in the workflow, or (b) keep `--no-immutable` only for the template seed and then assert after install that `yarn.lock` is non-trivial (for example, that it contains a `__metadata` block) and run `git diff --exit-code` or an equivalent check so an unexpected rewrite is visible. At minimum, check the lockfile content rather than only its existence.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗

2. Requested workspace owners are ignored 🐞 Bug
Description
The new --owner option is validated and suppresses the owner prompt, but the command calls
createWorkspace with only the name. Running the workflow with --owner '@ci-bot' therefore leaves
the generated catalog's owner as john@example.com, while its file checks and build still pass.
Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new owner option is accepted but has no effect on the generated workspace: catalog metadata retains its hard-coded owner.
## Fix Focus Areas
- workspaces/repo-tools/packages/cli/src/commands/workspace/create.ts[43-76]
- workspaces/repo-tools/packages/cli/src/lib/workspaces/createWorkspace.ts[21-36]
- workspaces/repo-tools/packages/cli/src/lib/workspaces/templates/workspace/catalog-info.yaml.hbs[9-12]
## Recommended Fix
Pass the supplied or prompted owner through workspace creation and write it to the generated catalog metadata. Add a check that the requested owner appears in the scaffold.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


View low (1)
Informational
3. Required check may stay pending on unrelated PRs 🐞 Bug
Description
The paths filter in on.pull_request limits the job create-workspace to PRs touching a few
files, so the workflow never reports a status for other PRs. If this check is made a required status
in branch protection, every PR outside those paths will wait forever for a check that never starts.
Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

Issue description
The workflow uses `on.pull_request.paths`, so it produces no check run on PRs that do not touch the listed files. If the job is made required in branch protection, those PRs stay pending indefinitely.

Fix Focus Areas
- .github/workflows/ci-create-workspace.yml[4-9]

Recommended Fix
Remove the `paths` filter from `on.pull_request` so the workflow always runs. Add a first step or a `dorny/paths-filter`-style job output that detects whether the relevant files changed, and guard the remaining steps with `if:` on that output. This way the check always reports a result. Alternatively, keep the path filter and document that the check must not be marked required.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


@rhdh-qodo-merge

Copy link
Copy Markdown

Important

The /generate_labels command by Qodo was deprecated on the 1st of October 2026 and is no longer available. We recommend switching to the latest Qodo review capabilities. Learn more

@codecov

codecov Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.54%. Comparing base (3849b65) to head (53fa0d3).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5468   +/-   ##
=======================================
  Coverage   65.54%   65.54%           
=======================================
  Files        2775     2775           
  Lines      111253   111253           
  Branches    31292    31292           
=======================================
  Hits        72922    72922           
  Misses      37772    37772           
  Partials      559      559           
Flag Coverage Δ *Carryforward flag
adoption-insights 87.31% <ø> (ø) Carriedforward from 5cf6a84
ai-integrations 90.82% <ø> (ø) Carriedforward from 5cf6a84
app-defaults 75.43% <ø> (ø) Carriedforward from 5cf6a84
augment 46.67% <ø> (ø) Carriedforward from 5cf6a84
boost 93.76% <ø> (ø) Carriedforward from 5cf6a84
bulk-import 73.13% <ø> (ø) Carriedforward from 5cf6a84
cost-management 13.56% <ø> (ø) Carriedforward from 5cf6a84
dcm 74.35% <ø> (ø) Carriedforward from 5cf6a84
e2e-adoption-insights 60.00% <ø> (ø) Carriedforward from 5cf6a84
e2e-extensions 62.43% <ø> (ø) Carriedforward from 5cf6a84
e2e-global-header 52.43% <ø> (ø) Carriedforward from 5cf6a84
e2e-homepage 61.25% <ø> (ø) Carriedforward from 5cf6a84
e2e-intelligent-assistant 46.04% <ø> (ø) Carriedforward from 5cf6a84
e2e-orchestrator 49.83% <ø> (ø) Carriedforward from 5cf6a84
e2e-orchestrator-plugin 49.82% <ø> (ø) Carriedforward from 5cf6a84
e2e-quickstart 54.83% <ø> (ø) Carriedforward from 5cf6a84
e2e-scorecard 49.88% <ø> (ø) Carriedforward from 5cf6a84
e2e-theme 16.43% <ø> (ø) Carriedforward from 5cf6a84
extensions 59.07% <ø> (ø) Carriedforward from 5cf6a84
global-floating-action-button 71.18% <ø> (ø) Carriedforward from 5cf6a84
global-header 69.15% <ø> (ø) Carriedforward from 5cf6a84
homepage 86.65% <ø> (ø) Carriedforward from 5cf6a84
install-dynamic-plugins 84.02% <ø> (ø) Carriedforward from 5cf6a84
intelligent-assistant 79.75% <ø> (ø) Carriedforward from 5cf6a84
konflux 91.98% <ø> (ø) Carriedforward from 5cf6a84
lightspeed 69.02% <ø> (ø) Carriedforward from 5cf6a84
mcp-integrations 84.46% <ø> (ø) Carriedforward from 5cf6a84
orchestrator 77.77% <ø> (ø) Carriedforward from 5cf6a84
quickstart 65.83% <ø> (ø) Carriedforward from 5cf6a84
sandbox 79.56% <ø> (ø) Carriedforward from 5cf6a84
scorecard 92.32% <ø> (ø) Carriedforward from 5cf6a84
theme 88.56% <ø> (ø) Carriedforward from 5cf6a84
translations 7.91% <ø> (ø) Carriedforward from 5cf6a84
x2a 79.43% <ø> (ø) Carriedforward from 5cf6a84

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


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 3849b65...53fa0d3. 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.

christoph-jerolimov and others added 2 commits November 5, 2026 23:00
Follow-up to #4882 to keep the root create-workspace path covered in CI when package.json, yarn.lock, repo-tools, or this workflow change.

Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Piped stdin trips inquirer with ERR_USE_AFTER_CLOSE in CI. Accept
--name/--owner so the workflow can scaffold without a TTY, and install
the seeded workspace lockfile without --immutable.

Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@rhdh-gh-app

rhdh-gh-app Bot commented Nov 5, 2026

Copy link
Copy Markdown

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/rhdh-repo-tools workspaces/repo-tools/packages/cli none v0.0.1

Yarn enables immutable installs under CI=true, which rejects the
template seed lockfile. Pass --no-immutable for that step only.

Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@sonarqubecloud

sonarqubecloud Bot commented Nov 5, 2026

Copy link
Copy Markdown

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