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

refactor: CLI client interface #1839

Merged
merged 124 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
a8d6791
initial version of http server and client
nasdf Aug 11, 2023
25d2250
update lens client http base url
nasdf Aug 11, 2023
1e70947
integration tests working with http client
nasdf Aug 11, 2023
466fe78
fix linter errors
nasdf Aug 11, 2023
d86ee90
fixes to make more tests pass
nasdf Aug 11, 2023
ef58ecd
add http subscription logic
nasdf Aug 14, 2023
da866b5
implement more http collection methods
nasdf Aug 14, 2023
1c3c828
implement lens http server and client
nasdf Aug 14, 2023
6a8e798
refactor http client and server for better use in testing. move clien…
nasdf Aug 15, 2023
0162b1c
implement http transaction api
nasdf Aug 16, 2023
38d0f0e
http client fixes
nasdf Aug 16, 2023
7f00cba
clean document after save and update
nasdf Aug 19, 2023
9962325
more http client test fixes
nasdf Aug 22, 2023
f5c29b3
almost all tests passing
nasdf Aug 22, 2023
6a72bb6
fix lint errors
nasdf Aug 22, 2023
ce0054a
Merge branch 'develop' into nasdf/refactor/api-client-interface
nasdf Aug 22, 2023
508cd83
enable all tests
nasdf Aug 22, 2023
0ebf11c
fix http lens client with incorrect method path
nasdf Aug 22, 2023
677f18f
fix http transaction middleware
nasdf Aug 22, 2023
48a4103
handle transaction conflict errors in http client
nasdf Aug 23, 2023
41ce1cd
update lens getMigrations test logic
nasdf Aug 23, 2023
edd246e
fix linter warnings
nasdf Aug 23, 2023
181d6c3
fix race in event publish
nasdf Aug 24, 2023
680efcd
add wait group sync to publisher
nasdf Aug 24, 2023
b6f7d4a
fix bug in memory datastore
nasdf Aug 24, 2023
166080e
fix memory transaction deadlock
nasdf Aug 24, 2023
509cf00
use transaction close lock in memory datastore
nasdf Aug 24, 2023
add612f
revert publisher changes
nasdf Aug 24, 2023
b8614a3
disable lens transactions in http middleware
nasdf Aug 24, 2023
efbc15c
enable transaction middleware. make http client WithTxn public
nasdf Aug 24, 2023
dc4bbdd
change http server implementation to chi
nasdf Aug 25, 2023
b0eda37
increase test timeout
nasdf Aug 25, 2023
b9dfeb1
move compare logic for integration tests. implement AnyOf comparison …
nasdf Aug 25, 2023
7a2ec0e
more test cleanup
nasdf Aug 25, 2023
0854393
cleanup
nasdf Aug 25, 2023
e89d045
add logger middleware
nasdf Aug 25, 2023
51590d3
add generic functions for array test helpers. rename compare to results
nasdf Aug 28, 2023
cfd66a4
add generic helper for trimExplainAttributes
nasdf Aug 28, 2023
dc859a9
Merge branch 'develop' into nasdf/refactor/api-client-interface
nasdf Aug 28, 2023
13c98fc
more cleanup. add PrintDump to http client
nasdf Aug 28, 2023
b054e77
merge api/http package into http
nasdf Aug 28, 2023
e3823d3
remove api/http and net/api packages. update cli with new http client
nasdf Aug 29, 2023
8fcd3e4
cleanup
nasdf Aug 29, 2023
dd78c6e
implement wrapper for cli integration tests
nasdf Aug 30, 2023
99fa2d4
all cli tests passing
nasdf Aug 30, 2023
e13745e
restore server dump cli command
nasdf Aug 30, 2023
c157fb7
move config functions to utils
nasdf Aug 30, 2023
33ccbf9
add document commands to cli
nasdf Aug 31, 2023
d5d9afb
add missing lens commands
nasdf Aug 31, 2023
3333e6a
remove todo comment
nasdf Aug 31, 2023
2de06d1
Merge branch 'develop' into nasdf/refactor/api-client-interface
nasdf Aug 31, 2023
8146640
update http client names to better match interfaces
nasdf Aug 31, 2023
fd20479
improve http error parsing. fix bug in collection get http handler
nasdf Aug 31, 2023
f1d0d6a
Merge branch 'nasdf/refactor/api-client-interface' into nasdf/refacto…
nasdf Aug 31, 2023
19c734b
implement client document update to fix failing tests
nasdf Aug 31, 2023
17fa8be
revert test case changes that are fixed now
nasdf Aug 31, 2023
5f4e043
add generic resultOptionsAreEqual test function
nasdf Sep 1, 2023
9f88fef
test utils cleanup. fix change detector defaults
nasdf Sep 1, 2023
7b12e04
add comments to ignored close errors in http client
nasdf Sep 1, 2023
7f7f747
add http middleware context documentation
nasdf Sep 1, 2023
5f96d78
relax comparisons when testing non go clients
nasdf Sep 1, 2023
1a9f3b6
Merge branch 'nasdf/refactor/api-client-interface' into nasdf/refacto…
nasdf Sep 1, 2023
31f9b98
add error documentation. restore lens test comment
nasdf Sep 5, 2023
cba08de
only test go client by default. allow change detector with any client…
nasdf Sep 5, 2023
4dded7d
clean up generic function calls. remove comment notes. adjust assertR…
nasdf Sep 5, 2023
df79ef4
fix lens http client parsing bug
nasdf Sep 5, 2023
8c4a952
Merge branch 'nasdf/refactor/api-client-interface' into nasdf/refacto…
nasdf Sep 5, 2023
34dd82c
update test makefile targets to include cli
nasdf Sep 6, 2023
05f6f80
fix bug with body parsing logic in lens migrate handlers
nasdf Sep 6, 2023
a677807
Merge branch 'nasdf/refactor/api-client-interface' into nasdf/refacto…
nasdf Sep 6, 2023
97efa00
fix bug in http lens client migrate
nasdf Sep 6, 2023
2be26a4
Merge branch 'nasdf/refactor/api-client-interface' into nasdf/refacto…
nasdf Sep 6, 2023
38696f8
fix logic in cli lens migrate
nasdf Sep 6, 2023
4af5f0d
Merge branch 'develop' into nasdf/refactor/cli-client-interface
nasdf Sep 8, 2023
7d27374
regenerate cli docs
nasdf Sep 8, 2023
9db73fd
fix linter error
nasdf Sep 8, 2023
df81848
cli doc updates
nasdf Sep 8, 2023
3f4c940
setup test matrix.
nasdf Sep 8, 2023
25eb1cc
add code coverage to run-tests workflow. remove code-test-coverage wo…
nasdf Sep 11, 2023
95200e6
use makefile for run-tests workflow. use a single step for codecov up…
nasdf Sep 12, 2023
a6c6876
add missing runs-on property to run-tests workflow
nasdf Sep 12, 2023
4f4bb35
set retention for coverage files. add coverpkg flag to test:ci Make t…
nasdf Sep 12, 2023
9cfbbb7
fix incorrect make command in run-tests workflow
nasdf Sep 12, 2023
820c014
Merge branch 'develop' into nasdf/refactor/cli-client-interface
nasdf Sep 13, 2023
5dfb0b3
add peer info http endoing and cli command
nasdf Sep 13, 2023
2dd2c84
fix create many document cli and http handler
nasdf Sep 14, 2023
20605e6
Merge branch 'develop' into nasdf/refactor/cli-client-interface
nasdf Sep 20, 2023
936e931
silence usage on error
nasdf Sep 20, 2023
307ce52
fix playground handler type
nasdf Sep 20, 2023
73eddb2
Merge branch 'develop' into nasdf/ci/test-matrix
nasdf Sep 20, 2023
a349561
replace go-acc with go 1.20 aggregate test coverage. add change detec…
nasdf Sep 20, 2023
6662cf3
fix missing Makefile target
nasdf Sep 20, 2023
80784f6
remove detect-change workflow. update run-tests matrix to include cha…
nasdf Sep 20, 2023
d9be82d
add change-detector matrix variable to run-tests workflow
nasdf Sep 20, 2023
e78166c
Merge branch 'develop' into nasdf/refactor/cli-client-interface
nasdf Sep 20, 2023
5a4aa5d
increase test timeout in Makefile
nasdf Sep 20, 2023
3d9ff8d
Merge branch 'nasdf/ci/test-matrix' into nasdf/refactor/cli-client-in…
nasdf Sep 20, 2023
652bd3b
add missing env variable to run-tests
nasdf Sep 20, 2023
04955c2
increase timeout on test:changes Makefile target
nasdf Sep 20, 2023
9f5c6eb
disable change detector in test matrix for now
nasdf Sep 20, 2023
3a08b36
Merge branch 'develop' into nasdf/refactor/cli-client-interface
nasdf Sep 27, 2023
3b65bc4
enable change detector in test matrix
nasdf Sep 27, 2023
28b087b
don't upload test coverage when running change detector matrix job
nasdf Sep 27, 2023
9977c38
checkout code before uploading test coverage
nasdf Sep 27, 2023
a3e7586
restore cli version_test
nasdf Sep 27, 2023
2b32b0a
add cli context key documentation
nasdf Sep 27, 2023
1220625
rename run-tests workflow to run-tests-and-upload-coverage. rename Ma…
nasdf Sep 28, 2023
9389969
add exit code to defradb main command
nasdf Sep 28, 2023
a79e88e
update run-tests-and-upload-coverage workflow name
nasdf Sep 28, 2023
26d8f72
add comment about ignored error in cmd/defradb/main.go
nasdf Sep 28, 2023
f0c89b9
simplify cli store context value retrieval
nasdf Sep 29, 2023
25f36ee
fix getall command names
nasdf Sep 29, 2023
8158750
fix license header year
nasdf Sep 29, 2023
dd34f90
rename cli document commands to collection
nasdf Sep 30, 2023
789476f
cleanup cli errors
nasdf Sep 30, 2023
d8b5827
update cli schema migration up and down documentation
nasdf Sep 30, 2023
3255d05
move client wrappers to tests/clients package
nasdf Sep 30, 2023
8788f4b
Merge branch 'develop' into nasdf/refactor/cli-client-interface
nasdf Sep 30, 2023
0ad7eb3
update run-tests-and-upload-coverage workflow triggers
nasdf Oct 2, 2023
0b3514e
add cli collection context helper
nasdf Oct 2, 2023
abf9978
Merge branch 'develop' into nasdf/refactor/cli-client-interface
nasdf Oct 2, 2023
70b2420
fixes for cli lens migrate up and down
nasdf Oct 2, 2023
1e65462
add a few more stdin args
nasdf Oct 2, 2023
cd5d0ac
fix http cors middleware
nasdf Oct 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 0 additions & 76 deletions .github/workflows/code-test-coverage.yml

This file was deleted.

55 changes: 0 additions & 55 deletions .github/workflows/detect-change.yml

This file was deleted.

103 changes: 103 additions & 0 deletions .github/workflows/run-tests-and-upload-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Copyright 2022 Democratized Data Foundation
#
# Use of this software is governed by the Business Source License
# included in the file licenses/BSL.txt.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software will be governed
# by the Apache License, Version 2.0, included in the file
# licenses/APL.txt.

name: Run Tests And Upload Coverage Workflow

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
branches:
- master
- develop

jobs:
run-tests:
name: Run tests matrix job

runs-on: ubuntu-latest

strategy:
matrix:
client-type: [go, http, cli]
database-type: [badger-file, badger-memory]
mutation-type: [gql, collection-named, collection-save]
detect-changes: [false]
include:
- client-type: go
database-type: badger-memory
mutation-type: collection-save
detect-changes: true

env:
DEFRA_CLIENT_GO: ${{ matrix.client-type == 'go' }}
DEFRA_CLIENT_HTTP: ${{ matrix.client-type == 'http' }}
DEFRA_CLIENT_CLI: ${{ matrix.client-type == 'cli' }}
DEFRA_BADGER_MEMORY: ${{ matrix.database-type == 'badger-memory' }}
DEFRA_BADGER_FILE: ${{ matrix.database-type == 'badger-file' }}
DEFRA_MUTATION_TYPE: ${{ matrix.mutation-type }}

steps:
- name: Checkout code into the directory
uses: actions/checkout@v3

- name: Setup Go environment explicitly
uses: actions/setup-go@v3
with:
go-version: "1.20"
check-latest: true

- name: Build dependencies
run: |
make deps:modules
make deps:test

- name: Run integration tests
if: ${{ !matrix.detect-changes }}
run: make test:coverage

- name: Run change detector tests
if: ${{ matrix.detect-changes }}
run: make test:changes

- name: Upload coverage artifact
if: ${{ !matrix.detect-changes }}
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.client-type }}_${{ matrix.database-type }}_${{ matrix.mutation-type }}
path: coverage.txt
if-no-files-found: error
retention-days: 1

upload-coverage:
name: Upload test code coverage job

runs-on: ubuntu-latest

needs: run-tests

steps:
- name: Checkout code into the directory
uses: actions/checkout@v3

- name: Download coverage reports
uses: actions/download-artifact@v3
with:
path: coverage_reports

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: defradb-codecov
flags: all-tests
os: 'linux'
fail_ci_if_error: true
verbose: true
50 changes: 0 additions & 50 deletions .github/workflows/run-tests.yml

This file was deleted.

54 changes: 0 additions & 54 deletions .github/workflows/test-collection-named.yml

This file was deleted.

48 changes: 0 additions & 48 deletions .github/workflows/test-gql-mutations.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ cmd/defradb/defradb
cmd/genclidocs/genclidocs
cmd/genmanpages/genmanpages
coverage.txt
coverage
tests/bench/*.log
tests/bench/*.svg

Expand Down
Loading