Skip to content

Leverage release as version #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Leverage release as version #33

wants to merge 2 commits into from

Conversation

inverse
Copy link
Contributor

@inverse inverse commented Nov 19, 2023

  • Simplify things to leverage RELEASE as the tag etc

@@ -153,14 +139,9 @@ func GetDevices(release_version diagnostics.ReleaseVersion) []Device {
Status: DeviceStatus{ID: 1, Description: "healthy"},
}

if device.ID == mainDiskID {
device.MainDevice = true
Copy link
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
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 :)

@@ -82,6 +82,7 @@ func SetupCloudOptions() {

if err != nil {
fmt.Println("Error loading .env file for cloud version setup")
return
Copy link
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 👍

@@ -164,213 +164,208 @@ func ExecuteTask(task Task) Task {
log.Fatal(err.Error())
}

if diagnostics.GetReleaseVersion() == diagnostics.DEV_VERSION {
Copy link
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
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
taskResult := taskRestoreBackup()
log.Println("Task: " + task.Task)
log.Println("Args: " + task.Args.String)
switch task.Task {
Copy link
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.

@@ -1196,7 +1190,7 @@ func taskGetSystemUptime() string {
func taskGetStorageDevices() string {
fmt.Println("Executing taskGetStorageDevices")

devices := storage.GetDevices(diagnostics.GetReleaseVersion())
Copy link
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 Version string
var Commit string
var BuildDate string

const (
Copy link
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?

Copy link
Member

@paulotruta paulotruta left a comment

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