Skip to content

Conversation

@pyricau
Copy link
Member

@pyricau pyricau commented Feb 28, 2023

Also removing noise from some of the toString()

@CLAassistant
Copy link

CLAassistant commented Feb 28, 2023

CLA assistant check
All committers have signed the CLA.

@pyricau pyricau force-pushed the py/causal_traces branch 2 times, most recently from 181d348 to 73fbacc Compare February 28, 2023 06:48
override fun toString(): String =
WorkflowIdentifierTypeNamer.uniqueName(EmitWorkerOutputAction::class) +
"(worker=$worker, key=\"$renderKey\")"
"(worker=$worker, key=$renderKey)"
Copy link
Member Author

Choose a reason for hiding this comment

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

We typically don't use " in logged names.

@pyricau pyricau force-pushed the py/causal_traces branch 3 times, most recently from 9364383 to 16b82d6 Compare March 2, 2023 05:06
@pyricau pyricau changed the title Workflow interceptor that keeps track of causes Add interceptor methods: onNextRendering, onSnapshotTree Mar 2, 2023
@pyricau pyricau marked this pull request as ready for review March 2, 2023 05:07
@pyricau pyricau requested review from a team and zach-klippenstein as code owners March 2, 2023 05:07
@pyricau pyricau force-pushed the py/causal_traces branch from 16b82d6 to 7622589 Compare March 2, 2023 17:35
Copy link
Collaborator

@rjrjr rjrjr left a comment

Choose a reason for hiding this comment

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

Could you add a commit message explaining why this is needed, what use case it unlocks?

): S = proceed(old, new, state)

/**
* Intercept calls to [com.squareup.workflow1.internal.WorkflowRunner.nextRendering].
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* Intercept calls to [com.squareup.workflow1.internal.WorkflowRunner.nextRendering].
* Intercept calls to [WorkflowRunner.nextRendering][com.squareup.workflow1.internal.WorkflowRunner.nextRendering].

Copy link
Contributor

Choose a reason for hiding this comment

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

This definitely needs kdoc here as we are intercepting an internal method in the Runner.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

): S = proceed(old, new, state)

/**
* Intercept calls to [com.squareup.workflow1.internal.WorkflowRunner.nextRendering].
Copy link
Contributor

Choose a reason for hiding this comment

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

This definitely needs kdoc here as we are intercepting an internal method in the Runner.

/**
* Intercept calls to [StatefulWorkflow.snapshotState] including the children calls.
*/
public fun onSnapshotTree(
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a bit confusing. Why not onSnapshotStateWithChildren? Also could use kdoc explaining use case.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@pyricau pyricau force-pushed the py/causal_traces branch from 7622589 to 6dd59b3 Compare March 4, 2023 00:33

override val realIdentifier: WorkflowIdentifier = unsnapshottableIdentifier(workerType)
override fun describeRealIdentifier(): String = "worker $workerType"
override fun describeRealIdentifier(): String = workerType.toString()
Copy link
Member Author

Choose a reason for hiding this comment

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

the workers have names that make it clear they're workers, no need for this.

}
}

override fun toString() = debugString
Copy link
Member Author

Choose a reason for hiding this comment

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

Removing WorkflowNodeId(identifier=foo, name=bar) to just foo and foo named bar

@rjrjr
Copy link
Collaborator

rjrjr commented Mar 4, 2023

Still would like to see a commit message explaining what use case this unlocked.

@steve-the-edwards
Copy link
Contributor

@pyricau you can use ./gradlew -p . apiDump to update the API check.

@pyricau pyricau force-pushed the py/causal_traces branch from 6dd59b3 to 53ae4eb Compare March 6, 2023 22:50
Copy link
Contributor

@steve-the-edwards steve-the-edwards left a comment

Choose a reason for hiding this comment

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

LGTM

Also removing noise from some of the toString()
@pyricau pyricau force-pushed the py/causal_traces branch from 53ae4eb to 7ed7aff Compare March 7, 2023 17:57
@pyricau pyricau enabled auto-merge March 7, 2023 18:01
@pyricau pyricau merged commit 3d3986e into main Mar 7, 2023
@pyricau pyricau deleted the py/causal_traces branch March 7, 2023 21:19
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