Skip to content

Commit

Permalink
Version update (#665)
Browse files Browse the repository at this point in the history
* dependencies moved

* updated plugins and tools versions, also cli version

* changed plugin installatio ncheck, and added test

* updated comments

* check exact urls
  • Loading branch information
trapacska authored Apr 10, 2019
1 parent fcba230 commit a7523d9
Show file tree
Hide file tree
Showing 92 changed files with 706 additions and 220 deletions.
38 changes: 19 additions & 19 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
branch = "master"

[[constraint]]
name = "github.com/bitrise-tools/gows"
name = "github.com/bitrise-io/gows"
branch = "master"

[[constraint]]
Expand Down
4 changes: 2 additions & 2 deletions _tests/integration/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func Test_VersionOutput(t *testing.T) {
{
out, err := command.RunCommandAndReturnCombinedStdoutAndStderr(binPath(), "version")
require.NoError(t, err)
require.Equal(t, "1.28.0", out)
require.Equal(t, "1.29.0", out)
}

t.Log("Version --full")
Expand All @@ -23,7 +23,7 @@ func Test_VersionOutput(t *testing.T) {
require.NoError(t, err)

expectedOSVersion := fmt.Sprintf("%s (%s)", runtime.GOOS, runtime.GOARCH)
expectedVersionOut := fmt.Sprintf(`version: 1.28.0
expectedVersionOut := fmt.Sprintf(`version: 1.29.0
format version: 7
os: %s
go: %s
Expand Down
18 changes: 9 additions & 9 deletions bitrise/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
)

const (
minEnvmanVersion = "2.2.1"
minStepmanVersion = "0.11.2"
minEnvmanVersion = "2.2.2"
minStepmanVersion = "0.11.3"
)

// PluginDependency ..
Expand All @@ -27,20 +27,20 @@ type PluginDependency struct {
// PluginDependencyMap ...
var PluginDependencyMap = map[string]PluginDependency{
"init": PluginDependency{
Source: "https://github.com/bitrise-core/bitrise-plugins-init.git",
MinVersion: "1.1.0",
Source: "https://github.com/bitrise-io/bitrise-plugins-init.git",
MinVersion: "1.1.1",
},
"step": PluginDependency{
Source: "https://github.com/bitrise-core/bitrise-plugins-step.git",
MinVersion: "0.9.8",
Source: "https://github.com/bitrise-io/bitrise-plugins-step.git",
MinVersion: "0.9.9",
},
"workflow-editor": PluginDependency{
Source: "https://github.com/bitrise-io/bitrise-workflow-editor.git",
MinVersion: "1.1.50",
MinVersion: "1.1.52",
},
"analytics": PluginDependency{
Source: "https://github.com/bitrise-core/bitrise-plugins-analytics.git",
MinVersion: "0.9.15",
Source: "https://github.com/bitrise-io/bitrise-plugins-analytics.git",
MinVersion: "0.10.1",
},
}

Expand Down
19 changes: 18 additions & 1 deletion plugins/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/bitrise-io/go-utils/log"
"github.com/bitrise-io/go-utils/pathutil"
"github.com/bitrise-io/go-utils/progress"
"github.com/bitrise-io/go-utils/sliceutil"
ver "github.com/hashicorp/go-version"
)

Expand Down Expand Up @@ -97,6 +98,22 @@ func cleanupPlugin(name string) error {
return DeletePluginRoute(name)
}

// plugins from bitrise-core to bitrise-io GitHub org have been moved
// so it is better to not to detect this as a different plugin source
func isSourceURIChanged(installed, new string) bool {
if urlsForOrg := func(org string) []string {
return []string{
"https://github.com/" + org + "/bitrise-plugins-init.git",
"https://github.com/" + org + "/bitrise-plugins-step.git",
"https://github.com/" + org + "/bitrise-plugins-analytics.git",
}
}; (installed == new) || (sliceutil.IsStringInSlice(installed, urlsForOrg("bitrise-core")) &&
sliceutil.IsStringInSlice(new, urlsForOrg("bitrise-io"))) {
return false
}
return true
}

func installLocalPlugin(pluginSourceURI, pluginLocalPth string) (Plugin, error) {
// Parse & validate plugin
tmpPluginYMLPath := filepath.Join(pluginLocalPth, pluginDefinitionFileName)
Expand All @@ -119,7 +136,7 @@ func installLocalPlugin(pluginSourceURI, pluginLocalPth string) (Plugin, error)
if route, found, err := ReadPluginRoute(newPlugin.Name); err != nil {
return Plugin{}, fmt.Errorf("failed to check if plugin already installed, error: %s", err)
} else if found {
if route.Source != pluginSourceURI {
if isSourceURIChanged(route.Source, pluginSourceURI) {
return Plugin{}, fmt.Errorf("plugin already installed with name (%s) from different source (%s)", route.Name, route.Source)
}

Expand Down
26 changes: 24 additions & 2 deletions plugins/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/stretchr/testify/require"
)

const examplePluginGitURL = "https://github.com/bitrise-core/bitrise-plugins-example.git"
const analyticsPluginBinURL = "https://github.com/bitrise-core/bitrise-plugins-analytics/releases/download/0.9.1/analytics-Darwin-x86_64"
const examplePluginGitURL = "https://github.com/bitrise-io/bitrise-plugins-example.git"
const analyticsPluginBinURL = "https://github.com/bitrise-io/bitrise-plugins-analytics/releases/download/0.9.1/analytics-Darwin-x86_64"

func TestIsLocalURL(t *testing.T) {
t.Log("local url - absolute")
Expand Down Expand Up @@ -221,3 +221,25 @@ func TestDownloadPluginBin(t *testing.T) {
require.Equal(t, true, exist)
}
}

func Test_isSourceURIChanged(t *testing.T) {
for _, tt := range []struct {
installed string
new string
want bool
}{
{installed: "https://github.com/bitrise-core/bitrise-plugins-analytics.git", new: "https://github.com/bitrise-core/bitrise-plugins-analytics.git", want: false},
{installed: "https://github.com/bitrise-core/bitrise-plugins-analytics.git", new: "https://github.com/bitrise-io/bitrise-plugins-analytics.git", want: false},
{installed: "https://github.com/bitrise-core/bitrise-plugins-analytics.git", new: "https://github.com/myorg/bitrise-plugins-analytics.git", want: true},
{installed: "https://github.com/bitrise-core/bitrise-plugins-analytics.git", new: "https://github.com/bitrise-team/bitrise-plugins-analytics.git", want: true},
{installed: "https://github.com/bitrise-custom-org/bitrise-plugins-analytics.git", new: "https://github.com/bitrise-core/bitrise-plugins-analytics.git", want: true},
{installed: "https://github.com/bitrise-custom-org/bitrise-plugins-analytics.git", new: "https://github.com/bitrise-io/bitrise-plugins-analytics.git", want: true},
} {
t.Run("", func(t *testing.T) {
if got := isSourceURIChanged(tt.installed, tt.new); got != tt.want {
t.Log(tt.installed, tt.new)
t.Errorf("isSourceURIChanged() = %v, want %v", got, tt.want)
}
})
}
}
2 changes: 1 addition & 1 deletion toolkits/golang.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"github.com/bitrise-io/go-utils/progress"
"github.com/bitrise-io/go-utils/retry"
"github.com/bitrise-io/go-utils/versions"
"github.com/bitrise-io/gows/gows"
stepmanModels "github.com/bitrise-io/stepman/models"
"github.com/bitrise-tools/gows/gows"
)

const (
Expand Down
65 changes: 17 additions & 48 deletions vendor/github.com/Sirupsen/logrus/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions vendor/github.com/Sirupsen/logrus/CHANGELOG.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions vendor/github.com/Sirupsen/logrus/entry.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion vendor/github.com/Sirupsen/logrus/go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions vendor/github.com/Sirupsen/logrus/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions vendor/github.com/Sirupsen/logrus/terminal_check_aix.go

This file was deleted.

13 changes: 13 additions & 0 deletions vendor/github.com/Sirupsen/logrus/terminal_check_bsd.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a7523d9

Please sign in to comment.