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

Back port of Task Thin Execution List and List By Name #6062

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

corneil
Copy link
Contributor

@corneil corneil commented Nov 11, 2024

Updates api docs for tasks/thinexecutions/name and all HATEOAS links. Updates related tests for links. Improved link handling and tests in TaskTemplate.
Original PR #5994
Issues #5991, #5973

Fixes #5995

@corneil corneil added the review/at-least-one Only one reviewer is required to merge this PR. label Nov 11, 2024
@corneil corneil requested review from cppwfs and onobc November 11, 2024 14:50
@onobc onobc added the type/backport Is a issue to track backport, use with branch/xxx label Nov 11, 2024
@onobc onobc self-assigned this Nov 11, 2024
Copy link
Contributor

@onobc onobc left a comment

Choose a reason for hiding this comment

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

Thanks for the back port @corneil . I have some questions. I notice there is also quite a few files modified in the source that is not in this PR. Please describe the discrepancies.

Thanks

@corneil
Copy link
Contributor Author

corneil commented Nov 11, 2024

I have resolved comments. There are a few elements I'll port to main to get parity.

corneil added a commit to corneil/spring-cloud-dataflow that referenced this pull request Nov 12, 2024
Updated task thin executions link handing and added extra test for parity with 2.11.x

See spring-cloud#6062
corneil added a commit to corneil/spring-cloud-dataflow that referenced this pull request Nov 12, 2024
Updated task thin executions link handing and added extra test for parity with 2.11.x

See spring-cloud#6062
corneil added a commit to corneil/spring-cloud-dataflow that referenced this pull request Nov 12, 2024
Updated task thin executions link handing and added extra test for parity with 2.11.x.
Update minimum supported version of client.

See spring-cloud#6062
corneil added a commit to corneil/spring-cloud-dataflow that referenced this pull request Nov 12, 2024
Updated task thin executions link handing and added extra test for parity with 2.11.x.
Update minimum supported version of client.

See spring-cloud#6062
@corneil corneil requested a review from onobc November 12, 2024 12:45
corneil added a commit to corneil/spring-cloud-dataflow that referenced this pull request Nov 12, 2024
Updated task thin executions link handing and added extra test for parity with 2.11.x.
Update minimum supported version of client.

See spring-cloud#6062
this.thinExecutionsByNameLink = resources.getLink(THIN_EXECUTIONS_BY_NAME_RELATION).orElse(null);
this.executionLaunchLink = resources.getLink(EXECUTION_LAUNCH_RELATION).orElse(null);
this.executionsCurrentLink = resources.getLink(EXECUTIONS_CURRENT_RELATION).orElse(null);
if(VersionUtils.isDataFlowServerVersionGreaterThanOrEqualToRequiredVersion(version, VALIDATION_THIN_TASK_VERSION) && resources.getLink(THIN_EXECUTIONS_RELATION).isPresent()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would consider moving this logic into a well-named helper method to avoid the repeat checks as its hard to read currently.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the resources.getLink(THIN_EXECUTIONS_RELATION).isPresent() from if

@@ -165,12 +181,7 @@ public class TaskTemplate implements TaskOperations {
this.executionLaunchLink = null;
}

if (VersionUtils.isDataFlowServerVersionGreaterThanOrEqualToRequiredVersion(version, EXECUTIONS_CURRENT_RELATION_VERSION)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did this move up? If its not required to be at the top, please keep it in place so as to avoid confusing during the review.

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 fixed the order to match the previous version.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer change history over matching order in a different branch. Please undo the change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will a squash into on commit not fix this so that the diff is smaller because the order is that same as before the PR branch?

@@ -283,18 +294,26 @@ public TaskExecutionResource.Page executionList() {
}

@Override
public PagedModel<TaskExecutionThinResource> thinExecutionList() {
public TaskExecutionThinResource.Page thinExecutionList() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Signature change? Seems breaking.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The result is the same type.

Copy link
Contributor

Choose a reason for hiding this comment

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

How is that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Well if they are the same let's leave it as is since this is a simple backport on what will be a patch release. What is the value in changing it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The other uses on tasks/execution uses the .Page I noticed when comparing the various tasks/executions and tasks/thinexecutions controller methods.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a lot cleaner as a result return restTemplate.getForObject(executionsLink.getHref(), TaskExecutionThinResource.Page.class);

@@ -4,7 +4,7 @@ if [ -z "$BASH_VERSION" ]; then
exit 1
fi
SCDIR=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
SCDIR=$(realpath $SCDIR)
pushd "$SCDIR" > /dev/null || exit
SCDIR=$(realpath "$SCDIR/../..")
Copy link
Contributor

Choose a reason for hiding this comment

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

I still don't understand what this has to do w/ thin executions

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'll move this to a separate PR

@@ -66,16 +65,17 @@ public class TaskTemplate implements TaskOperations {

private static final String EXECUTIONS_CURRENT_RELATION_VERSION = "1.7.0";

private static final String VALIDATION_RELATION_VERSION = "1.7.0";
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this deleted? Please add a comment.

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 restored that.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see it.

corneil added a commit to corneil/spring-cloud-dataflow that referenced this pull request Nov 14, 2024
Updated task thin executions link handing and added extra test for parity with 2.11.x.
Update minimum supported version of client.
Added test for invalid old version.

See spring-cloud#6062
@@ -134,51 +136,51 @@ public class TaskTemplate implements TaskOperations {
EXECUTION_RELATION_BY_NAME,
EXECUTIONS_INFO_RELATION,
PLATFORM_LIST_RELATION,
RETRIEVE_LOG
RETRIEVE_LOG,
VALIDATION_REL
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was rolled back in the version I want to push.

@corneil corneil requested a review from onobc November 14, 2024 13:56
Updated task thin executions link handing and added extra test for parity with 2.11.x.
Update minimum supported version of client.
Added test for invalid old version.

See spring-cloud#6062
@onobc onobc merged commit d7ff312 into spring-cloud:2.11.x Nov 14, 2024
2 of 3 checks passed
cppwfs pushed a commit to cppwfs/spring-cloud-dataflow that referenced this pull request Nov 14, 2024
Updated task thin executions link handing and added extra test for parity with 2.11.x

See spring-cloud#6062

Update Task Thin Executions list function for parity with 2.11.x

Updated task thin executions link handing and added extra test for parity with 2.11.x.
Update minimum supported version of client.

See spring-cloud#6062

Update Task Thin Executions list function for parity with 2.11.x

Updated task thin executions link handing and added extra test for parity with 2.11.x.
Update minimum supported version of client.

See spring-cloud#6062

Update Task Thin Executions list function for parity with 2.11.x

Updated task thin executions link handing and added extra test for parity with 2.11.x.
Update minimum supported version of client.

See spring-cloud#6062

Revised TaskTemplate to retain order of link init in the constructor.

Update Task Thin Executions list function for parity with 2.11.x

Updated task thin executions link handing and added extra test for parity with 2.11.x.
Update minimum supported version of client.
Added test for invalid old version.

See spring-cloud#6062
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review/at-least-one Only one reviewer is required to merge this PR. type/backport Is a issue to track backport, use with branch/xxx
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants