Skip to content

Conversation

@sfc-gh-nbellante
Copy link
Contributor

@sfc-gh-nbellante sfc-gh-nbellante commented Dec 5, 2025

Describe your changes

Enhanced the snapshot hygiene workflow to provide more detailed and actionable feedback when orphaned snapshots are detected:

  1. Modified the snapshot-hygiene GitHub workflow to:

    • Capture and parse the output from the snapshot cleanup script
    • Format the orphaned snapshots list in a structured way in PR comments
    • Include a copy-pastable list of orphaned snapshots for easy addition to DISALLOWED_SNAPSHOTS
  2. Updated the snapshot_cleanup.py script to:

    • Generate a copy-pastable format of orphaned snapshot filenames
    • Clearly mark the copy-pastable section with START/END markers

These changes make it easier for developers to identify and address orphaned snapshots by providing a ready-to-use list that can be directly copied into the DISALLOWED_SNAPSHOTS set if needed.

Testing Plan

  • The changes have been tested by running the snapshot cleanup script locally and verifying the output format
  • The GitHub workflow changes have been reviewed to ensure they correctly parse and display the script output
  • No additional tests are needed as this is an improvement to the developer workflow tooling

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
Contributor

snyk-io bot commented Dec 5, 2025

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

Status Scanner 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.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

✅ PR preview is ready!

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

Copy link
Contributor Author

sfc-gh-nbellante commented Dec 5, 2025

@sfc-gh-nbellante sfc-gh-nbellante changed the title updating the snapshot cleanup script to be more helpful [feat] Enhance snapshot hygiene workflow with detailed orphaned snapshot reporting Dec 5, 2025
@sfc-gh-nbellante sfc-gh-nbellante marked this pull request as ready for review December 5, 2025 20:10
@sfc-gh-nbellante sfc-gh-nbellante requested a review from a team as a code owner December 5, 2025 20:10
@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

📉 Frontend coverage change detected

The frontend unit test (vitest) coverage has decreased by 0.0000%

  • Current PR: 86.3300% (12598 lines, 1721 missed)
  • Latest develop: 86.3300% (12598 lines, 1721 missed)

✅ Coverage change is within normal range.

📊 View detailed coverage comparison

@sfc-gh-nbellante sfc-gh-nbellante force-pushed the 12-05-updating_the_snapshot_cleanup_script_to_be_more_helpful branch from 1bfaccf to 97fce62 Compare December 8, 2025 16:40
@sfc-gh-nbellante sfc-gh-nbellante force-pushed the chat-input-file-upload-enhancements branch from 95d8d00 to 8c27e42 Compare December 8, 2025 16:40
@sfc-gh-nbellante sfc-gh-nbellante added security-assessment-completed Security assessment has been completed for PR impact:internal PR changes only affect internal code change:chore PR contains maintenance or housekeeping change labels Dec 8, 2025
@sfc-gh-nbellante sfc-gh-nbellante force-pushed the 12-05-updating_the_snapshot_cleanup_script_to_be_more_helpful branch 3 times, most recently from 0dda5f8 to 88ed5bb Compare December 8, 2025 18:32
@sfc-gh-nbellante sfc-gh-nbellante force-pushed the chat-input-file-upload-enhancements branch from a4421ae to 2d6d195 Compare December 8, 2025 18:32
@sfc-gh-nbellante sfc-gh-nbellante force-pushed the 12-05-updating_the_snapshot_cleanup_script_to_be_more_helpful branch 8 times, most recently from 9a55643 to 269132d Compare December 9, 2025 15:38
@sfc-gh-nbellante sfc-gh-nbellante force-pushed the chat-input-file-upload-enhancements branch 2 times, most recently from 34c0452 to 375d1ce Compare December 9, 2025 15:42
@sfc-gh-nbellante sfc-gh-nbellante force-pushed the 12-05-updating_the_snapshot_cleanup_script_to_be_more_helpful branch from 269132d to b5a64c4 Compare December 9, 2025 15:42
@sfc-gh-nbellante sfc-gh-nbellante force-pushed the chat-input-file-upload-enhancements branch from 375d1ce to 42ee566 Compare December 9, 2025 15:43
@sfc-gh-nbellante sfc-gh-nbellante force-pushed the 12-05-updating_the_snapshot_cleanup_script_to_be_more_helpful branch 2 times, most recently from 283ecd4 to c70ee41 Compare December 9, 2025 15:53
@sfc-gh-nbellante sfc-gh-nbellante force-pushed the chat-input-file-upload-enhancements branch from 42ee566 to 134ee1b Compare December 9, 2025 15:53
@sfc-gh-nbellante sfc-gh-nbellante force-pushed the 12-05-updating_the_snapshot_cleanup_script_to_be_more_helpful branch from c70ee41 to 66fafae Compare December 9, 2025 15:57
@sfc-gh-nbellante sfc-gh-nbellante force-pushed the chat-input-file-upload-enhancements branch 2 times, most recently from efa9698 to 712ca07 Compare December 9, 2025 16:51
@sfc-gh-nbellante sfc-gh-nbellante force-pushed the 12-05-updating_the_snapshot_cleanup_script_to_be_more_helpful branch from 66fafae to eaf04eb Compare December 9, 2025 16:51
@sfc-gh-nbellante sfc-gh-nbellante force-pushed the chat-input-file-upload-enhancements branch from 712ca07 to 2ee0af8 Compare December 9, 2025 17:07
@sfc-gh-nbellante sfc-gh-nbellante force-pushed the 12-05-updating_the_snapshot_cleanup_script_to_be_more_helpful branch 2 times, most recently from 041e881 to fafd418 Compare December 10, 2025 16:17
@sfc-gh-nbellante sfc-gh-nbellante force-pushed the chat-input-file-upload-enhancements branch from 2ee0af8 to 4f10c74 Compare December 10, 2025 16:17
@sfc-gh-nbellante sfc-gh-nbellante force-pushed the 12-05-updating_the_snapshot_cleanup_script_to_be_more_helpful branch 4 times, most recently from 72ac319 to ea129ed Compare December 10, 2025 18:22
@sfc-gh-nbellante sfc-gh-nbellante changed the base branch from chat-input-file-upload-enhancements to graphite-base/13238 December 15, 2025 15:43
…s are found

The workflow was using || which caught the script's exit code 1 and prevented
the step from failing. This meant the "Comment on PR if snapshots found" step
would never run since it checks if: failure().

Now we:
1. Capture the exit code with set +e
2. Still display and save the output
3. Explicitly exit 1 if the script failed

This ensures the workflow correctly fails and comments on PRs when orphaned
snapshots are detected.
Changed from 'Copy-pastable list for DISALLOWED_SNAPSHOTS' to
'These are the snapshots I found that appear to be orphaned'
for better clarity and tone.
@sfc-gh-nbellante sfc-gh-nbellante force-pushed the 12-05-updating_the_snapshot_cleanup_script_to_be_more_helpful branch from ea129ed to 163d4bf Compare December 15, 2025 15:43
@graphite-app graphite-app bot changed the base branch from graphite-base/13238 to develop December 15, 2025 15:44
The snapshot output was being interpolated directly into a JavaScript template
literal, which could cause syntax errors or code injection if snapshot filenames
contained backticks, ${, or other special characters.

Now passing the output via environment variable which is the secure way to
handle untrusted data in GitHub Actions workflows.
@sfc-gh-nbellante sfc-gh-nbellante force-pushed the 12-05-updating_the_snapshot_cleanup_script_to_be_more_helpful branch from 163d4bf to 96eefa1 Compare December 15, 2025 15:44
@sfc-gh-nbellante sfc-gh-nbellante merged commit 01f8947 into develop Dec 15, 2025
43 checks passed
Copy link
Contributor Author

Merge activity

@sfc-gh-nbellante sfc-gh-nbellante deleted the 12-05-updating_the_snapshot_cleanup_script_to_be_more_helpful branch December 15, 2025 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:chore PR contains maintenance or housekeeping change impact:internal PR changes only affect internal code security-assessment-completed Security assessment has been completed for PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants