Skip to content

[CRE-2082] Execution Timestamp support in Engine#21319

Merged
bolekk merged 1 commit intodevelopfrom
feature_flags
Feb 27, 2026
Merged

[CRE-2082] Execution Timestamp support in Engine#21319
bolekk merged 1 commit intodevelopfrom
feature_flags

Conversation

@bolekk
Copy link
Contributor

@bolekk bolekk commented Feb 26, 2026

No description provided.

@bolekk bolekk changed the title [CRE] Execution IDs compatible with multi-triggers [CRE] Execution Timestamp Feb 26, 2026
@github-actions
Copy link
Contributor

I see you updated files related to core. Please run make gocs in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 26, 2026

✅ No conflicts with other open PRs targeting develop

@bolekk bolekk force-pushed the feature_flags branch 4 times, most recently from f5713d9 to 3207e66 Compare February 26, 2026 21:23
@bolekk bolekk changed the title [CRE] Execution Timestamp [CRE] Execution Timestamp support in Engine Feb 26, 2026
@bolekk bolekk marked this pull request as ready for review February 26, 2026 23:06
@bolekk bolekk requested review from a team as code owners February 26, 2026 23:06
@bolekk bolekk changed the title [CRE] Execution Timestamp support in Engine [CRE-2082] Execution Timestamp support in Engine Feb 26, 2026
Comment on lines +354 to +387
func GenerateExecutionID(workflowID, triggerEventID string) (string, error) {
s := sha256.New()
_, err := s.Write([]byte(workflowID))
if err != nil {
return "", err
}

_, err = s.Write([]byte(triggerEventID))
if err != nil {
return "", err
}

return hex.EncodeToString(s.Sum(nil)), nil
}

func GenerateExecutionIDWithTriggerIndex(workflowID, triggerEventID string, triggerIndex int) (string, error) {
s := sha256.New()
_, err := s.Write([]byte(workflowID))
if err != nil {
return "", err
}

_, err = s.Write([]byte(triggerEventID))
if err != nil {
return "", err
}

_, err = s.Write([]byte(strconv.Itoa(triggerIndex)))
if err != nil {
return "", err
}

return hex.EncodeToString(s.Sum(nil)), nil
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's just have one function that hashes everything (it is 1-1 compatible with the previous one)

Suggested change
}
func GenerateExecutionID(args ...any) (string, error) {
s := sha256.New()
_, err := s.Write([]byte(fmt.Sprint(args...)))
if err != nil {
return "", err
}
return hex.EncodeToString(s.Sum(nil)), nil
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was planning to remove the old one once the feature is rolled out but that's OK too, thank.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On second thoughts, I think it's safer to have named arguments. Otherwise it's easy to make a mistake and call it with different order or with missing params.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sure, you can still have named arguments but implementation can be made concise using fmt.Sprint

return
}

// Fetch organization ID for this execution
Copy link
Contributor Author

@bolekk bolekk Feb 27, 2026

Choose a reason for hiding this comment

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

@patrickhuie19 can we do this once on Engine init instead of on every execution?

@trunk-io
Copy link

trunk-io bot commented Feb 27, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@cl-sonarqube-production
Copy link

@bolekk bolekk enabled auto-merge February 27, 2026 21:07
@bolekk bolekk added this pull request to the merge queue Feb 27, 2026
Merged via the queue into develop with commit be4b540 Feb 27, 2026
225 of 229 checks passed
@bolekk bolekk deleted the feature_flags branch February 27, 2026 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants