Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ FROM alpine:3.21 AS sbom
WORKDIR /
ADD . /SBOM
RUN apk add --no-cache curl
RUN curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin v0.48.3
RUN curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin v0.68.1
RUN trivy fs --format spdx-json --output /sbom.spdx.json /SBOM
RUN trivy sbom /sbom.spdx.json --severity UNKNOWN,HIGH,CRITICAL --db-repository public.ecr.aws/aquasecurity/trivy-db --exit-code 1

Expand Down
16 changes: 14 additions & 2 deletions internal/operations/operation_updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,21 +310,33 @@ func (ou *operationUpdater) doUpdate(ctx context.Context, update *core.Operation
}

// Match a TX we already retrieved, if found add a specified Blockchain Transaction ID to it
var txnIDStr string
var idempotencyKeyStr string
var tx *core.Transaction
if op.Transaction != nil && update.BlockchainTXID != "" {
if op.Transaction != nil {
for _, candidate := range transactions {
if op.Transaction.Equals(candidate.ID) {
tx = candidate
txnIDStr = candidate.ID.String()
idempotencyKeyStr = string(candidate.IdempotencyKey)
Copy link
Contributor

@EnriqueL8 EnriqueL8 Dec 11, 2025

Choose a reason for hiding this comment

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

BTW incase anyone else looks at this, IdempotencyKey is not a pointer just a string type so safe to cast to string

break
}
}
}
if tx != nil {
if tx != nil && update.BlockchainTXID != "" {
if err := ou.txHelper.AddBlockchainTX(ctx, tx, update.BlockchainTXID); err != nil {
return err
}
}

// This is a key log line, where we can provide all pieces of correlation data a user needs:
// - The type of the operation
// - The plugin/connector
// - The idempotencyKey
// - The FF Transaction ID
// - The Operation ID
log.L(ctx).Infof("FF_OPERATION_UPDATE: namespace=%s plugin=%s type=%s status=%s operationId=%s transactionId=%s idempotencyKey='%s'", op.Namespace, op.Plugin, op.Type, update.Status, op.ID, txnIDStr, idempotencyKeyStr)

if handler, ok := ou.manager.handlers[op.Type]; ok {
if err := handler.OnOperationUpdate(ctx, op, update); err != nil {
return err
Expand Down
8 changes: 8 additions & 0 deletions internal/txwriter/txwriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,14 @@ func (tw *txWriter) processBatch(ctx context.Context, batch *txWriterBatch) erro
for _, op := range req.operations {
op.Transaction = txn.ID
operations = append(operations, op)

// This is a key log line, where we can provide all pieces of correlation data a user needs:
// - The type of the operation
// - The plugin/connector
// - The idempotencyKey
// - The FF Transaction ID
// - The Operation ID
log.L(ctx).Infof("FF_NEW_TRANSACTION_OPERATION: namespace=%s plugin=%s type=%s operationId=%s transactionId=%s idempotencyKey='%s'", op.Namespace, op.Plugin, op.Type, op.ID, txn.ID, txn.IdempotencyKey)
}
}
}
Expand Down
Loading