Skip to content

Commit

Permalink
Make Starlark actions that have an unused inputs list unshareable.
Browse files Browse the repository at this point in the history
This is useful because shared actions with state are not nice, so let's
minimize the number of their occurrences.

RELNOTES: None.
PiperOrigin-RevId: 255565510
  • Loading branch information
lberki authored and copybara-github committed Jun 28, 2019
1 parent 91ff4e2 commit 8d76cb6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ public Optional<Artifact> getUnusedInputsList() {
return unusedInputsList;
}

@Override
public boolean isShareable() {
return !unusedInputsList.isPresent();
}

@Override
public boolean discoversInputs() {
return unusedInputsList.isPresent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,7 @@ public void testCreateStarlarkActionArgumentsWithUnusedInputsList() throws Excep
assertThat(action.getUnusedInputsList()).isPresent();
assertThat(action.getUnusedInputsList().get().getFilename()).isEqualTo("a.txt");
assertThat(action.discoversInputs()).isTrue();
assertThat(action.isShareable()).isFalse();
}

@Test
Expand Down

0 comments on commit 8d76cb6

Please sign in to comment.