Skip to content

Commit

Permalink
Rename Reset to Clear for JobTracking (#12426)
Browse files Browse the repository at this point in the history
  • Loading branch information
gosusnp committed May 10, 2024
1 parent d67a6fc commit 64e3c8e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions airbyte-api/src/main/openapi/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9367,6 +9367,7 @@ components:
- sync
- reset_connection
- refresh
- clear
JobCreate:
type: object
required:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ properties:
- sync
- resetConnection
- refresh
- clear
checkConnection:
"$ref": JobCheckConnectionConfig.yaml
discoverCatalog:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,12 @@ Map<String, Object> generateJobMetadata(final String jobId,
final Optional<Job> previousJob) {
final Map<String, Object> metadata = new HashMap<>();
if (configType != null) {
metadata.put("job_type", configType);
// This is a cosmetic fix for our job tracking.
// https://github.com/airbytehq/airbyte-internal-issues/issues/7671 tracks the more complete
// refactoring. Once that is done, this should no longer be needed as we can directly log
// configType.
final var eventConfigType = configType == ConfigType.RESET_CONNECTION ? ConfigType.CLEAR : configType;
metadata.put("job_type", eventConfigType);
}
metadata.put("job_id", jobId);
metadata.put("attempt_id", attempt);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ private Job getJobWithFailuresMock(final ConfigType configType, final long jobId

private ImmutableMap<String, Object> getJobMetadata(final ConfigType configType, final long jobId) {
return ImmutableMap.<String, Object>builder()
.put(JOB_TYPE, configType)
.put(JOB_TYPE, configType != ConfigType.RESET_CONNECTION ? configType : ConfigType.CLEAR)
.put(JOB_ID_KEY, String.valueOf(jobId))
.put(ATTEMPT_ID, 700)
.put("connection_id", CONNECTION_ID)
Expand Down

0 comments on commit 64e3c8e

Please sign in to comment.