Skip to content

Add cohort_streamed_diff_enabled input to perf test workflow#42

Merged
vaibhav-jain-exp merged 2 commits into
mainfrom
perf-test-cohort-streamed-diff-input
Jul 22, 2026
Merged

Add cohort_streamed_diff_enabled input to perf test workflow#42
vaibhav-jain-exp merged 2 commits into
mainfrom
perf-test-cohort-streamed-diff-input

Conversation

@vaibhav-jain-exp

@vaibhav-jain-exp vaibhav-jain-exp commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a cohort_streamed_diff_enabled boolean input (default false) to the manual perf test workflow, forwarded in the repository_dispatch payload to amplitude/sdk-tests, which passes it to the deploy repo so AMPLITUDE_COHORT_STREAMED_DIFF_ENABLED (added in #40, default false) is set on the stage2 perf-test deployment in the same commit as the image tag.

  • Manual run with the box checked → deployment gets AMPLITUDE_COHORT_STREAMED_DIFF_ENABLED=true for that perf run.
  • Manual run with the box unchecked, or any push to main → flag is explicitly reset to false.

Merge order: amplitude/deploy#23810 → amplitude/sdk-tests#6 → this PR.

Note: the flag is a runtime no-op until #40 merges; to perf-test #40 now, run this workflow from this branch and pass the #40 commit as the sha input.

Testing

  • actionlint: no new finding classes vs the base file (new steps follow the file's existing $GITHUB_OUTPUT idiom).
  • Payload JSON validity and end-to-end chain (flag=true / flag=false / push-to-main / legacy consumers) verified against the sdk-tests and deploy changes.

🤖 Generated with Claude Code


Note

Low Risk
CI-only workflow changes with no application runtime impact; risk is limited to incorrect dispatch payload wiring for perf-test deployments.

Overview
Adds a workflow_dispatch boolean input cohort_streamed_diff_enabled (default false) so manual perf runs can turn on AMPLITUDE_COHORT_STREAMED_DIFF_ENABLED on the stage2 perf-test deployment via the downstream chain.

A new step normalizes that input to true/false (including push-to-main and unchecked manual runs as false) and includes cohort_streamed_diff_enabled in the repository_dispatch client_payload to amplitude/sdk-tests. The job summary now prints the flag value.

Shell steps were tightened to pass values through env instead of inline ${{ }} in scripts, and the dispatch body is built with jq piped to curl instead of an inline JSON string.

Reviewed by Cursor Bugbot for commit 86010d6. Bugbot is set up for automated code reviews on this repo. Configure here.

Adds a workflow_dispatch input that is forwarded to the sdk-tests
repository_dispatch payload so a manual perf test run can enable
AMPLITUDE_COHORT_STREAMED_DIFF_ENABLED (default false, added in #40)
on the perf-test deployment. Push-triggered runs always send false.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment on lines +39 to +45
run: |
if [ "${{ github.event.inputs.cohort_streamed_diff_enabled }}" = "true" ]; then
echo "cohort_streamed_diff_enabled=true" >> $GITHUB_OUTPUT
else
echo "cohort_streamed_diff_enabled=false" >> $GITHUB_OUTPUT
fi

@semgrep-amplitude semgrep-amplitude Bot Jul 22, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using variable interpolation ${{...}} with github context data in a run: step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. github context data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable with env: to store the data and use the environment variable in the run: script. Be sure to use double-quotes the environment variable, like this: "$ENVVAR".

🎉 Fixed in commit 86010d6 🎉

@semgrep-amplitude

Copy link
Copy Markdown

Semgrep found 2 run-shell-injection findings:

Using variable interpolation ${{...}} with github context data in a run: step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. github context data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable with env: to store the data and use the environment variable in the run: script. Be sure to use double-quotes the environment variable, like this: "$ENVVAR".

…ction findings

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vaibhav-jain-exp
vaibhav-jain-exp merged commit 5089f2b into main Jul 22, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants