Skip to content

Conversation

@AsCress
Copy link
Collaborator

@AsCress AsCress commented Aug 22, 2025

Summary by Sourcery

Revamp screenshot workflows by splitting iPhone and iPad capture into separate jobs and actions, updating pull-request comment logic to fetch and display both device artifacts, and adding concurrency control to the PR workflow.

Enhancements:

  • Extract iPad screenshot logic into a new composite action and rename the iOS action to an iPhone-specific action
  • Update push-event and pull-request workflows to run distinct Android, iPhone, and iPad screenshot jobs with appropriate runners, timeouts, and Xcode setup
  • Revise pull-request-comment workflow to download, unzip, and display iPhone and iPad screenshots in collapsible sections under a unified Screenshots header
  • Introduce concurrency settings in the pull-request workflow to cancel outdated runs on new commits

@AsCress AsCress self-assigned this Aug 22, 2025
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Aug 22, 2025

Reviewer's Guide

This PR refactors and enhances the screenshot capture workflows across PR comments and CI pipelines by splitting iPhone and iPad pipelines, updating default device models, enforcing timeouts, removing redundant steps, and correctly targeting simulators via UDIDs.

Sequence diagram for iPhone screenshot workflow with UDID targeting

sequenceDiagram
    participant CI as CI Workflow
    participant Xcode as Set up Xcode
    participant Checkout as Checkout Repo
    participant Sim as Create iPhone Simulator
    participant Flutter as Flutter Drive
    participant Artifact as Upload Artifact
    CI->>Xcode: Set up Xcode
    Xcode->>Checkout: Checkout repository
    Checkout->>Sim: Create iPhone Simulator (get UDID)
    Sim->>Flutter: Pass UDID to flutter drive
    Flutter->>Artifact: Capture and upload iPhone screenshots
Loading

Sequence diagram for iPad screenshot workflow with UDID targeting

sequenceDiagram
    participant CI as CI Workflow
    participant Xcode as Set up Xcode
    participant Checkout as Checkout Repo
    participant Sim as Create iPad Simulator
    participant Flutter as Flutter Drive
    participant Artifact as Upload Artifact
    CI->>Xcode: Set up Xcode
    Xcode->>Checkout: Checkout repository
    Checkout->>Sim: Create iPad Simulator (get UDID)
    Sim->>Flutter: Pass UDID to flutter drive
    Flutter->>Artifact: Capture and upload iPad screenshots
Loading

Class diagram for updated screenshot workflow actions

classDiagram
    class ScreenshotIphoneAction {
      +IPHONE_DEVICE_MODEL: string
      +Create iPhone Simulator (outputs UDID)
      +Capture iPhone Screenshots (uses UDID)
      +Upload iPhone Screenshots
    }
    class ScreenshotIpadAction {
      +IPAD_DEVICE_MODEL: string
      +Create iPad Simulator (outputs UDID)
      +Capture iPad Screenshots (uses UDID)
      +Upload iPad Screenshots
    }
    ScreenshotIphoneAction <|-- ScreenshotIpadAction
Loading

File-Level Changes

Change Details Files
Separate PR comment artifact handling for iPad and iPhone
  • Renamed iosScreenshots to iPadScreenshots and introduced a download block for iPhoneScreenshots
  • Updated unzip commands to extract both iPad and iPhone artifacts
  • Wrapped each platform’s screenshot table in collapsible details sections
.github/workflows/pull-request-comment.yml
Update default simulator device models
  • Bumped IPHONE_DEVICE_MODEL to “iPhone 16 Pro Max”
  • Bumped IPAD_DEVICE_MODEL to “iPad Pro 13-inch (M4)”
  • Aligned default values in composite action metadata
.github/workflows/push-event.yml
.github/workflows/pull-request.yml
.github/actions/screenshot-ios/action.yml
.github/actions/screenshot-iphone/action.yml
.github/actions/screenshot-ipad/action.yml
Split and configure dedicated screenshot jobs
  • Renamed and split the generic screenshots-iOS job into screenshots-iphone and screenshots-ipad
  • Set timeout-minutes on each screenshot job (30–60 minutes)
  • Added concurrency/cancel-in-progress to the pull_request workflow
  • Removed redundant simulator listing step
.github/workflows/push-event.yml
.github/workflows/pull-request.yml
Refactor composite actions to use simulator UDIDs
  • Renamed the iOS action to screenshot-iphone and created a new screenshot-ipad action
  • Added id fields to simulator creation steps to capture UDID outputs
  • Replaced device-model flags in flutter drive commands with the simulator UDID reference
.github/actions/screenshot-ios/action.yml
.github/actions/screenshot-iphone/action.yml
.github/actions/screenshot-ipad/action.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@AsCress AsCress force-pushed the pipeline_fix branch 2 times, most recently from 6246445 to 09189f1 Compare August 22, 2025 05:00
@github-actions
Copy link
Contributor

github-actions bot commented Aug 22, 2025

Build Status

Build workflow failed. Please check the logs for more information.

Screenshots (Android)

Not able to fetch screenshots.

Screenshots (iPhone)

Not able to fetch screenshots.

Screenshots (iPad)

Not able to fetch screenshots.

@AsCress AsCress force-pushed the pipeline_fix branch 2 times, most recently from 5813073 to d8b0e5a Compare August 22, 2025 16:56
@AsCress AsCress marked this pull request as ready for review August 22, 2025 17:22
sourcery-ai[bot]
sourcery-ai bot previously requested changes Aug 22, 2025
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!

Blocking issues:

  • An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload. (link)
  • An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload. (link)
  • An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload. (link)
  • An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload. (link)
Prompt for AI Agents
Please address the comments from this code review:
## Security Issues

### Issue 1
<location> `.github/actions/screenshot-ipad/action.yml:13` </location>

<issue_to_address>
**security (yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha):** An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.

*Source: opengrep*
</issue_to_address>

### Issue 2
<location> `.github/actions/screenshot-ipad/action.yml:26` </location>

<issue_to_address>
**security (yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha):** An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.

*Source: opengrep*
</issue_to_address>

### Issue 3
<location> `.github/workflows/pull-request.yml:98` </location>

<issue_to_address>
**security (yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha):** An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.

*Source: opengrep*
</issue_to_address>

### Issue 4
<location> `.github/workflows/push-event.yml:228` </location>

<issue_to_address>
**security (yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha):** An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.

*Source: opengrep*
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@AsCress AsCress dismissed sourcery-ai[bot]’s stale review August 22, 2025 17:24

Discussed several times.

@bessman bessman merged commit 26d912b into fossasia:flutter Aug 22, 2025
9 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.

2 participants