-
Notifications
You must be signed in to change notification settings - Fork 148
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
Feature/4890 detect fail early upgrade #5864
Merged
kaanyalti
merged 39 commits into
elastic:main
from
kaanyalti:feature/4890_detect_fail_early_upgrade
Nov 8, 2024
Merged
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
57e54a0
feature(4890): added shouldUpgrade function in the upgrade cli file
kaanyalti 94ad0c3
feature(4890): added shouldUpgrade check into the upgrade command
kaanyalti 3a4b97c
feature(4890): ran gofmt
kaanyalti accbd22
feature(4890): added a "force" flag, marked it as hidden
kaanyalti 0339dff
feature(4890): removed dpkg, rpm and container logic
kaanyalti 36b3a23
feature(4890): ran gofmt
kaanyalti e9f4fb5
feature(4890): updated the function signature of the upgrade command,…
kaanyalti b0b9b82
feature(4890): update comments
kaanyalti 05195ae
feature(4890): added changelog fragment
kaanyalti 21b09af
feature(4890): added fatal log in case there is an error while markin…
kaanyalti 7853878
feature(4890): added error checks in tests
kaanyalti 89f3e0d
feature(4890): updated the summary in the changelog fragment
kaanyalti 0e9b791
feature(4890): removed the shorthand flag for the force flag
kaanyalti 621b465
feature(4890): updated synchronization in the tests
kaanyalti 7acd42e
Update internal/pkg/agent/cmd/upgrade_test.go
kaanyalti 7c66dd1
feature(4890): using streams err output instead of defaulting to stderr
kaanyalti fde8ef3
feature(4890): use EXPECT instead of On
kaanyalti dabd25e
feature(4890): moved unconfirmed upgrade error to a package var
kaanyalti 54d4da3
feature(4890): removed confirmation from upgrade check for when force…
kaanyalti 073222c
Update internal/pkg/agent/cmd/upgrade.go
kaanyalti f2f5691
Update internal/pkg/agent/cmd/upgrade.go
kaanyalti 5c6d62c
feature(4890): fix errors
kaanyalti 1c1f99a
Update internal/pkg/agent/cmd/upgrade.go
kaanyalti 3df1347
feature(4890): update test
kaanyalti 6d26eb2
fearure(4890): replace ageninfo with state call
kaanyalti 6bf8867
feature(4890): updated proto, client and server implementation
kaanyalti 7d99902
feature(4890): fix struct tag
kaanyalti fe3e91e
feature(4890): added skip-verify checks
kaanyalti c9320c8
feature(4890): ran addLicenseHeaders
kaanyalti 4601ea3
feature(4890): ran mage clean
kaanyalti d5d84bc
feature(4890): fix typo
kaanyalti 186fcb1
feature(4890): added timeout to connection
kaanyalti eb73c7f
feature(4890): changed condition check order
kaanyalti 2eb6b0d
feature(4890): fix unit tests
kaanyalti 8ade18e
feature(4890): refactored tests, using mock client
kaanyalti 6d21a40
Update internal/pkg/agent/cmd/upgrade.go
kaanyalti a4b27f7
feature(4890): use lower case "f" in error messages to be more consis…
kaanyalti 3de964e
feature(4890): remove duplicate line
kaanyalti 52f8884
feature(4890): ran mage controlProto with correct protoc version
kaanyalti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feature(4890): updated synchronization in the tests
- Loading branch information
commit 621b4657493613a4f7a47af7d5e769470be2e593
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only investigate this if you want to, but I think these tests can be simplified because you don't actually need a server to test gRPC server implementations. You can just invoke the
mock.Upgrade()
RPC implementation directly without needing a network transport to connect you to it.You would probably have to make a test client type that wraps the server type, so that calling
client.Upgrade()
just immediately callsmock.Upgrade()
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes much more sense. I just looked at the already implemented test case and followed the same approach for the new ones that I added. Comparing the test cases I added to the one that was already implemented, I see that the new ones don't necessarily need an actual server running as we are not testing for connection interruptions. Will look into this one; however, it is not a priority for me. I may open a new PR to refactor these test cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating this now actually. Instead of mock server, I am using mock client