• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

temporalio / sdk-java / #175

pending completion
#175

push

github-actions

web-flow
Worker / Build Id versioning (#1786)

Implement new worker build id based versioning feature

236 of 236 new or added lines in 24 files covered. (100.0%)

18343 of 23697 relevant lines covered (77.41%)

0.81 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.0
/temporal-sdk/src/main/java/io/temporal/common/VersioningIntent.java
1
/*
2
 * Copyright (C) 2022 Temporal Technologies, Inc. All Rights Reserved.
3
 *
4
 * Copyright (C) 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
 *
6
 * Modifications copyright (C) 2017 Uber Technologies, Inc.
7
 *
8
 * Licensed under the Apache License, Version 2.0 (the "License");
9
 * you may not use this material except in compliance with the License.
10
 * You may obtain a copy of the License at
11
 *
12
 *   http://www.apache.org/licenses/LICENSE-2.0
13
 *
14
 * Unless required by applicable law or agreed to in writing, software
15
 * distributed under the License is distributed on an "AS IS" BASIS,
16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
 * See the License for the specific language governing permissions and
18
 * limitations under the License.
19
 */
20

21
package io.temporal.common;
22

23
/**
24
 * Indicates whether the user intends certain commands to be run on a compatible worker Build Id
25
 * version or not.
26
 */
27
public enum VersioningIntent {
1✔
28
  /**
29
   * Indicates that the SDK should choose the most sensible default behavior for the type of
30
   * command, accounting for whether the command will be run on the same task queue as the current
31
   * worker.
32
   */
33
  VERSIONING_INTENT_UNSPECIFIED,
1✔
34
  /**
35
   * Indicates that the command should run on a worker with compatible version if possible. It may
36
   * not be possible if the target task queue does not also have knowledge of the current worker's
37
   * Build Id.
38
   */
39
  VERSIONING_INTENT_COMPATIBLE,
1✔
40
  /**
41
   * Indicates that the command should run on the target task queue's current overall-default Build
42
   * Id.
43
   */
44
  VERSIONING_INTENT_DEFAULT;
1✔
45

46
  public boolean determineUseCompatibleFlag(boolean destinationTaskQueueIsSame) {
47
    switch (this) {
1✔
48
      case VERSIONING_INTENT_COMPATIBLE:
49
        return true;
×
50
      case VERSIONING_INTENT_DEFAULT:
51
        return false;
×
52
      default:
53
        // In the unspecified case, we want to stick to the compatible version as long as the
54
        // destination queue is the same.
55
        return destinationTaskQueueIsSame;
1✔
56
    }
57
  }
58
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc