Skip to content

Commit

Permalink
PMM-12762 Get notified about new version. (#2951)
Browse files Browse the repository at this point in the history
* PMM-11261 Update PMM via watchtower

* PMM-11261 address comments and fix linter

* PMM-11261 fix linters and tests.

* PMM-11261 fix linters and tests.

* PMM-11261 fix linters.

* PMM-11261 fix linters.

* Update managed/cmd/pmm-managed/main.go

Co-authored-by: Alex Demidoff <[email protected]>

* Update managed/cmd/pmm-managed/main.go

Co-authored-by: Alex Demidoff <[email protected]>

* PMM-11261 Address comments.

* PMM-11261 fix build.

* Update docker-compose.yml

* Update docker-compose.yml

Co-authored-by: Alex Demidoff <[email protected]>

* Update docker-compose.yml

Co-authored-by: Alex Demidoff <[email protected]>

* PMM-12762 Get notified about new version.

* PMM-11261 Replace switch with if-else

* PMM-12762 Fix conflicts, tests and linters.

* PMM-12762 Add license header.

* PMM-12762 Get notified about new version.

* PMM-12762 Fix deadlock

* PMM-12762 Fix linters.

* PMM-12762 add more log info.

* PMM-12762 add more log info.

* PMM-12762 add more log info.

* PMM-12762 add more log info.

* PMM-12762 add more log info.

* PMM-12762 add more log info.

* PMM-12762 set PMM version.

* PMM-12762 set PMM version.

* Update managed/services/server/updater.go

Co-authored-by: Alex Demidoff <[email protected]>

* PMM-12762 fix merge conflicts.

* Update .github/workflows/managed.yml

Co-authored-by: Alex Demidoff <[email protected]>

* PMM-12762 sort env variables.

* PMM-13028 Non blocking StartUpgrade operation (#2972)

* PMM-13028 Non blocking StartUpgrade operation

* PMM-13028 Fix imports

* PMM-13028 Fix linters

---------

Co-authored-by: Alex Demidoff <[email protected]>
Co-authored-by: idoko <[email protected]>
  • Loading branch information
3 people authored Jun 24, 2024
1 parent 5efc158 commit 1062f5a
Show file tree
Hide file tree
Showing 38 changed files with 1,363 additions and 2,478 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/clean.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ jobs:
go:
- version: 1.22.x
may-fail: false
- version: tip
may-fail: true

continue-on-error: ${{ matrix.go.may-fail }}
runs-on: ubuntu-22.04
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/managed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,11 @@ jobs:
env | sort
go env | sort
git status
docker exec pmm-server env | sort
docker exec pmm-server go env | sort
docker exec pmm-server supervisorctl status || true
services=$(docker exec pmm-server supervisorctl status | awk '{print $1}')
while IFS= read -r service; do
echo "Logs for $service:"
docker exec pmm-server supervisorctl tail $service
done <<< "$services"
8 changes: 4 additions & 4 deletions api-tests/server/updates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,20 @@ func TestCheckUpdates(t *testing.T) {
require.NotEmpty(t, res.Payload.Latest)
assert.True(t, strings.HasPrefix(res.Payload.Latest.Version, "2."),
"latest.version = %q should have '2.' prefix", res.Payload.Latest.Version)
assert.NotEmpty(t, res.Payload.Latest.FullVersion)
require.NotEmpty(t, res.Payload.Latest.Timestamp)
ts = time.Time(res.Payload.Latest.Timestamp)
hour, min, _ = ts.Clock()
assert.Zero(t, hour, "latest.timestamp should contain only date")
assert.Zero(t, min, "latest.timestamp should contain only date")

if res.Payload.UpdateAvailable {
assert.NotEqual(t, res.Payload.Installed.FullVersion, res.Payload.Latest.FullVersion)
assert.NotEmpty(t, res.Payload.Latest.Tag)
assert.NotEqual(t, res.Payload.Installed.FullVersion, res.Payload.Latest.Version)
assert.NotEqual(t, res.Payload.Installed.Timestamp, res.Payload.Latest.Timestamp)
assert.True(t, strings.HasPrefix(res.Payload.LatestNewsURL, "https://per.co.na/pmm/2."), "latest_news_url = %q", res.Payload.LatestNewsURL)
} else {
assert.Equal(t, res.Payload.Installed.FullVersion, res.Payload.Latest.FullVersion)
assert.Equal(t, res.Payload.Installed.Timestamp, res.Payload.Latest.Timestamp)
assert.Empty(t, res.Payload.Installed.FullVersion, res.Payload.Latest.Version)
assert.Empty(t, res.Payload.LatestNewsURL, "latest_news_url should be empty")
}
assert.NotEmpty(t, res.Payload.LastCheck)
Expand Down Expand Up @@ -108,7 +108,7 @@ func TestCheckUpdates(t *testing.T) {
require.NoError(t, err)

assert.Equal(t, res.Payload.Installed, resForce.Payload.Installed)
assert.Equal(t, resForce.Payload.Installed.FullVersion != resForce.Payload.Latest.FullVersion, resForce.Payload.UpdateAvailable)
assert.Equal(t, resForce.Payload.Latest.Tag != "", resForce.Payload.UpdateAvailable)
assert.NotEqual(t, res.Payload.LastCheck, resForce.Payload.LastCheck)
})
}
Expand Down
10 changes: 5 additions & 5 deletions api/serverpb/json/client/server/check_updates_responses.go

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

9 changes: 4 additions & 5 deletions api/serverpb/json/serverpb.json
Original file line number Diff line number Diff line change
Expand Up @@ -720,22 +720,21 @@
"x-order": 4
},
"latest": {
"description": "VersionInfo describes component version, or PMM Server as a whole.",
"type": "object",
"properties": {
"full_version": {
"description": "Full version for debugging.",
"tag": {
"description": "Docker image tag.",
"type": "string",
"x-order": 1
},
"timestamp": {
"description": "Build or release date.",
"description": "Release date.",
"type": "string",
"format": "date-time",
"x-order": 2
},
"version": {
"description": "User-visible version.",
"description": "PMM Version.",
"type": "string",
"x-order": 0
}
Expand Down
Loading

0 comments on commit 1062f5a

Please sign in to comment.