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

fix(client) don't expose executionId to public API #4611

Merged
merged 8 commits into from
Sep 20, 2024

Conversation

venetrius
Copy link
Member

related to: #4523

Copy link
Member

@tasso94 tasso94 left a comment

Choose a reason for hiding this comment

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

Cool that we align the behavior with how we do it for process instance IDs. 👍

❌ Can we add a test for this?

@venetrius
Copy link
Member Author

venetrius commented Sep 16, 2024

Hi @tasso94,

I have not tests for this fix for 2 reasons:

  • I have not found any tests the would test or even use DeferredFileValueImpl or DeferredFileValue
  • If the change is not deemed risky I could still add tests during the code freeze

Let me what you think.

@tasso94
Copy link
Member

tasso94 commented Sep 16, 2024

I have not found any tests

Here are the tests: FileSerializationIT.

Looking at this given you mainly have to copy what's there and maybe introduce another process model do you think it is doable? We can also pull this conversation on Slack 🙂

@venetrius
Copy link
Member Author

I added the new test to FileSerializationIT that already includes tests for DeferredFileValueImpl. I have not found it before as I was looking only for *Test.java files for existing tests and not for *IT.java files.

I did not find a ci:label that would run the IT tests for java external client.

@tasso94
Copy link
Member

tasso94 commented Sep 19, 2024

I did not find a ci:label that would run the IT tests for java external client.

Tests are executed in the assembly stage.

Copy link
Member

@tasso94 tasso94 left a comment

Choose a reason for hiding this comment

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

❓ When I revert the fix and run the new test, it doesn't fail. Why is that? 🤔

Copy link
Member

@tasso94 tasso94 left a comment

Choose a reason for hiding this comment

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

❓ Can you add another test for #getVariableTyped?

@tasso94 tasso94 force-pushed the 4523-don-t-expose-executionId-to-public-api branch from 5ceb96d to 3e1eed8 Compare September 20, 2024 07:32
Copy link
Member

@tasso94 tasso94 left a comment

Choose a reason for hiding this comment

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

❌ Now that we set the executionId for DeferredFileValueImpl, is there any situation where we use the processInstanceId? If not, can we remove the getter and setters?

Comment on lines 262 to 265
if(variableValue.getTypedValue() instanceof DeferredFileValueImpl) {
DeferredFileValueImpl deferredFileValue = (DeferredFileValueImpl) variableValue.getTypedValue();
deferredFileValue.setExecutionId(this.executionId);
}
Copy link
Member

Choose a reason for hiding this comment

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

❓ Can't we get rid of this code now that we pass the execution id to VariableValue?

Comment on lines 304 to 307
if(typedValue instanceof DeferredFileValueImpl) {
DeferredFileValueImpl deferredFileValue = (DeferredFileValueImpl) typedValue;
deferredFileValue.setExecutionId(this.executionId);
}
Copy link
Member

Choose a reason for hiding this comment

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

❓ Can't we get rid of this code now that we pass the execution id to VariableValue?

Copy link
Member Author

@venetrius venetrius Sep 20, 2024

Choose a reason for hiding this comment

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

Let me check.

Copy link
Member

@tasso94 tasso94 left a comment

Choose a reason for hiding this comment

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

Looks good! 👍

Pushed a small code cleanup and converted your white into a black box test.

Comment on lines 247 to 248
DeferredFileValueImpl typedValueImpl = (DeferredFileValueImpl) typedValue;
assertThat(typedValueImpl.getExecutionId()).isEqualTo(task.getExecutionId());
Copy link
Member

Choose a reason for hiding this comment

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

🔧 Let's keep using a white box test approach to a minimum. A black box should be the way to go.
We can fall back on white box tests only when a black box test is too difficult to achieve.

@venetrius venetrius merged commit 30ece18 into master Sep 20, 2024
2 checks passed
@venetrius venetrius deleted the 4523-don-t-expose-executionId-to-public-api branch September 20, 2024 14:29
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.

2 participants