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

Add connection view implementation #10916

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

lekaf974
Copy link
Contributor

@lekaf974 lekaf974 commented May 10, 2024

Notes for Reviewers

This PR fixes (#10582) replaced by #10965

Signed commits

  • Yes, I signed my commits.

Copy link

github-actions bot commented May 10, 2024

@lekaf974 lekaf974 force-pushed the feature/exp-connections-view branch from 0a6a104 to 5be7b95 Compare May 10, 2024 11:28
@lekaf974 lekaf974 marked this pull request as ready for review May 10, 2024 17:44
@lekaf974 lekaf974 force-pushed the feature/exp-connections-view branch from 5be7b95 to 0810f62 Compare May 10, 2024 23:43
@leecalcote leecalcote requested a review from hexxdump May 13, 2024 22:17
mesheryctl/internal/cli/root/connections/view.go Outdated Show resolved Hide resolved
Comment on lines +199 to +224
if id != "" {
connectionId, err := uuid.FromString(q.Get("id"))

if err != nil {
h.log.Error(ErrInvalidUUID(err))
http.Error(w, ErrGetConnections(err).Error(), http.StatusBadRequest)
return
}

h.log.Debug("connection id : ", id)
token, _ := req.Context().Value(models.TokenCtxKey).(string)
connection, statusCode, err := provider.GetConnectionByID(token, connectionId)

if err != nil {
h.log.Error(ErrGetConnections(err))
http.Error(w, ErrGetConnections(err).Error(), statusCode)
return
}

if err := json.NewEncoder(w).Encode(connection); err != nil {
h.log.Error(models.ErrEncoding(err, "connection"))
http.Error(w, models.ErrEncoding(err, "connection").Error(), http.StatusInternalServerError)
return
}

}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we show error if user haven't provided connecction id, if yes what error we show?

Copy link
Contributor

Choose a reason for hiding this comment

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

@Yashsharma1911 , I believe the arg length checks in list.do, delete.go and view.go are taking care of this already.

@lekaf974, pls confirm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Yashsharma1911, sorry for delay so error is displayed on mesheryctl side only

On server side I just added id support but it is not required. If not provided it will display he list of available connections which is current behavior

There is a thread in slack related to this

mesheryctl/internal/cli/root/connections/view.go Outdated Show resolved Hide resolved
Copy link
Member

@leecalcote leecalcote left a comment

Choose a reason for hiding this comment

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

Please include the Meshery Docs update that accompanies this mesheryctl change. See the contributing to Meshery CLI guide for specific details on Docs changes relevant to mesheryctl specifically.

mesheryctl/internal/cli/root/connections/connections.go Outdated Show resolved Hide resolved
@leecalcote
Copy link
Member

@hexxdump look good?

mesheryctl/pkg/utils/helpers.go Outdated Show resolved Hide resolved
mesheryctl/pkg/utils/helpers.go Outdated Show resolved Hide resolved
@hexxdump
Copy link
Contributor

@hexxdump look good?

yes, looks good, just had some typos, pointed it out.

@lekaf974 lekaf974 force-pushed the feature/exp-connections-view branch 3 times, most recently from 40f1704 to 8a8248d Compare May 21, 2024 22:36
Copy link

codecov bot commented May 21, 2024

Codecov Report

Attention: Patch coverage is 0% with 36 lines in your changes are missing coverage. Please review.

Project coverage is 9.13%. Comparing base (17acf25) to head (91b8500).
Report is 78 commits behind head on master.

Files Patch % Lines
mesheryctl/pkg/utils/error.go 0.00% 18 Missing ⚠️
server/handlers/connections_handlers.go 0.00% 18 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10916      +/-   ##
==========================================
+ Coverage    9.00%    9.13%   +0.12%     
==========================================
  Files         146      146              
  Lines       19274    19279       +5     
==========================================
+ Hits         1736     1761      +25     
+ Misses      17236    17216      -20     
  Partials      302      302              
Flag Coverage Δ
unittests 9.13% <0.00%> (+0.12%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@leecalcote
Copy link
Member

Thank you, @hexxdump 👏

@leecalcote leecalcote requested a review from Jougan-0 May 29, 2024 22:46
@leecalcote
Copy link
Member

@Jougan-0 do you mind giving this a once-over?

@lekaf974
Copy link
Contributor Author

lekaf974 commented May 30, 2024

@MUzairS15 you were going to do changes in connection_handler replace /api/integrations/connections/{connectionKind} by /api/integrations/connections/{connectionId}, am I right ?

@MUzairS15
Copy link
Contributor

Yes I will be and your PR is complete already from your side

@lekaf974 lekaf974 force-pushed the feature/exp-connections-view branch from 8a8248d to 344ae54 Compare May 30, 2024 11:49
Signed-off-by: mevrin <matthieu.evrin@gmail.com>
Signed-off-by: mevrin <matthieu.evrin@gmail.com>
Signed-off-by: mevrin <matthieu.evrin@gmail.com>
Signed-off-by: mevrin <matthieu.evrin@gmail.com>
Signed-off-by: mevrin <matthieu.evrin@gmail.com>
@lekaf974 lekaf974 force-pushed the feature/exp-connections-view branch from 344ae54 to 91b8500 Compare May 30, 2024 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants