Skip to content

quick updates to get apptype#2969

Merged
sawka merged 2 commits intomainfrom
sawka/detect-apptype
Mar 3, 2026
Merged

quick updates to get apptype#2969
sawka merged 2 commits intomainfrom
sawka/detect-apptype

Conversation

@sawka
Copy link
Member

@sawka sawka commented Mar 3, 2026

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 3, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9c782a5 and 5f43e88.

📒 Files selected for processing (1)
  • pkg/wavebase/wavebase.go

Walkthrough

Adds two telemetry properties: ClientPackageType and ClientMacOSVersion. These fields are added to the startup telemetry payload, to the Go telemetry user props struct, and to the frontend TypeScript event prop types. Implements wavebase.ClientPackageType() to detect SNAP or APPIMAGE environment variables and wavebase.ClientMacOSVersion() which, on Darwin, runs sw_vers -productVersion (with a timeout), parses major.minor[.patch], and caches the result. No behavioral control-flow changes beyond populating these telemetry fields.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ❌ 3

❌ Failed checks (1 warning, 2 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title mentions 'apptype' which relates to the ClientPackageType functionality, but is vague and doesn't clearly describe the main change of adding macOS version detection. Consider a more specific title like 'Add client package type and macOS version detection to telemetry' to better reflect the full scope of changes.
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to assess relevance to the changeset. Add a description explaining the purpose of the new telemetry fields (client package type and macOS version detection) and their intended use.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sawka/detect-apptype

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.

@kilo-code-bot
Copy link
Contributor

kilo-code-bot bot commented Mar 3, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (5 files)
  • pkg/wavebase/wavebase.go - Adds ClientPackageType() and ClientMacOSVersion() functions for telemetry
  • cmd/server/main-server.go - Integrates new telemetry fields into startup activity
  • pkg/telemetry/telemetrydata/telemetrydata.go - Adds ClientPackageType and ClientMacOSVersion fields to TEventUserProps
  • frontend/types/gotypes.d.ts - Generated TypeScript types (correctly matches Go structs)
  • package-lock.json - Version bump to 0.14.1-beta.1

Review Notes

ClientPackageType() - Simple and correct environment variable detection for SNAP and APPIMAGE packages

ClientMacOSVersion() - Well-implemented with:

  • Proper sync.Once caching pattern
  • 2-second timeout protection for external command
  • Correct regex pattern ^(\d+\.\d+(?:\.\d+)?) that handles both 2-part (15.0) and 3-part (15.0.1) version numbers
  • Graceful error handling (returns empty string on errors)

Integration - New telemetry fields properly integrated into the startup activity event

Type Generation - TypeScript types correctly generated from Go structs

The existing comment on line 377 regarding the regex pattern has been addressed in the current code.

@cloudflare-workers-and-pages
Copy link

Deploying waveterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9c782a5
Status: ✅  Deploy successful!
Preview URL: https://4ed62d7e.waveterm.pages.dev
Branch Preview URL: https://sawka-detect-apptype.waveterm.pages.dev

View logs

Copy link
Contributor

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pkg/wavebase/wavebase.go`:
- Around line 362-375: internalMacOSVersion fails when sw_vers returns only two
components because releaseRegex requires three; update the regex (the symbol
releaseRegex referenced by internalMacOSVersion) so the patch component is
optional (e.g. match major.minor or major.minor.patch), e.g. change the pattern
to allow an optional third numeric group like ^(\d+\.\d+(?:\.\d+)?), then keep
using m[1] as the returned version string in internalMacOSVersion.

ℹ️ Review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c411df4 and 9c782a5.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • cmd/server/main-server.go
  • frontend/types/gotypes.d.ts
  • pkg/telemetry/telemetrydata/telemetrydata.go
  • pkg/wavebase/wavebase.go

@sawka sawka merged commit 98c374b into main Mar 3, 2026
5 of 6 checks passed
@sawka sawka deleted the sawka/detect-apptype branch March 3, 2026 23:19
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