Fix release workflow and make observability dependency optional#574
Conversation
* ci(release): run yarn tsc before build:all (openchoreo#565) Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com> * chore: bump @openchoreo/* packages to 1.1.0 (openchoreo#567) Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com> --------- Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
openchoreo#572) Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
The release workflow used `changeset publish`, which shells out to `npm publish` for non-pnpm repos. `npm publish` does not understand Yarn Berry's `workspace:^` protocol and serialised the literal string into 13 of 17 @openchoreo/* tarballs at v1.1.0. External installs fail with `Workspace not found` on first dependency resolution. Replace the publish step with Yarn Berry's native `yarn workspaces foreach --no-private --topological npm publish`, which rewrites `workspace:^` to concrete versions at pack time — independent of `.npmrc:ignore-scripts=true`, which would otherwise also have blocked the prepack hook from running under npm publish. `--tolerate-republish` preserves the idempotent-on-retry behaviour of the previous setup. `changeset version` (in prepare-next-version.yml) is unaffected — only the publish step moves. Verified by running `yarn workspaces foreach --no-private --topological pack` across all 22 public workspaces and grepping the resulting tarballs: every `@openchoreo/*` dep was rewritten to `^1.1.0`, zero `workspace:` leaks. Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
The Deploy and RuntimeHealthCard hooks resolve the observability API
via `useApi(observabilityApiRef)`, which throws NotImplementedError
when no factory is registered for the ref. When a host installs only
the Core plugin set (without @openchoreo/backstage-plugin-openchoreo-
observability), opening any component's Deploy tab crashes with:
NotImplementedError: No implementation available for apiRef{
plugin.openchoreo-observability.service
}
Both hooks already document the intent that observability should be
optional: useLogsSummary's existing comment notes "without requiring
a package dependency" and useIncidentsSummary already absorbs per-
call failures as zero incidents. The bug is just the choice of
Backstage API — useApi() throws when the ref is unregistered, while
useApiHolder().get() returns undefined.
Switch both hooks to useApiHolder().get() and short-circuit the
fetch when the api is missing:
- useIncidentsSummary now returns an empty Map (PipelineCanvas
already optional-chains incidentsSummaries.get(name)?.activeCount).
- useLogsSummary now sets observabilityDisabled: true, which routes
to the existing empty-state branch in RuntimeHealthCard (the same
branch the backend uses when the cluster has observability off).
No UI changes — only the throw is gone.
Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
No description provided.