Skip to content
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

[CAPPL-320] implement HexDecodeWorkflowName #983

Merged
merged 5 commits into from
Jan 8, 2025

Conversation

agparadiso
Copy link
Contributor

@agparadiso agparadiso commented Jan 7, 2025

Description

This pr adds the DecodedWorkflowName field that will be used here in order to log the workflowname correctly to beholder
CAPPL-320

Requires

Supports

Comment on lines 90 to 96
// HexDecodeWorkflowName makes the best effort to decode the hex workflow name.
// In case of failure it will log the error and return the input name.
func HexDecodeWorkflowName(encoded string, logger logger.Logger) string {
decoded, err := hex.DecodeString(encoded)
if err != nil {
logger.Errorf("failed to decode WorkflowName %q: %v", encoded, err)
return encoded
Copy link
Collaborator

Choose a reason for hiding this comment

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

Passing a logger as a function argument is usually a code smell. Where is this used?

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've removed this, we are going to expose a new decodedWorkflowName as part of the metadata. The decoding will happen in chainlink instead. Will change the implementation there to not pass the logger 🙇🏼

MStreet3
MStreet3 previously approved these changes Jan 8, 2025
@MStreet3 MStreet3 merged commit 2ebd63b into main Jan 8, 2025
11 checks passed
@MStreet3 MStreet3 deleted the CAPPL-320_hex_decode_workflowname branch January 8, 2025 19:43
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.

4 participants