-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
feat: return whether configuration was updated as part of api response #21466
Merged
Merged
Changes from 7 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
c275ea0
wip: return whether configuration was updated
pedroslopez ae02e55
Merge branch 'master' into pedroslopez/config-updated-api
pedroslopez e156156
updated outputs working
pedroslopez 62ef865
fix pmd
pedroslopez ae8bfb0
update description, format
pedroslopez 401d21e
add didUpdateConfiguration to metadata, rm unneeded generics
pedroslopez 7365188
add didUpdateConfiguration to api response
pedroslopez 8244fc1
update name to fix pmd
pedroslopez 6be8708
not required
pedroslopez 37b734d
rename to match api response
pedroslopez 269cdcc
remove unused field
pedroslopez b82c872
match naming
pedroslopez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -170,18 +170,18 @@ public SynchronousResponse<ConnectorSpecification> createGetSpecJob(final String | |
} | ||
|
||
@VisibleForTesting | ||
<T, U> SynchronousResponse<T> execute(final ConfigType configType, | ||
final ConnectorJobReportingContext jobContext, | ||
@Nullable final UUID connectorDefinitionId, | ||
final Supplier<TemporalResponse<U>> executor, | ||
final Function<U, T> outputMapper, | ||
final UUID workspaceId) { | ||
<T> SynchronousResponse<T> execute(final ConfigType configType, | ||
final ConnectorJobReportingContext jobContext, | ||
@Nullable final UUID connectorDefinitionId, | ||
final Supplier<TemporalResponse<ConnectorJobOutput>> executor, | ||
final Function<ConnectorJobOutput, T> outputMapper, | ||
final UUID workspaceId) { | ||
final long createdAt = Instant.now().toEpochMilli(); | ||
final UUID jobId = jobContext.jobId(); | ||
try { | ||
track(jobId, configType, connectorDefinitionId, workspaceId, JobState.STARTED, null); | ||
final TemporalResponse<U> temporalResponse = executor.get(); | ||
final Optional<U> jobOutput = temporalResponse.getOutput(); | ||
final TemporalResponse<ConnectorJobOutput> temporalResponse = executor.get(); | ||
final Optional<ConnectorJobOutput> jobOutput = temporalResponse.getOutput(); | ||
Comment on lines
-183
to
+184
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed some generics since they weren't necessary (each job returns a ConnectorJobOutput) and were making it harder to work with |
||
final T mappedOutput = jobOutput.map(outputMapper).orElse(null); | ||
final JobState outputState = temporalResponse.getMetadata().isSucceeded() ? JobState.SUCCEEDED : JobState.FAILED; | ||
|
||
|
@@ -194,6 +194,7 @@ <T, U> SynchronousResponse<T> execute(final ConfigType configType, | |
final long endedAt = Instant.now().toEpochMilli(); | ||
return SynchronousResponse.fromTemporalResponse( | ||
temporalResponse, | ||
jobOutput.orElse(null), | ||
mappedOutput, | ||
jobId, | ||
configType, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is OK, but calling out that this would would fail if the config JSON was re-ordered by the connector. However, the connector shouldn't just re-order it's config without a good reason...Actually,
jackson.equals()
should be positionally independant!