Skip to content

Commit

Permalink
fix(web): compare previous semantic_version state in version refreshes
Browse files Browse the repository at this point in the history
(wouldn't update the version if you had a service-specific semantic_version)

fixes #279
  • Loading branch information
JosephKav committed Jun 29, 2023
1 parent 98edb97 commit 4f26044
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion service/deployed_version/help_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ func testLookup() (lookup *Lookup) {
"version",
opt.New(
nil, "", boolPtr(true),
&opt.OptionsDefaults{}, &opt.OptionsDefaults{}),
&opt.OptionsDefaults{},
opt.NewDefaults("", boolPtr(true))),
"",
&svcstatus.Status{
ServiceID: stringPtr("test")},
Expand Down
4 changes: 2 additions & 2 deletions service/deployed_version/refresh.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (l *Lookup) applyOverrides(
// regex
useRegex := util.PtrValueOrValue(regex, l.Regex)
// semantic_versioning
useSemanticVersioning := l.Options.SemanticVersioning
var useSemanticVersioning *bool
if semanticVersioning != nil {
useSemanticVersioning = util.StringToBoolPtr(*semanticVersioning)
}
Expand Down Expand Up @@ -131,7 +131,7 @@ func (l *Lookup) Refresh(

// Whether overrides were provided or not, we can update the status if not.
overrides := headers != nil ||
semanticVersioning != nil ||
l.Options.GetSemanticVersioning() != lookup.Options.GetSemanticVersioning() ||
url != nil ||
json != nil ||
regex != nil
Expand Down
4 changes: 2 additions & 2 deletions service/latest_version/refresh.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (l *Lookup) applyOverrides(
return nil, errRequire
}
// semantic_versioning
useSemanticVersioning := l.Options.SemanticVersioning
var useSemanticVersioning *bool
if semanticVersioning != nil {
useSemanticVersioning = util.StringToBoolPtr(*semanticVersioning)
}
Expand Down Expand Up @@ -174,7 +174,7 @@ func (l *Lookup) Refresh(

// Whether overrides were provided or not, we can update the status if not.
overrides := require != nil ||
semanticVersioning != nil ||
l.Options.GetSemanticVersioning() != lookup.Options.GetSemanticVersioning() ||
url != nil ||
urlCommands != nil ||
usePreRelease != nil
Expand Down

0 comments on commit 4f26044

Please sign in to comment.