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

Return connectionStatus command db field #4419

Merged
merged 4 commits into from
Jul 9, 2024

Conversation

chilagrow
Copy link
Member

@chilagrow chilagrow commented Jul 4, 2024

Description

This PR adds db field in the response of connectionStatus command. The response looks like this with db field added.

bson.D{
	{"authInfo", bson.D{
		{"authenticatedUsers", bson.A{bson.D{
			{"user", "testuser"},
			{"db", "testdb"}
		}}},
		{"authenticatedUserRoles", bson.A{}},
	}},
	{"ok", float64(1)},
}

Closes #4166.

Readiness checklist

  • I added/updated unit tests (and they pass).
  • I added/updated integration/compatibility tests (and they pass).
  • I added/updated comments and checked rendering.
  • I made spot refactorings.
  • I updated user documentation.
  • I ran task all, and it passed.
  • I ensured that PR title is good enough for the changelog.
  • (for maintainers only) I set Reviewers (@FerretDB/core), Milestone (Next), Labels, Project and project's Sprint fields.
  • I marked all done items in this checklist.

@chilagrow chilagrow added the code/chore Code maintenance improvements label Jul 4, 2024
@chilagrow chilagrow added this to the Next milestone Jul 4, 2024
@chilagrow chilagrow self-assigned this Jul 4, 2024
Copy link

codecov bot commented Jul 4, 2024

Codecov Report

Attention: Patch coverage is 97.14286% with 1 line in your changes missing coverage. Please review.

Project coverage is 73.89%. Comparing base (5a93ea5) to head (90bcf8c).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4419      +/-   ##
==========================================
- Coverage   73.95%   73.89%   -0.07%     
==========================================
  Files         327      327              
  Lines       22652    22672      +20     
==========================================
  Hits        16753    16753              
- Misses       4674     4687      +13     
- Partials     1225     1232       +7     
Files Coverage Δ
integration/integration.go 84.83% <100.00%> (+1.28%) ⬆️
integration/setup/setup.go 78.74% <100.00%> (ø)
internal/backends/mysql/metadata/registry.go 63.75% <100.00%> (ø)
internal/backends/postgresql/metadata/registry.go 71.95% <100.00%> (-0.41%) ⬇️
internal/clientconn/conninfo/conn_info.go 86.66% <100.00%> (+0.30%) ⬆️
internal/handler/commands.go 94.53% <100.00%> (ø)
internal/handler/msg_connectionstatus.go 100.00% <100.00%> (ø)
internal/handler/msg_logout.go 100.00% <100.00%> (ø)
internal/handler/msg_saslcontinue.go 75.00% <100.00%> (ø)
internal/handler/msg_saslstart.go 84.90% <75.00%> (ø)

... and 8 files with indirect coverage changes

Flag Coverage Δ
filter-true 66.82% <94.28%> (-0.07%) ⬇️
hana-1 ?
integration 66.82% <94.28%> (-0.07%) ⬇️
mongodb-1 5.30% <57.14%> (+0.07%) ⬆️
postgresql-1 42.40% <80.00%> (+0.20%) ⬆️
postgresql-2 42.29% <80.00%> (-0.03%) ⬇️
postgresql-3 42.13% <88.57%> (+0.03%) ⬆️
postgresql-4 43.77% <88.57%> (+0.03%) ⬆️
postgresql-5 45.09% <91.42%> (+0.01%) ⬆️
sqlite-1 41.55% <77.14%> (+0.20%) ⬆️
sqlite-2 41.62% <77.14%> (+0.05%) ⬆️
sqlite-3 41.36% <85.71%> (+0.01%) ⬆️
sqlite-4 42.80% <85.71%> (+0.08%) ⬆️
sqlite-5 44.37% <88.57%> (+0.06%) ⬆️
unit 33.65% <53.33%> (+<0.01%) ⬆️

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

@chilagrow chilagrow changed the title Return connectionStatus command authInfo user db field Return connectionStatus command authInfo.user.db field Jul 4, 2024
@chilagrow chilagrow changed the title Return connectionStatus command authInfo.user.db field Return connectionStatus command db field Jul 4, 2024
@chilagrow chilagrow marked this pull request as ready for review July 4, 2024 02:33
@chilagrow chilagrow requested review from AlekSi and a team as code owners July 4, 2024 02:33
@chilagrow chilagrow requested review from rumyantseva, a team and noisersup July 4, 2024 02:33
@chilagrow chilagrow enabled auto-merge (squash) July 4, 2024 02:33
Copy link
Contributor

@rumyantseva rumyantseva left a comment

Choose a reason for hiding this comment

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

Looks good! Do we need to add issue number to the PR description?

@chilagrow chilagrow merged commit 8212d86 into FerretDB:main Jul 9, 2024
31 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/chore Code maintenance improvements
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add db field to connectionStatus command response
3 participants