Skip to content

Conversation

kingsleyzissou
Copy link
Collaborator

Since we've made our typescript checks stricter, we can rely on the cockpit
types from upstream. This will prevent drift between the types. The one downside
to this is that we may have to keep the cockpit pkg/lib directory in the repository.

This change refactors some of the cockpit api file end extracts all the
helper functions to their own file. This just makes the file more
manageable to work with.
// types. We have stubbed those functions out for the
// as this is the tsconfig file for the service.
"./src/test/mocks/*"
"./pkg/lib/*"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is up for discussion, we might have to keep a copy of the cockpit.d.ts file in the repo and make sure it matches the commit hash in the makefile.

Copy link

codecov bot commented Sep 12, 2025

Codecov Report

❌ Patch coverage is 0% with 1865 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.76%. Comparing base (580023f) to head (1ca0a10).
⚠️ Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
pkg/lib/cockpit/_internal/transport.ts 0.00% 323 Missing and 1 partial ⚠️
pkg/lib/cockpit/channel.ts 0.00% 286 Missing and 1 partial ⚠️
pkg/lib/cockpit/_internal/channel.js 0.00% 213 Missing and 1 partial ⚠️
pkg/lib/cockpit/_internal/deferred.js 0.00% 207 Missing and 1 partial ⚠️
pkg/lib/cockpit/_internal/location.ts 0.00% 189 Missing and 1 partial ⚠️
pkg/lib/cockpit/fsinfo.ts 0.00% 152 Missing and 1 partial ⚠️
pkg/lib/cockpit/_internal/common.ts 0.00% 96 Missing and 1 partial ⚠️
pkg/lib/cockpit/_internal/info.ts 0.00% 78 Missing and 1 partial ⚠️
pkg/lib/cockpit/_internal/location-utils.ts 0.00% 61 Missing and 1 partial ⚠️
pkg/lib/cockpit/_internal/base64.js 0.00% 59 Missing and 1 partial ⚠️
... and 5 more

❗ There is a different number of reports uploaded between BASE (580023f) and HEAD (1ca0a10). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (580023f) HEAD (1ca0a10)
2 1

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3640      +/-   ##
==========================================
- Coverage   82.48%   76.76%   -5.73%     
==========================================
  Files         214      228      +14     
  Lines       24993    26857    +1864     
  Branches     2589     2603      +14     
==========================================
  Hits        20616    20616              
- Misses       4350     6200    +1850     
- Partials       27       41      +14     
Files with missing lines Coverage Δ
src/Utilities/useIsCockpitAdmin.tsx 0.00% <ø> (ø)
src/test/mocks/cockpit/cockpitFile.ts 19.60% <0.00%> (ø)
pkg/lib/cockpit/event.ts 0.00% <0.00%> (ø)
pkg/lib/os-release.ts 0.00% <0.00%> (ø)
pkg/lib/cockpit/_internal/event-mixin.js 0.00% <0.00%> (ø)
pkg/lib/cockpit/_internal/parentwebsocket.ts 0.00% <0.00%> (ø)
pkg/lib/cockpit/_internal/base64.js 0.00% <0.00%> (ø)
pkg/lib/cockpit/_internal/location-utils.ts 0.00% <0.00%> (ø)
pkg/lib/cockpit/_internal/info.ts 0.00% <0.00%> (ø)
pkg/lib/cockpit/_internal/common.ts 0.00% <0.00%> (ø)
... and 6 more

Continue to review full report in Codecov by Sentry.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Since we've made our typescript checks stricter, we can rely on the cockpit
types from upstream. This will prevent drift between the types. The one downside
to this is that we may have to keep the some of the cockpit lib files  and make
sure they match the commit hash in the makefile.
@kingsleyzissou
Copy link
Collaborator Author

We can re-open this later down the line if we need

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.

1 participant