Skip to content

Commit

Permalink
v0.8.1 Hotfix (#171)
Browse files Browse the repository at this point in the history
* v0.8.1 Hotfix

- Fixed an issue where some missing details in telemetry would crash
- Added better readme documentation
- updated some documentation

* fixed the missing changelog
  • Loading branch information
cjlapao authored Jun 17, 2024
1 parent d7aeff1 commit 3208c47
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 12 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- Generation of the Helm Charts
- Issue where some missing details in telemetry would crash

### Changed

- Added better readme documentation
- Updated some documentation

## [0.8.0] - 2024-06-03

Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,16 @@ get the status of a virtual machine.

## Community

![Discord](./docs/img/discord_join_server.png)
Join our [Discord server](https://discord.gg/pEwZ254C3d) to ask questions, share
your experience, and get help from the community.

## Schedule a Demo

If you want to schedule a demo, please schedule a meeting with out Solutions
Architect [here](https://outlook.office.com/bookwithme/user/[email protected]/meetingtype/you-CpOV8UyS0sFl9KjSWw2?anonymous&ep=mlink).
We will go through the service and answer any questions you may have.

## Licensing

You can use the service for free with up to 10 users, without needing any
Expand Down
Binary file added docs/img/Small Presentation draft3.mp4
Binary file not shown.
12 changes: 12 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ manage and orchestrate multiple Parallels Desktop hosts and virtual machines.
It will allow you to create, start, stop and delete virtual machines and will
also allow you to manage the hosts that are running the virtual machines.

## Community

![Discord](./docs/img/discord_join_server.png)
Join our [Discord server](https://discord.gg/pEwZ254C3d) to ask questions, share
your experience, and get help from the community.

## Schedule a Demo

If you want to schedule a demo, please schedule a meeting with out Solutions
Architect [here](https://outlook.office.com/bookwithme/user/[email protected]/meetingtype/you-CpOV8UyS0sFl9KjSWw2?anonymous&ep=mlink).
We will go through the service and answer any questions you may have.

## Licensing

You can use the service for free with up to **10 users**, without needing any
Expand Down
9 changes: 9 additions & 0 deletions src/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/Parallels/prl-devops-service/basecontext"
"github.com/Parallels/prl-devops-service/constants"
"github.com/Parallels/prl-devops-service/telemetry"
"github.com/cjlapao/common-go/helper"
)

Expand All @@ -18,6 +19,14 @@ func Process() {
os.Exit(0)
}

if telemetry.Get() != nil {
cmd := command
if cmd == "" {
cmd = "api"
}
telemetry.SendStartEvent(cmd)
}

switch command {
case constants.API_COMMAND:
processApi(ctx)
Expand Down
16 changes: 7 additions & 9 deletions src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ import (
"github.com/cjlapao/common-go/version"
)

var (
ver = "0.8.0"
versionSvc = version.Get()
)
var ver = "0.8.0"

// @title Parallels Desktop DevOps Service
// @version 0.8.0
Expand All @@ -40,10 +37,10 @@ var (
// @in header
// @name X-Api-Key

// @securityDefinitions.apikey BearerAuth
// @description Type "Bearer" followed by a space and JWT token.
// @in header
// @name Authorization
// @securityDefinitions.apikey BearerAuth
// @description Type "Bearer" followed by a space and JWT token.
// @in header
// @name Authorization
func main() {
// catching all of the exceptions
defer func() {
Expand All @@ -63,6 +60,7 @@ func main() {
os.Exit(1)
}
}()
versionSvc := serviceprovider.VersionSvc

versionSvc.Author = "Carlos Lapao"
versionSvc.Name = constants.Name
Expand Down Expand Up @@ -109,9 +107,9 @@ func main() {
return
default:
// Call home every 24 hours
time.Sleep(24 * time.Hour)
ctx.LogInfof("[Core] Calling home")
callHome()
time.Sleep(24 * time.Hour)
}
}
}()
Expand Down
3 changes: 3 additions & 0 deletions src/serviceprovider/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"github.com/Parallels/prl-devops-service/serviceprovider/system"
"github.com/Parallels/prl-devops-service/serviceprovider/vagrant"
sql_database "github.com/Parallels/prl-devops-service/sql"
"github.com/cjlapao/common-go/version"

log "github.com/cjlapao/common-go-logger"
)
Expand All @@ -47,6 +48,8 @@ type ServiceProvider struct {
License string
}

var VersionSvc = version.Get()

var globalProvider *ServiceProvider

func InitCatalogServices(ctx basecontext.ApiContext) {
Expand Down
1 change: 1 addition & 0 deletions src/telemetry/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ const (
EventCallHome TelemetryEvent = "DEVOPS_CALL_HOME"
EventCatalog TelemetryEvent = "DEVOPS_CATALOG"
CallHomeEvent TelemetryEvent = "DEVOPS_CALL_HOME"
StartEvent TelemetryEvent = "DEVOPS_START"
)
20 changes: 20 additions & 0 deletions src/telemetry/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"github.com/Parallels/prl-devops-service/basecontext"
"github.com/Parallels/prl-devops-service/config"
"github.com/Parallels/prl-devops-service/constants"
"github.com/Parallels/prl-devops-service/serviceprovider"
"github.com/Parallels/prl-devops-service/serviceprovider/system"
"github.com/amplitude/analytics-go/amplitude"
"github.com/amplitude/analytics-go/amplitude/types"
)
Expand Down Expand Up @@ -71,3 +73,21 @@ func TrackEvent(item TelemetryItem) {

svc.TrackEvent(item)
}

func SendStartEvent(cmd string) {
svc := Get()
if !svc.EnableTelemetry {
return
}

ctx := basecontext.NewRootBaseContext()
system := system.Get()
os := system.GetOperatingSystem()
properties := map[string]interface{}{
"version": serviceprovider.VersionSvc.String(),
"os": os,
"mode": cmd,
}

TrackEvent(NewTelemetryItem(ctx, StartEvent, properties, nil))
}
6 changes: 3 additions & 3 deletions src/telemetry/telemetry_item.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ func NewTelemetryItem(ctx basecontext.ApiContext, eventType TelemetryEvent, prop
item.Properties["hardware_id"] = hashedHardwareId
}

key := "unknown_license"
provider := serviceprovider.Get()
key := provider.License
if key == "" {
key = "unknown_license"
if provider != nil {
key = provider.License
}

if user, err := system.GetCurrentUser(ctx); err == nil {
Expand Down

0 comments on commit 3208c47

Please sign in to comment.