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 siberex committed Jul 4, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent c930d2a commit 2eab3d7
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -109,6 +109,11 @@ public Optional<Artifact> getUnusedInputsList() {
return unusedInputsList;
}

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

@Override
public boolean discoversInputs() {
return unusedInputsList.isPresent();
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 2eab3d7

Please sign in to comment.