Skip to content

Commit

Permalink
Looks like MaxAttempts was defined twice (#168)
Browse files Browse the repository at this point in the history
* Looks like MaxAttempts was defined twice

* updated swagger.yml version and re-ran make generate
  • Loading branch information
toddobryan-clever authored Apr 8, 2019
1 parent 925b09f commit d1d6e91
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Orchestrator for AWS Step Functions


### Version information
*Version* : 0.9.4
*Version* : 0.9.5


### URI scheme
Expand Down
6 changes: 6 additions & 0 deletions gen-go/server/db/dynamodb/dynamodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ package dynamodb
import (
"context"
"errors"
"time"

"github.com/Clever/workflow-manager/gen-go/models"
"github.com/Clever/workflow-manager/gen-go/server/db"
"github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface"
"github.com/go-openapi/strfmt"
)

// Config is used to create a new DB struct.
Expand Down Expand Up @@ -99,3 +101,7 @@ func (d DB) GetWorkflowDefinitionsByNameAndVersion(ctx context.Context, input db
func (d DB) DeleteWorkflowDefinition(ctx context.Context, name string, version int64) error {
return d.workflowDefinitionTable.deleteWorkflowDefinition(ctx, name, version)
}

func toDynamoTimeString(d strfmt.DateTime) string {
return time.Time(d).Format(time.RFC3339) // dynamodb attributevalue only supports RFC3339 resolution
}
9 changes: 8 additions & 1 deletion gen-go/server/db/dynamodb/workflowdefinition.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ import (
"github.com/aws/aws-sdk-go/service/dynamodb"
"github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute"
"github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface"
"github.com/go-openapi/strfmt"
)

var _ = strfmt.DateTime{}

// WorkflowDefinitionTable represents the user-configurable properties of the WorkflowDefinition table.
type WorkflowDefinitionTable struct {
DynamoDBAPI dynamodbiface.DynamoDBAPI
Expand Down Expand Up @@ -153,7 +156,11 @@ func (t WorkflowDefinitionTable) getWorkflowDefinitionsByNameAndVersion(ctx cont
queryInput.ExpressionAttributeValues[":version"] = &dynamodb.AttributeValue{
N: aws.String(fmt.Sprintf("%d", *input.VersionStartingAt)),
}
queryInput.KeyConditionExpression = aws.String("#NAME = :name AND #VERSION >= :version")
if input.Descending {
queryInput.KeyConditionExpression = aws.String("#NAME = :name AND #VERSION <= :version")
} else {
queryInput.KeyConditionExpression = aws.String("#NAME = :name AND #VERSION >= :version")
}
}

queryOutput, err := t.DynamoDBAPI.QueryWithContext(ctx, queryInput)
Expand Down
2 changes: 1 addition & 1 deletion gen-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "workflow-manager",
"version": "0.9.4",
"version": "0.9.5",
"description": "Orchestrator for AWS Step Functions",
"main": "index.js",
"dependencies": {
Expand Down
4 changes: 1 addition & 3 deletions swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ info:
description: Orchestrator for AWS Step Functions
# when changing the version here, make sure to
# re-run `make generate` to generate clients and server
version: 0.9.4
version: 0.9.5
x-npm-package: workflow-manager
schemes:
- http
Expand Down Expand Up @@ -794,8 +794,6 @@ definitions:
properties:
IntervalSeconds:
type: integer
MaxAttempts:
type: integer
BackoffRate:
type: number
ErrorEquals:
Expand Down

0 comments on commit d1d6e91

Please sign in to comment.