Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: populate connectionlog count using a separate query#18629

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ethanndickson merged 1 commit intomainfromethan/populate-connection-log-count
Jul 15, 2025

Conversation

ethanndickson
Copy link
Member

@ethanndicksonethanndickson commentedJun 27, 2025
edited
Loading

This is the third PR for moving connection events out of the audit log.

This PR populatescount onConnectionLogResponse using a separate query, to preemptively mitigate the issue described in#17689. It's structurally identical to a portion of#18600, but for the connection log instead of the audit log.

Future PRs:

  • Implement a table in the Web UI for viewing connection logs.
  • Write a query to delete old events from the audit log, call it from dbpurge.
  • Write documentation for the endpoint / feature

@ethanndicksonethanndicksonforce-pushed theethan/connection-logs-api branch fromed8e139 to8cec6d1CompareJune 27, 2025 14:08
@ethanndicksonethanndicksonforce-pushed theethan/populate-connection-log-count branch froma031154 tod03fe73CompareJune 27, 2025 14:08
@ethanndicksonethanndicksonforce-pushed theethan/connection-logs-api branch from8cec6d1 to482a5d3CompareJune 30, 2025 04:28
@ethanndicksonethanndicksonforce-pushed theethan/populate-connection-log-count branch fromd03fe73 to8cbd44aCompareJune 30, 2025 04:28
@ethanndicksonethanndicksonforce-pushed theethan/connection-logs-api branch from482a5d3 toccc7539CompareJune 30, 2025 12:03
@ethanndicksonethanndicksonforce-pushed theethan/populate-connection-log-count branch from8cbd44a to09cbe49CompareJune 30, 2025 12:03
Copilot

This comment was marked as outdated.

@kacpersawkacpersaw marked this pull request as ready for reviewJuly 1, 2025 06:14
@ethanndicksonethanndickson marked this pull request as draftJuly 1, 2025 06:15
Copy link
Contributor

@kacpersawkacpersaw left a comment

Choose a reason for hiding this comment

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

LGTM - similar to my PR#18600

@ethanndicksonethanndicksonforce-pushed theethan/connection-logs-api branch fromccc7539 to406e3f4CompareJuly 2, 2025 04:20
@ethanndicksonethanndicksonforce-pushed theethan/populate-connection-log-count branch 3 times, most recently from713ca71 to33d8acbCompareJuly 2, 2025 05:52
@ethanndicksonethanndicksonforce-pushed theethan/populate-connection-log-count branch from33d8acb to1e3334bCompareJuly 2, 2025 09:31
@ethanndicksonethanndicksonforce-pushed theethan/connection-logs-api branch from88bf416 tocd30512CompareJuly 2, 2025 09:46
@ethanndicksonethanndicksonforce-pushed theethan/populate-connection-log-count branch from1e3334b to332f8daCompareJuly 2, 2025 09:46
@ethanndicksonethanndicksonforce-pushed theethan/connection-logs-api branch fromcd30512 to3a8822dCompareJuly 3, 2025 07:36
@ethanndicksonethanndicksonforce-pushed theethan/populate-connection-log-count branch from332f8da to6cd9d68CompareJuly 3, 2025 07:36
@ethanndicksonethanndickson marked this pull request as ready for reviewJuly 3, 2025 08:23
@ethanndicksonethanndicksonforce-pushed theethan/connection-logs-api branch from3a8822d to02a93e0CompareJuly 10, 2025 05:58
@ethanndicksonethanndicksonforce-pushed theethan/populate-connection-log-count branch from6cd9d68 to6fa4d22CompareJuly 10, 2025 05:58
@ethanndicksonethanndicksonforce-pushed theethan/connection-logs-api branch from02a93e0 to2231707CompareJuly 10, 2025 10:28
@ethanndicksonethanndicksonforce-pushed theethan/populate-connection-log-count branch 2 times, most recently from769b7a5 tofc195c3CompareJuly 10, 2025 10:50
Copy link
Contributor

@CopilotCopilotAI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for returning the total count of connection logs alongside paginated results by issuing a separate COUNT query.

  • API handler is updated to fetch and returnCount inConnectionLogResponse, with early exit on zero count.
  • searchquery.ConnectionLogs now returns a count filter, and corresponding tests are updated.
  • New SQL query, querier methods, authz, metrics, and tests are added to supportCountConnectionLogs.

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
FileDescription
enterprise/coderd/connectionlog.goCallCountConnectionLogs, early exit on zero, include count.
enterprise/coderd/connectionlog_test.goUpdated tests to assertlogs.Count for various scenarios.
coderd/searchquery/search.go & coderd/searchquery/search_test.goConnectionLogs now returnscountFilter; tests updated.
coderd/database/queries/connectionlogs.sql & queries.sql.goAddedCountConnectionLogs SQL and generated Go code.
coderd/database/querier.go & coderd/database/querier_test.goAddedCountConnectionLogs andCountAuthorizedConnectionLogs with tests.
coderd/database/dbmock/dbmock.goMock methods forCountConnectionLogs andCountAuthorizedConnectionLogs.
coderd/database/dbmetrics/querymetrics.goMetrics wrappers for the new count methods.
coderd/database/dbauthz/*.go & setup_test.go & dbauthz_test.goAuthorization logic and tests for counting connection logs.
Comments suppressed due to low confidence (1)

coderd/searchquery/search_test.go:430

  • [nitpick] The variable namevalues is ambiguous in this context. Consider renaming it to something likefilterParams oroffsetParams to clarify it holds the parameters for the offset query.
})

@ethanndicksonethanndicksonforce-pushed theethan/connection-logs-api branch from2231707 to133e51dCompareJuly 14, 2025 02:04
@ethanndicksonethanndicksonforce-pushed theethan/populate-connection-log-count branch fromfc195c3 todf2d839CompareJuly 14, 2025 02:04
@ethanndicksonethanndicksonforce-pushed theethan/connection-logs-api branch from133e51d tob8faf73CompareJuly 14, 2025 06:12
@ethanndicksonethanndicksonforce-pushed theethan/populate-connection-log-count branch fromdf2d839 to78cc56bCompareJuly 14, 2025 06:13
@ethanndicksonethanndicksonforce-pushed theethan/connection-logs-api branch fromb8faf73 to3ec1f06CompareJuly 15, 2025 03:33
@ethanndicksonethanndicksonforce-pushed theethan/populate-connection-log-count branch from78cc56b toe61fc41CompareJuly 15, 2025 03:33
@ethanndicksonethanndicksonforce-pushed theethan/connection-logs-api branch from3ec1f06 toc013e9fCompareJuly 15, 2025 04:00
@ethanndicksonethanndicksonforce-pushed theethan/populate-connection-log-count branch frome61fc41 to4055dd7CompareJuly 15, 2025 04:00
@ethanndicksonGraphite App
Copy link
MemberAuthor

ethanndickson commentedJul 15, 2025
edited
Loading

Merge activity

  • Jul 15, 4:35 AM UTC: A user started a stack merge that includes this pull request viaGraphite.
  • Jul 15, 4:45 AM UTC:Graphite couldn't merge this pull request because a downstack PRfeat: addconnectionlogs API #18628 failed to merge.
  • Jul 15, 4:55 AM UTC: A user started a stack merge that includes this pull request viaGraphite.
  • Jul 15, 4:57 AM UTC:Graphite rebased this pull request as part of a merge.
  • Jul 15, 5:03 AM UTC:@ethanndickson merged this pull request withGraphite.

@ethanndicksonethanndickson changed the base branch fromethan/connection-logs-api tographite-base/18629July 15, 2025 04:37
@ethanndicksonethanndickson changed the base branch fromgraphite-base/18629 tomainJuly 15, 2025 04:55
@ethanndicksonethanndicksonforce-pushed theethan/populate-connection-log-count branch from4055dd7 toe10a5cfCompareJuly 15, 2025 04:56
@ethanndicksonethanndickson merged commit7c077d3 intomainJul 15, 2025
26 checks passed
@ethanndicksonethanndickson deleted the ethan/populate-connection-log-count branchJuly 15, 2025 05:03
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJul 15, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

Copilot code reviewCopilotCopilot left review comments

@kacpersawkacpersawkacpersaw approved these changes

@deansheatherdeansheatherdeansheather approved these changes

Assignees

@ethanndicksonethanndickson

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@ethanndickson@kacpersaw@deansheather

[8]ページ先頭

©2009-2025 Movatter.jp