Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@techouse
Copy link
Contributor

@techouse techouse commented May 2, 2025

This pull request consolidates and simplifies the workflow configurations for multiple packages by replacing individual workflows with a reusable workflow (test.yaml). The reusable workflow centralizes common CI tasks such as formatting, analysis, testing, and code coverage, reducing redundancy and improving maintainability.

Workflow Consolidation and Simplification:

  • Reusable Workflow Creation:

    • Added a new reusable workflow in .github/workflows/test.yaml to handle common CI tasks like formatting, analysis, testing, and code coverage. It supports both Dart and Flutter SDKs and includes configurable inputs for package name, SDK type, Chrome testing, and minimum coverage threshold.
  • Migration to Reusable Workflow:

    • Updated the following workflows to use the new reusable workflow (test.yaml), removing redundant steps and configurations:
      • .github/workflows/talker.yaml
      • .github/workflows/talker_bloc_logger.yaml
      • .github/workflows/talker_dio_logger.yaml
      • .github/workflows/talker_flutter.yaml
      • .github/workflows/talker_logger.yaml
      • .github/workflows/talker_riverpod_logger.yaml

Summary by Sourcery

Consolidate and simplify GitHub Actions workflows by introducing a reusable workflow template for CI tasks across multiple packages

CI:

  • Created a new .github/workflows/test.yaml reusable workflow
  • Updated multiple package workflows to use the new reusable workflow
  • Added support for both Dart and Flutter SDK testing
  • Standardized code formatting, analysis, and coverage checks

Chores:

  • Replaced individual package workflows with a centralized, reusable workflow template

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented May 2, 2025

Reviewer's Guide

This pull request refactors the GitHub Actions CI configuration by introducing a reusable workflow (test.yaml) and updating individual package workflows to utilize it. The reusable workflow centralizes steps for formatting, analysis, testing (including Chrome tests where applicable), and code coverage calculation, taking package name, SDK type (Dart/Flutter), Chrome testing flag, and minimum coverage as inputs.

File-Level Changes

Change Details Files
Introduced a reusable GitHub Actions workflow for CI tasks.
  • Created a new workflow file test.yaml designed to be called by other workflows.
  • Defined inputs for package name, SDK type (Dart/Flutter), Chrome testing flag, and minimum coverage.
  • Included steps for checking out code, setting up the specified SDK (Dart or Flutter), installing dependencies, formatting, analyzing, running tests (optionally in Chrome), checking code coverage, and uploading coverage reports.
  • Added logic to dynamically determine test directory existence and adjust commands accordingly.
  • Configured caching for Dart dependencies.
  • Added Flutter analytics disabling step.
.github/workflows/test.yaml
Refactored existing package-specific CI workflows to use the new reusable workflow.
  • Removed duplicated steps for setup, formatting, analysis, testing, and coverage.
  • Replaced the previous job definitions with a single job that calls .github/workflows/test.yaml.
  • Passed appropriate inputs (package name, sdk type, chrome flag) to the reusable workflow.
  • Added permissions: contents: read where needed.
.github/workflows/talker.yaml
.github/workflows/talker_bloc_logger.yaml
.github/workflows/talker_dio_logger.yaml
.github/workflows/talker_flutter.yaml
.github/workflows/talker_logger.yaml
.github/workflows/talker_riverpod_logger.yaml

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

@codecov-commenter
Copy link

codecov-commenter commented May 2, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.96%. Comparing base (ab547ee) to head (3fe2a1d).
Report is 25 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #361      +/-   ##
==========================================
- Coverage   98.15%   96.96%   -1.19%     
==========================================
  Files          28       31       +3     
  Lines         597      693      +96     
==========================================
+ Hits          586      672      +86     
- Misses         11       21      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@techouse techouse changed the title 👷 simplify talker Github actions 👷 simplify Github actions May 2, 2025
@techouse
Copy link
Contributor Author

techouse commented May 2, 2025

@sourcery-ai review

@techouse techouse marked this pull request as ready for review May 2, 2025 19:27
@techouse techouse changed the title 👷 simplify Github actions chore: simplify Github actions May 2, 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 @techouse - I've reviewed your changes - here's some feedback:

  • The talker_flutter.yaml workflow no longer appears to run tests or check coverage; is this intentional?
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

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.

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 @techouse - I've reviewed your changes - here's some feedback:

  • Consider refactoring the talker_flutter.yaml workflow to also use the centralized dart_test.yaml if feasible for better consistency.
  • Verify that using dart commands instead of flutter commands in the reusable workflow is sufficient for all refactored packages.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

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.

@techouse
Copy link
Contributor Author

techouse commented May 3, 2025

@sourcery-ai review

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 @techouse - I've reviewed your changes - here's some feedback:

  • Consider parameterizing the minimum code coverage threshold in the reusable workflow instead of hardcoding it, as different packages might have different requirements.
  • Ensure secrets like CODECOV_TOKEN are correctly passed to the reusable workflow, perhaps by adding secrets: inherit to the calling workflows.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

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.

@techouse
Copy link
Contributor Author

techouse commented May 3, 2025

@sourcery-ai review

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 @techouse - I've reviewed your changes - here's some feedback:

  • Consider if the web build/deploy steps previously commented out in talker_flutter.yaml need to be preserved in a separate workflow.
  • Explicitly pass the desired min_coverage input for each package workflow call to avoid relying on the potentially inconsistent default.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

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.

@techouse
Copy link
Contributor Author

techouse commented May 3, 2025

@sourcery-ai review

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 @techouse - I've reviewed your changes - here's some feedback:

  • Consider removing the defaults and env blocks from the individual package workflows as they are also defined in the reusable test.yaml workflow.
  • Review if permissions: read-all is necessary in the individual package workflows; perhaps more restricted permissions like contents: read would suffice.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

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.

@techouse
Copy link
Contributor Author

techouse commented May 3, 2025

@sourcery-ai review

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 @techouse - I've reviewed your changes - here's some feedback:

  • Consider renaming the reusable workflow test.yaml to package-ci.yaml or similar, as its scope includes formatting and analysis in addition to testing.
  • The reusable workflow test.yaml combines several distinct stages (setup, format, analyze, test); consider if splitting these into separate jobs within the reusable workflow might improve clarity or modularity.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

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.

@techouse
Copy link
Contributor Author

techouse commented May 3, 2025

@Frezyx

The reusable CI workflow is now dev complete! Its goals are to:

  • Consolidate all CI testing into a single, reusable workflow
  • Eliminate redundant YAML config and remove needless duplication
  • Reduce the risk of CI configuration errors

Whenever you have a moment, could you please take a look and let me know your thoughts? Thanks!

@Frezyx Frezyx requested a review from Copilot May 3, 2025 13:24
Copy link
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

This PR consolidates CI workflows into a single reusable workflow to reduce redundancy and improve maintainability. Key changes include creating a new reusable workflow (.github/workflows/test.yaml) and updating multiple package-specific workflow files (e.g., talker, talker_flutter, talker_logger, etc.) to invoke the new workflow.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/workflows/test.yaml New reusable workflow handling CI tasks for both Dart and Flutter
.github/workflows/talker_riverpod_logger.yaml Updated to call the reusable workflow
.github/workflows/talker_logger.yaml Updated to call the reusable workflow with explicit inputs
.github/workflows/talker_flutter.yaml Updated to call the reusable workflow; legacy code remains commented
.github/workflows/talker_dio_logger.yaml Updated to call the reusable workflow with package and sdk input
.github/workflows/talker_bloc_logger.yaml Updated to call the reusable workflow with package and sdk input
.github/workflows/talker.yaml Updated to call the reusable workflow with package and sdk input
Comments suppressed due to low confidence (2)

.github/workflows/test.yaml:1

  • [nitpick] Consider renaming the workflow to use sentence case (for example, 'CI: Analyze and Test') to improve readability.
name: CI PUSH PR ANALYZE AND TEST

.github/workflows/talker_flutter.yaml:12

  • [nitpick] Remove the commented-out legacy code to improve clarity and reduce maintenance overhead if it is no longer needed.
# - name: Check Code Coverage

Copy link
Owner

@Frezyx Frezyx left a comment

Choose a reason for hiding this comment

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

Hello @techouse !
Thanks a lot for this brand new workflow ❤️
Please fix review issues and I will merge it

@Frezyx Frezyx added work_in_progress Сurrently under work environment Issue related to environment tests Related to tests and test coverage labels May 3, 2025
@techouse techouse requested review from Frezyx and Copilot May 3, 2025 18:33
Copy link
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@Frezyx Frezyx merged commit b656b3f into Frezyx:master May 3, 2025
6 checks passed
@techouse techouse deleted the chore/simplify-github-actions branch May 3, 2025 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

environment Issue related to environment tests Related to tests and test coverage work_in_progress Сurrently under work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants