Skip to content

Track ReplaceTokens values as processResources inputs - #40133

Open
shunping wants to merge 1 commit into
apache:masterfrom
shunping:fix-gradle-token-not-tracked
Open

shunping wants to merge 1 commit into
apache:masterfrom
shunping:fix-gradle-token-not-tracked

Conversation

@shunping

@shunping shunping commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Gradle treats the tokens: map passed to the ReplaceTokens content filter as a filter argument, not a task input, so it affects neither the up-to-date check nor the build cache key. The filtered sources contain only unsubstituted placeholders and are byte identical regardless of what the tokens expand to, so nothing invalidates processResources when a token value changes.

In a shared checkout where build branch switches, the task stays UP-TO-DATE and the previous branch's substituted resource is left behind. Particularly, switching master -> a former release branch left dataflow.properties holding master's container version, so pipelines ran against a wrong version of beam-master SDK harness. The same staleness also poisons the build cache, since both branches compute the same key for different correct outputs, so clean is not a reliable workaround.

This can be fixed by declaring the token map as an input property.

Gradle treats the `tokens:` map passed to the ReplaceTokens content
filter as a filter argument, not a task input, so it affects neither
the up-to-date check nor the build cache key. The filtered sources
contain only unsubstituted placeholders and are byte identical
regardless of what the tokens expand to, so nothing invalidates
processResources when a token value changes.

In a shared checkout where build/ survives branch switches, the task
stays UP-TO-DATE and the previous branch's substituted resource is
left behind. Switching master -> a former release branch left
dataflow.properties holding master's container version, so pipelines
ran against a wrong version of beam-master SDK harness. The same
staleness also poisons the build cache, since both branches compute
the same key for different correct outputs, so `clean` is not a
reliable workaround.

This can be fixed by declaring the token map as an input property.
@shunping

Copy link
Copy Markdown
Collaborator Author

r: @derrickaw

@shunping
shunping marked this pull request as ready for review September 15, 2026 16:10
@github-actions

Copy link
Copy Markdown
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment assign set of reviewers

@shunping
shunping requested a review from derrickaw September 15, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant