Registry Mirror
Skip to content

Conversation

@unknwon

@unknwon unknwon commented May 28, 2022 •

Copy link
Copy Markdown
Contributor

Implements FetchCommitByID for GitHub VCS provider, adds unit tests for both GitHub and GitLab.


Part of #928

@unknwon
unknwon requested a review from d-bytebase as a code owner May 28, 2022 14:42
@cla-bot cla-bot Bot added the cla-signed label May 28, 2022

@d-bytebase d-bytebase left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LG otherwise.

Comment thread plugin/vcs/github/github.go Resolved
Comment thread plugin/vcs/github/github_test.go Resolved
@unknwon
unknwon requested a review from d-bytebase May 29, 2022 05:30
d-bytebase
d-bytebase previously approved these changes May 29, 2022
Comment thread plugin/vcs/github/github.go Resolved
Comment thread plugin/vcs/github/github.go Resolved
Comment thread plugin/vcs/gitlab/gitlab.go Resolved
@unknwon
unknwon requested a review from d-bytebase May 29, 2022 07:14
assert.Equal(t, want, got)
}

func TestProvider_FetchCommitByID(t *testing.T) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
func TestProvider_FetchCommitByID(t *testing.T) {
func TestProviderFetchCommitByID(t *testing.T) {

let's keep it consistent with other test name

@unknwon unknwon May 29, 2022 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This naming style is consistent with all other tests in github_test.go and gitlab_test.go. I think this is not concern within PR, but we can discuss and address this in a separate PR.

@d-bytebase d-bytebase May 29, 2022 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

SG. In general, sub-tests use the name of TestProvider_FetchCommitByID. Let's address the test naming consistency in a follow-up PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I checked all existing 82 test functions, it seems that only I have written tests for struct methods, which happens to use the pattern Test<T>_<method> ... that means unless we want to eliminate the use of underscore _ in tests name, there is no change needed at this point.

@h3n4l
h3n4l self-requested a review May 29, 2022 09:42
@d-bytebase
d-bytebase merged commit 1d85da3 into bytebase:main May 29, 2022
@unknwon
unknwon deleted the jc/FetchCommitByID branch May 29, 2022 10:13
d-bytebase added a commit that referenced this pull request Nov 18, 2026
Pin the routine-catalogue tolerance on top of 10972659bef0 instead of the omni
PR head, so the bump carries the Doris change and nothing else. The PR head also
carries #1417's SQL Server error-unwrapping change, which fails Bytebase's
recorded mssql parity corpus; that is another engine's behavior change and needs
its own pin-bump audit.
d-bytebase added a commit that referenced this pull request Nov 18, 2026
* refactor(doris): drive doris through omni

Cut backend/plugin/db/doris over to github.com/bytebase/omni/doris/driver.
The package is now an adapter over the omni driver: it maps
db.ConnectionConfig onto driver.Config, keeps Bytebase's SSH tunnel and TLS
material on this side of the seam, and converts the contract's results back
into v1pb.QueryResult and metadatapb.DatabaseSchemaMetadata. The catalog sync
queries, the server-DDL dump renderer, the value conversions and the
statement classification are deleted.

* Merge origin/main into cutover/doris, and hold the query session

A Query request's statements arrive one per QueryConn call on a driver the
editor keeps, so opening and closing a session per call lost the session
state a SET or a user variable set up. Hold one session until Close, as the
tidb and mysql adapters do, and drop it when a statement's context ends.

No conflicts: the branch touches only its engine package.

* fix(doris): pin the dump's routine tolerance and state the held session

The omni dump now keeps the objects it can state when a server refuses the
routine catalogue — a kernel built without the PL/SQL grammar, or an account
without the catalogue's privilege — instead of failing the whole dump, which
schema sync treats as fatal (BYT-10211). Pin the fix; it is bytebase/omni#1430.

Also say what QueryConn now does: the driver holds one session for its life, as
the session-state semantics of an editor stream require.

* chore(doris): pin the Doris dump fix on the current omni pin

Pin the routine-catalogue tolerance on top of 10972659bef0 instead of the omni
PR head, so the bump carries the Doris change and nothing else. The PR head also
carries #1417's SQL Server error-unwrapping change, which fails Bytebase's
recorded mssql parity corpus; that is another engine's behavior change and needs
its own pin-bump audit.

* fix(doris): serialize QueryConn on the held session

Hold the session lock for the whole call, as the mysql adapter does, so the
calls of one editor stream queue on the session instead of racing it: a
statement that takes the session with it (a failed call, an ended context)
cannot close a session another call is running on.
d-bytebase added a commit that referenced this pull request Nov 18, 2026
omni #1432 removed ast.MergeStmt with the StarRocks grammar's MERGE statement, so drop the three analysis cases that named it. The Doris residue the type read is now refused by the parser itself.

omni #1417 unpacks the server message a batch's row reader fails on, so the mssql cutover parity case that recorded the client text as a known difference is no longer a difference. Drop it, and normalize the container name an unpacked error carries so the recorded golden and the replay can compare.
d-bytebase added a commit that referenced this pull request Nov 18, 2026
omni #1432 removed ast.MergeStmt with the StarRocks grammar's MERGE statement, so drop the three analysis cases that named it. The Doris residue the type read is now refused by the parser itself.

omni #1417 unpacks the server message a batch's row reader fails on, so the mssql cutover parity case that recorded the client text as a known difference is no longer a difference. Drop it, and normalize the container name an unpacked error carries so the recorded golden and the replay can compare.
d-bytebase added a commit that referenced this pull request Nov 18, 2026
* fix(deps): update github.com/bytebase/omni digest to ffa6a5a

* fix(deps): update github.com/bytebase/omni to 3ffa03a

Pin current omni main (3ffa03a) merged with the Doris routine-catalogue tolerance from bytebase/omni#1430 (f48105aa), since #1430 is still unmerged. This keeps the BYT-10211 fix the previous pin carried; re-point at main once #1430 lands.

* fix(starrocks,mssql): adopt omni main's parser and error changes

omni #1432 removed ast.MergeStmt with the StarRocks grammar's MERGE statement, so drop the three analysis cases that named it. The Doris residue the type read is now refused by the parser itself.

omni #1417 unpacks the server message a batch's row reader fails on, so the mssql cutover parity case that recorded the client text as a known difference is no longer a difference. Drop it, and normalize the container name an unpacked error carries so the recorded golden and the replay can compare.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Danny Xu <d@bytebase.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.

3 participants