Skip to content

Leverage release as version#33

Open
inverse wants to merge 2 commits into
mainfrom
remove-cloud-prod
Open

Leverage release as version#33
inverse wants to merge 2 commits into
mainfrom
remove-cloud-prod

Conversation

@inverse

@inverse inverse commented Nov 19, 2023

Copy link
Copy Markdown
Contributor
  • Simplify things to leverage RELEASE as the tag etc

}

if device.ID == mainDiskID {
device.MainDevice = true

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will be always false not sure the implications

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It can be true, in case the release_version identified mainDiskID variable resulting of the call to GetDeviceIdentifier (removed in the PR) equals the disk identifier (for example, /dev/sda).
This is to identify the main disk but potentially as spoken via chat, can be greatly simplified :)

Comment thread internal/system/system.go

if err != nil {
fmt.Println("Error loading .env file for cloud version setup")
return

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

When running in non-cloud setups will return 👍

Comment thread internal/tasks/tasks.go
log.Fatal(err.Error())
}

if diagnostics.GetReleaseVersion() == diagnostics.DEV_VERSION {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will always run tasks now - no more blocking against dev

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah, only made sense in the very beginning when we didn't have any way to isolate :P

@inverse inverse requested a review from paulotruta November 20, 2023 20:10
Comment thread internal/tasks/tasks.go
taskResult := taskRestoreBackup()
log.Println("Task: " + task.Task)
log.Println("Args: " + task.Args.String)
switch task.Task {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This switch is getting huge :P Wondering if we could abstract this into something more manageable.

Comment thread internal/tasks/tasks.go
func taskGetStorageDevices() string {
fmt.Println("Executing taskGetStorageDevices")

devices := storage.GetDevices(diagnostics.GetReleaseVersion())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is the reasoning to not pass the version (flavour) here? Since for now it is a bit fuzzy on how we wanna deal with reporting storage devices and the whole logic of mounting them and making them available for apps, we can go with not passing the version and then deal with the storage feature part as its own thing :)

var Commit string
var BuildDate string

const (

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We still need some way to have a "running flavour" to allow the app to branch in and out depending on the machine / conditions it is running. We removed this in the case of the storage devices on this PR, but this is and will be necessary for other configuration aspects. How should we deal with this?

  • Pass a flag at build time (aka FLAVOUR)
  • Do it dynamically at run time based on some environment property (file, env var, etc), and then deal with setting this via the installers for specific platforms.

Wdyt?

@paulotruta paulotruta left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In general looking great! 👍
Left a couple of questions, mostly regarding the need to still have a 'flavour' differentiator to allow changes to the logic. If this is at build or run time is up to decision ;)

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.

2 participants