Skip to content
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

fix(kuma-cp) test versions compatibility on the release #2707

Merged
merged 4 commits into from
Sep 7, 2021

Conversation

jakubdyszkiewicz
Copy link
Contributor

Summary

In Kuma 1.3.0, we once again made a mistake of not updating /versions endpoint so we see a warning in the GUI.
This PR introduces unit test that is executed on the release that checks if the current tag has a semver section in CompatibilityMatrix.

Full changelog

  • Refactor versions JSON to pkg/versions. This information is too important to be squeezed into API WS package. This also helps with tests.
  • Add test with build flag that is only executed on the release
  • Add a missing entry for 1.3.0

Documentation

  • No docs.

Testing

  • Unit tests
  • E2E tests
  • Manual testing on Universal
  • Manual testing on Kubernetes

Backwards compatibility

  • Add backport-to-stable label if the code is backwards compatible. Otherwise, list breaking changes.

Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
@codecov-commenter
Copy link

Codecov Report

Merging #2707 (ed8529a) into master (0557fce) will increase coverage by 0.04%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2707      +/-   ##
==========================================
+ Coverage   51.93%   51.98%   +0.04%     
==========================================
  Files         871      872       +1     
  Lines       49530    49553      +23     
==========================================
+ Hits        25725    25759      +34     
+ Misses      21724    21704      -20     
- Partials     2081     2090       +9     
Impacted Files Coverage Δ
pkg/api-server/versions_ws.go 71.42% <0.00%> (ø)
pkg/version/compatibility.go 34.78% <34.78%> (ø)
api/observability/v1/mads.pb.go 35.56% <0.00%> (+1.03%) ⬆️
pkg/insights/resyncer.go 67.66% <0.00%> (+1.50%) ⬆️
pkg/mads/v1/client/client.go 43.75% <0.00%> (+2.50%) ⬆️
pkg/core/bootstrap/autoconfig.go 54.46% <0.00%> (+8.03%) ⬆️
.../core/managers/apis/ratelimit/ratelimit_manager.go 45.16% <0.00%> (+9.67%) ⬆️
pkg/insights/components.go 100.00% <0.00%> (+30.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0557fce...ed8529a. Read the comment docs.

test/release/compatibility_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@jpeach jpeach left a comment

Choose a reason for hiding this comment

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

Mainly some nits on naming. Component versioning tends to be not very obvious, so I'd really recommend adding comments with some Kuma history and context for the benefit of future maintainers :)

pkg/version/compatibility.go Outdated Show resolved Hide resolved
Entry("1.3.0", testCase{
dpVersion: "1.3.0",
expectedEnvoyConstraint: "~1.18.4",
}),
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure that we need all these test cases. We don't need to verify the exact compatibility data here, we need to verify the behavior of the API by ensuring we cover all the code paths, including error cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I wasn't sure about that either but I carred the tests from the previous code location. Let me remove excessive tests

},
}

func (c Compatibility) DP(version string) (*KumaDPCompatibility, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can do better with the function name. This is getting the Dataplane compatibility record for the given Kuma release, right? Perhaps DataplaneConstraints could work?

Copy link
Contributor

Choose a reason for hiding this comment

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

Followup ... since this API isn't used currently, do you think it is likely to be used in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It might be (for example in kumactl)

pkg/version/compatibility.go Outdated Show resolved Hide resolved
mk/test.mk Outdated Show resolved Hide resolved
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
@jakubdyszkiewicz jakubdyszkiewicz merged commit 8ae816b into master Sep 7, 2021
@jakubdyszkiewicz jakubdyszkiewicz deleted the chore/versions-compatibility branch September 7, 2021 07:46
mergify bot pushed a commit that referenced this pull request Sep 7, 2021
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
(cherry picked from commit 8ae816b)
jpeach pushed a commit that referenced this pull request Sep 8, 2021
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
(cherry picked from commit 8ae816b)

Co-authored-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
nikita15p pushed a commit to nikita15p/kuma that referenced this pull request Sep 28, 2021
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
nikita15p pushed a commit to nikita15p/kuma that referenced this pull request Sep 28, 2021
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
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.

None yet

4 participants