-
Notifications
You must be signed in to change notification settings - Fork 71
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
feat(frontend): migrate transactions to resource architecture #2493
feat(frontend): migrate transactions to resource architecture #2493
Conversation
434651c
to
cf183f0
Compare
f810cf8
to
0d2c098
Compare
$ref: "./grpc.yaml#/components/schemas/GRPCRequest" | ||
traceid: | ||
$ref: "./traceid.yaml#/components/schemas/TRACEIDRequest" | ||
http: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a mismatch between the resource version and the regular version, I removed the triggerSettings
to have them both work the same
Http: m.HTTPRequest(in.HTTP), | ||
Grpc: m.GRPCRequest(in.GRPC), | ||
Traceid: m.TRACEIDRequest(in.TraceID), | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing trigger settings
@@ -66,7 +66,7 @@ func (t Transaction) NewRun() TransactionRun { | |||
return TransactionRun{ | |||
TransactionID: t.ID, | |||
TransactionVersion: t.GetVersion(), | |||
CreatedAt: time.Now(), | |||
CreatedAt: time.Now().UTC(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a bug, we need to always use UTC from the server
return Transaction.FromRawTransaction(rawTransaction); | ||
} | ||
|
||
Transaction.FromRawTransaction = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, we have to support two versions of the transactions API object:
- resource (from the resource endpoints)
- regular raw version (from the result list home page)
import TransactionService from 'services/Transaction.service'; | ||
import {TTestApiEndpointBuilder} from 'types/Test.types'; | ||
import {TDraftTransaction} from 'types/Transaction.types'; | ||
|
||
const defaultHeaders = {'content-type': 'application/json', 'X-Tracetest-Augmented': 'true'}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Including the augmented header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure how this works, but just to be safe: for requesting the yaml definition, you need to NOT pass the header.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep we have that covered 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! my only question is about requesting the YAML for transactions, where you need to not pass the augmented header, and I'm not sure if it's being passed or not. other than that looks great!
9813abb
into
feat/transactions-as-resources
This PR updates the FE to work with the new transactions as resources BE changes
Changes
triggerSettings
object for triggersFixes
Checklist