Skip to content

refactor(ci): make performance runs an opt-in label for PRs#14550

Open
sfc-gh-bnisco wants to merge 2 commits intodevelopfrom
03-27-refactor_ci_make_performance_runs_an_opt-in_label_for_prs
Open

refactor(ci): make performance runs an opt-in label for PRs#14550
sfc-gh-bnisco wants to merge 2 commits intodevelopfrom
03-27-refactor_ci_make_performance_runs_an_opt-in_label_for_prs

Conversation

@sfc-gh-bnisco
Copy link
Copy Markdown
Collaborator

@sfc-gh-bnisco sfc-gh-bnisco commented Mar 27, 2026

Describe your changes

Changed the performance workflow trigger from running on all pull requests to only running when the run-performance label is applied. The workflow now automatically removes the label after execution to prevent repeated runs.

GitHub Issue Link (if applicable)

N/A

Testing Plan

  • Manually tested

Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

@snyk-io
Copy link
Copy Markdown
Contributor

snyk-io bot commented Mar 27, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Copy link
Copy Markdown
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@sfc-gh-bnisco sfc-gh-bnisco added the change:refactor PR contains code refactoring without behavior change label Mar 27, 2026 — with Graphite App
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2026

✅ PR preview is ready!

Name Link
📦 Wheel file https://core-previews.s3-us-west-2.amazonaws.com/pr-14550/streamlit-1.55.0-py3-none-any.whl
📦 @streamlit/component-v2-lib Download from artifacts
🕹️ Preview app pr-14550.streamlit.app (☁️ Deploy here if not accessible)

@sfc-gh-bnisco sfc-gh-bnisco added the impact:internal PR changes only affect internal code label Mar 27, 2026 — with Graphite App
@sfc-gh-bnisco sfc-gh-bnisco added the run-performance If applied to PR, runs our performance suite and tracks various metrics. label Mar 27, 2026
@github-actions github-actions bot removed the run-performance If applied to PR, runs our performance suite and tracks various metrics. label Mar 27, 2026
@sfc-gh-bnisco sfc-gh-bnisco marked this pull request as ready for review March 27, 2026 22:29
@sfc-gh-bnisco sfc-gh-bnisco requested a review from a team as a code owner March 27, 2026 22:29
Copilot AI review requested due to automatic review settings March 27, 2026 22:29
@sfc-gh-bnisco sfc-gh-bnisco added the ai-review If applied to PR or issue will run AI review workflow label Mar 27, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors the performance.yml GitHub Actions workflow so performance benchmarks no longer run on every PR update, and instead run only when the run-performance label is applied (and then auto-remove that label after starting).

Changes:

  • Updated performance.yml to trigger on pull_request:labeled and gate execution on the run-performance label.
  • Added an automated step to remove the run-performance label at the start of the run.
  • Updated workflow reference docs/rules to reflect the new trigger behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/performance.yml Changes PR triggering to label-based opt-in and removes the label automatically after execution starts.
.github/workflows/AGENTS.md Updates the workflow trigger documentation for performance.yml.
.github/instructions/workflows.instructions.md Updates the workflow trigger documentation for performance.yml.
.cursor/rules/workflows.mdc Updates the workflow trigger documentation for performance.yml.

@github-actions github-actions bot removed the ai-review If applied to PR or issue will run AI review workflow label Mar 27, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Summary

This PR converts the performance.yml GitHub Actions workflow from running automatically on every PR to an opt-in model triggered by applying the run-performance label. The workflow continues to run automatically on push to develop and via workflow_call. A label-removal step is added so the label is cleaned up after the workflow starts, allowing re-triggering by re-applying the label. All three documentation files (.github/workflows/AGENTS.md, .cursor/rules/workflows.mdc, .github/instructions/workflows.instructions.md) are updated consistently.

Reviewer consensus: All three reviewers (claude-4.6-opus-high-thinking, gemini-3.1-pro, gpt-5.3-codex-high) approved this PR unanimously with no blocking issues.

Code Quality

The changes are clean, focused, and consistent with established patterns — particularly the existing load-testing.yml opt-in workflow. All reviewers agreed on the quality of the implementation. Specific highlights:

  • Defensive trigger filtering: The workflow uses both event configuration (pull_request.types: [labeled]) and a job-level if guard, reducing accidental execution (noted by all reviewers).
  • Shell injection prevention: The label-removal step passes github.repository and github.event.pull_request.number through env: variables rather than interpolating them directly in the run: block. Claude-4.6-opus noted this is an improvement over the existing load-testing.yml pattern, which interpolates these values directly.
  • Graceful failure handling: The || true on the gh api DELETE call prevents failures if the label was already removed or the token lacks write permissions (e.g., fork PRs).

No structural or maintainability concerns were identified by any reviewer.

Test Coverage

All reviewers agreed that no unit or e2e tests are needed for this CI workflow configuration change. Manual verification is the appropriate testing strategy. GPT-5.3-codex noted that behavior should be confirmed on at least one labeled PR run and one non-labeled PR run, which is reasonable validation advice.

Backwards Compatibility

Fully backward compatible. No user-facing Streamlit runtime behavior is changed. Performance benchmarks continue running automatically on push to develop, preserving baseline data collection. The only behavioral change is for PRs, where performance tests now require explicit opt-in — an intentional CI cost optimization. All reviewers agreed on this assessment.

Security & Risk

Low risk. All reviewers concurred with no security concerns:

  • Permissions: contents: read and pull-requests: write are appropriately scoped (least privilege).
  • Shell injection: Dynamic values are passed via env: variables, following repo guidelines.
  • No new external actions: Label removal uses the built-in gh CLI.
  • No application code changes: No modifications to the Streamlit library, frontend, or backend.

The removal of paths-ignore for specs/** and wiki/** is a non-issue since the workflow is now opt-in (noted by Claude-4.6-opus).

External test recommendation

  • Recommend external_test: No
  • Triggered categories: None
  • Evidence:
    • .github/workflows/performance.yml: CI trigger configuration change only — no modifications to routing, auth, WebSocket, embedding, assets, cross-origin behavior, SiS runtime, storage, or security headers.
    • Documentation files: Table cell text updates only.
  • Suggested external_test focus areas: N/A
  • Confidence: High
  • Assumptions and gaps: None. All reviewers unanimously agreed no external test coverage is needed.

Accessibility

Not applicable — no frontend changes.

Recommendations

No blocking issues. Two minor, non-blocking suggestions emerged from the reviews:

  1. Align load-testing.yml label removal to use env: variables (from claude-4.6-opus): The new pattern here is an improvement over load-testing.yml's direct interpolation. Consider updating load-testing.yml in a follow-up PR for consistency.
  2. Add an inline comment explaining || true (from gpt-5.3-codex): A brief comment near the label deletion step explaining the intentional fail-open behavior for restricted-token contexts (fork PR scenarios) could improve readability.

Verdict

APPROVED: Clean, low-risk CI workflow refactor that converts performance benchmarks to opt-in for PRs, following established patterns and best practices. All three reviewers approved unanimously with no blocking issues.

Review metadata
Reviewer Verdict Key Notes
claude-4.6-opus-high-thinking APPROVED Noted env-var improvement over load-testing.yml
gemini-3.1-pro APPROVED Clean, follows existing patterns
gpt-5.3-codex-high APPROVED Suggested inline comment for || true

All expected models submitted reviews. None failed to complete.


This is a consolidated AI review by claude-4.6-opus-high-thinking, synthesizing reviews from claude-4.6-opus-high-thinking, gemini-3.1-pro, and gpt-5.3-codex-high. Please verify the feedback and use your judgment.

@sfc-gh-bnisco sfc-gh-bnisco added the run-performance If applied to PR, runs our performance suite and tracks various metrics. label Mar 27, 2026
@github-actions github-actions bot removed the run-performance If applied to PR, runs our performance suite and tracks various metrics. label Mar 27, 2026
Copy link
Copy Markdown
Collaborator

@lukasmasuch lukasmasuch left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:refactor PR contains code refactoring without behavior change impact:internal PR changes only affect internal code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants