Skip to content

Conversation

ofalvai
Copy link
Collaborator

@ofalvai ofalvai commented Aug 7, 2025

Checklist

Version

Requires a MAJOR/MINOR/PATCH version update

Context

Changes

Changes can be reviewed commit by commit.

After migrating the lint config and resolving the new issues, I decided to bite the bullet and fix the old and excluded lint violations too, it wasn't too bad.

Investigation details

Decisions

@ofalvai ofalvai force-pushed the push-mntqorynszqz branch from 7b919eb to 80c024e Compare August 7, 2025 07:11
@@ -179,7 +179,7 @@ func download(version string) error {
if err != nil {
return err
}
url := fmt.Sprintf(downloadURL, version, strings.Title(runtime.GOOS))
url := fmt.Sprintf(downloadURL, version, strings.ToUpper(runtime.GOOS[:1])+runtime.GOOS[1:])
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

strings.Title() is discouraged because of Unicode stuff, but I didn't feel like pulling in /x/strings just for this simple case.

@@ -170,6 +170,7 @@ var failingDeployStepErrorMessages = []string{`failed to create file artifact: /
failed to create file artifact: /bitrise/src/assets:
failed to get file size, error: file not exist at: /bitrise/src/assets`}

//nolint:staticcheck
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Complains about unprintable and non-ASCII characters, but we are testing exactly that.

@ofalvai ofalvai force-pushed the push-mntqorynszqz branch 2 times, most recently from 71a9d1e to 6c415f9 Compare August 7, 2025 07:32
@ofalvai ofalvai force-pushed the push-mntqorynszqz branch from 6c415f9 to 91e521f Compare August 7, 2025 08:02
Copy link
Contributor

@tothszabi tothszabi left a comment

Choose a reason for hiding this comment

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

Thank you for this upgrade ⭐

@@ -3,7 +3,6 @@ package cli
import (
"testing"

"github.com/bitrise-io/envman/v2/models"
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Would not the code look nicer if we keep this line and delete the other one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was thinking the same! But then I remembered we also have a models package here in the CLI repo and that's why we introduce the envmanModels and stepmanModels aliases. I changed my mind and think it's less confusing to use envmanModels everywhere, even in files that don't import the other models package. But this is not a hard opinion.

@@ -24,7 +24,6 @@ import (
"github.com/bitrise-io/bitrise/v2/tools"
"github.com/bitrise-io/bitrise/v2/toolversions"
envman "github.com/bitrise-io/envman/v2/cli"
"github.com/bitrise-io/envman/v2/env"
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Similar question here. Keeping this line and delete the other where we override the imported name.

@@ -3,7 +3,6 @@ package cli
import (
"testing"

"github.com/bitrise-io/envman/v2/models"
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Similar as the previous comments, keep this line and delete the other.

@@ -21,7 +21,7 @@ func StepmanVersion() (version.Version, error) {
return version.Version{}, err
}
if versionPtr == nil {
return version.Version{}, fmt.Errorf("Failed to parse version (%s)", versionOut)
return version.Version{}, fmt.Errorf("parse version %s", versionOut)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is not the correct error message what was before? Because these errors happen when the stepman/envman/embedd cli version is in an invalid format. S instead of

parse version %s

we could have

invalid version: %s

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't have a strong opinion on this, but I prefer these less verbose error strings. The Failed to x thing seems overly verbose when multiple errors are chained.

@ofalvai ofalvai merged commit 6a12eb2 into master Aug 11, 2025
8 checks passed
@ofalvai ofalvai deleted the push-mntqorynszqz branch August 11, 2025 08:49
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