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

Simplify version detection #329

Closed
wants to merge 18 commits into from
Closed

Simplify version detection #329

wants to merge 18 commits into from

Conversation

mmorel-35
Copy link
Contributor

Fixes #324

@mmorel-35 mmorel-35 requested a review from a team as a code owner April 16, 2021 20:40
@mmorel-35 mmorel-35 marked this pull request as draft April 17, 2021 06:20
@mmorel-35 mmorel-35 marked this pull request as ready for review April 17, 2021 06:29
@codecov-commenter
Copy link

codecov-commenter commented Apr 17, 2021

Codecov Report

Merging #329 (cc50af7) into main (6ede1a8) will increase coverage by 0.14%.
The diff coverage is 4.76%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #329      +/-   ##
==========================================
+ Coverage   52.58%   52.72%   +0.14%     
==========================================
  Files          60       60              
  Lines        4874     4874              
==========================================
+ Hits         2563     2570       +7     
+ Misses       2013     2002      -11     
- Partials      298      302       +4     
Flag Coverage Δ
1.0.3 52.72% <4.76%> (?)
1.1.2 52.72% <4.76%> (?)
1.2.0 52.72% <4.76%> (?)
1.3.0 52.72% <4.76%> (?)
1.4.0 52.72% <4.76%> (?)
2.0.4 52.72% <4.76%> (?)
2.1.0 52.72% <4.76%> (?)
2.2.0 52.72% <4.76%> (?)
2.3.0 52.72% <4.76%> (?)
community 52.72% <4.76%> (?)
integration 52.72% <4.76%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cmd/diff.go 75.00% <0.00%> (ø)
cmd/dump.go 24.24% <0.00%> (-0.25%) ⬇️
cmd/ping.go 38.46% <0.00%> (ø)
cmd/reset.go 27.86% <0.00%> (-0.47%) ⬇️
cmd/sync.go 72.72% <0.00%> (-2.28%) ⬇️
cmd/common.go 5.46% <10.00%> (+5.46%) ⬆️
dump/dump.go 1.56% <0.00%> (-0.01%) ⬇️
file/types.go 43.43% <0.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 6ede1a8...cc50af7. Read the comment docs.

@mmorel-35
Copy link
Contributor Author

The access to the version of kong shall be moved to the go-kong but there is a need for the client to be aware of the use of a workspace. There could also be a service to expose every versioned capabilities of kong like tags for credentials in deck or mtls authentication in kubernetes ingress controller. This way the semver dependency would only be required in go-kong

Copy link
Contributor

@mflendrich mflendrich left a comment

Choose a reason for hiding this comment

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

Thanks @mmorel-35 for looking into this.

There could also be a service to expose every versioned capabilities of kong

I think that would be the best approach for future maintainability; @rainest @shaneutt what do you think?

cmd/common.go Outdated Show resolved Hide resolved
Copy link
Contributor

@mflendrich mflendrich left a comment

Choose a reason for hiding this comment

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

See the comments/suggestions below, and please ensure that this works with Kong OSS and Enterprise (both with workspaces used with RBAC preventing access to the non-workspaced root and not). Unfortunately we don't have automated regression tests capturing that, but we need to ensure that we haven't broken anything in those scenarios before merging.

cmd/diff.go Outdated Show resolved Hide resolved
cmd/dump.go Outdated Show resolved Hide resolved
cmd/ping.go Outdated Show resolved Hide resolved
cmd/sync.go Outdated Show resolved Hide resolved
@mmorel-35 mmorel-35 marked this pull request as draft April 26, 2021 04:50
@mmorel-35 mmorel-35 marked this pull request as ready for review April 26, 2021 05:44
@hbagdi
Copy link
Member

hbagdi commented Apr 26, 2021

Unfortunately we don't have automated regression tests capturing that, but we need to ensure that we haven't broken anything in those scenarios before merging.

@mflendrich Did you mean to imply that we should add that in here before merging in?
I think adding integration tests like these requires more thought and should probably be out of scope from this PR.

@mmorel-35
Copy link
Contributor Author

mmorel-35 commented Apr 26, 2021

Following my suggestion from last week I created a PR on go-kong. So that the kongVersion() is hold by the client. The version is a string and has the format of the versions of the kic so it has more informations than what deck is actually showing. Also the test on the version to know if it's greater than 1.4.0 is in the response so deck don't need to do it and so don't need to have semver as a direct dependency.

It doesn't mean that this pr shouln'd be merged but if the go-Kong's one is accepted then a part of this will be replaced in the next version of go-kong.

@mflendrich
Copy link
Contributor

@mmorel-35, with the Kong/go-kong#65 PR moving the API machinery into go-kong, which parts of this PR are still relevant? Should we close it and follow up on Kong/go-kong#65 by using that API when that PR gets merged in?

On integration testing: we're tracking the direction for integration testing in deck in #63. I'll post this PR there as prior work, but I don't think we're ready to merge the test yet.

That being said, I think the best way forward would be to close this PR and follow up with:

  • (when the go-kong PR with the information service gets merged and released) using the go-kong information service for version retrieval
  • (when we make up our mind about integration testing) implement the integration test using this PR as reference

@mflendrich mflendrich closed this May 28, 2021
@mmorel-35
Copy link
Contributor Author

mmorel-35 commented May 28, 2021

I agree, this PR can be closed ! I don't think there is much left to keep with what's coming in go-kong.

@mmorel-35 mmorel-35 deleted the refactor/kongVersion branch May 29, 2021 06:54
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.

Simplify version detection
4 participants