Skip to content

Commit

Permalink
Merge pull request #284 from checkr/zz/bump-go-swagger
Browse files Browse the repository at this point in the history
Bump go-swagger
  • Loading branch information
zhouzhuojie authored Aug 30, 2019
2 parents 9a0c6d9 + 006cfa5 commit 13fcae7
Show file tree
Hide file tree
Showing 15 changed files with 78 additions and 61 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ gen: api_docs swagger

deps: checks
@GO111MODULE=off go get -u github.com/myitcv/gobin
@gobin github.com/go-swagger/go-swagger/cmd/swagger@v0.19.0
@gobin github.com/go-swagger/go-swagger/cmd/swagger@v0.20.1
@gobin github.com/codeskyblue/fswatch
@gobin github.com/golangci/golangci-lint/cmd/golangci-lint@v1.16.0
@echo "Sqlite3" && sqlite3 -version
Expand Down
2 changes: 1 addition & 1 deletion docs/api_docs/bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ paths:
get:
tags:
- export
operationId: getExportSQLite
operationId: getExportSqlite
description: >-
Export sqlite3 format of the db dump, which is converted from the main
database.
Expand Down
18 changes: 17 additions & 1 deletion integration_tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ step_7_test_evaluation()
step_8_test_preload()
{
flagr_url=$1:18000/api/v1
sleep 5

################################################
# Test preload for /flags (depends on ?preload=true/false
Expand All @@ -312,6 +311,22 @@ step_8_test_preload()
matches "\"variantID\":1"
}

step_9_test_export()
{
flagr_url=$1:18000/api/v1

################################################
# Test export
################################################
shakedown GET $flagr_url/export/sqlite
status 200

shakedown GET $flagr_url/export/eval_cache/json
status 200
matches "\"VariantKey\":\"key_1\""
matches "\"VariantID\":1"
}


start_test()
{
Expand All @@ -331,6 +346,7 @@ start_test()
step_6_test_crud_distribution $flagr_host
step_7_test_evaluation $flagr_host
step_8_test_preload $flagr_host
step_9_test_export $flagr_host
}

start(){
Expand Down
2 changes: 1 addition & 1 deletion pkg/handler/crud.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ func (c *crud) PutSegment(params segment.PutSegmentParams) middleware.Responder

func (c *crud) PutSegmentsReorder(params segment.PutSegmentsReorderParams) middleware.Responder {
tx := getDB().Begin()
for i, segmentID := range params.Body.SegmentIds {
for i, segmentID := range params.Body.SegmentIDs {
s := &entity.Segment{}
if err := tx.First(s, segmentID).Error; err != nil {
tx.Rollback()
Expand Down
4 changes: 2 additions & 2 deletions pkg/handler/crud_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ func TestCrudSegments(t *testing.T) {
res = c.PutSegmentsReorder(segment.PutSegmentsReorderParams{
FlagID: int64(1),
Body: &models.PutSegmentReorderRequest{
SegmentIds: []int64{int64(2), int64(1)},
SegmentIDs: []int64{int64(2), int64(1)},
},
})
assert.NotZero(t, res.(*segment.PutSegmentsReorderOK))
Expand Down Expand Up @@ -525,7 +525,7 @@ func TestCrudSegmentsWithFailures(t *testing.T) {
res = c.PutSegmentsReorder(segment.PutSegmentsReorderParams{
FlagID: int64(1),
Body: &models.PutSegmentReorderRequest{
SegmentIds: []int64{int64(999998), int64(1)},
SegmentIDs: []int64{int64(999998), int64(1)},
},
})
assert.NotZero(t, res.(*segment.PutSegmentsReorderDefault).Payload)
Expand Down
2 changes: 1 addition & 1 deletion pkg/handler/eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (e *eval) PostEvaluation(params evaluation.PostEvaluationParams) middleware

func (e *eval) PostEvaluationBatch(params evaluation.PostEvaluationBatchParams) middleware.Responder {
entities := params.Body.Entities
flagIDs := params.Body.FlagIds
flagIDs := params.Body.FlagIDs
flagKeys := params.Body.FlagKeys
results := &models.EvaluationBatchResponse{}

Expand Down
2 changes: 1 addition & 1 deletion pkg/handler/eval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ func TestPostEvaluationBatch(t *testing.T) {
EntityType: "entityType1",
},
},
FlagIds: []int64{100, 200},
FlagIDs: []int64{100, 200},
FlagKeys: []string{"flag_key_1", "flag_key_2"},
},
})
Expand Down
2 changes: 1 addition & 1 deletion swagger/export_sqlite.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
get:
tags:
- export
operationId: getExportSQLite
operationId: getExportSqlite
description: Export sqlite3 format of the db dump, which is converted from the main database.
produces:
- application/octet-stream
Expand Down
16 changes: 8 additions & 8 deletions swagger_gen/models/evaluation_batch_request.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions swagger_gen/models/put_segment_reorder_request.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion swagger_gen/restapi/configure_flagr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions swagger_gen/restapi/embedded_spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 28 additions & 28 deletions swagger_gen/restapi/operations/flag/find_flags_urlbuilder.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions swagger_gen/restapi/server.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 13fcae7

Please sign in to comment.