Skip to content

ci: Hoist continue-on-error to job - #37

Merged
nielsenko merged 1 commit into
serverpod:mainfrom
nielsenko:ci-tweaks-2
Mar 17, 2025
Merged

nielsenko merged 1 commit into
serverpod:mainfrom
nielsenko:ci-tweaks-2

Conversation

@nielsenko

@nielsenko nielsenko commented Mar 15, 2025 •

Copy link
Copy Markdown
Collaborator

Move continue-on-error clause to job instead of step.

If continue-on-error is set to true on a job, then a job won't fail the workflow, but will still be marked red, on failure.
This is not the case for steps.

Also ensures we upload coverage even if there are test failures.

Summary by CodeRabbit

  • Chores
    • Updated internal workflows to enhance testing consistency and coverage reporting.
    • Improved conditions for error handling in test execution.

@coderabbitai

coderabbitai Bot commented Mar 15, 2025 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This pull request updates the CI workflow configuration in .github/workflows/dart-tests.yaml. The revisions include expanded comments that clarify limitations related to the environment context for the LOWEST_DART_SDK variable and the dart_sdk matrix. Conditions in the unit_tests job have been adjusted, such that the continue-on-error check now specifically excludes Dart SDK version 3.3.0. Additionally, the workflow steps have been modified by removing the continue-on-error condition in the test coverage step and adding a new condition to the coverage upload step. No public API or exported entity modifications were made.

Changes

File Change Summary
.github/workflows/dart-tests.yaml - Expanded comments to explain that the LOWEST_DART_SDK variable and dart_sdk matrix cannot use environment context at the job level.
- Updated the continue-on-error condition for the unit_tests job based on the Dart SDK version not being 3.3.0.
- Removed the continue-on-error from the test step, adding a new condition to the upload step.

Sequence Diagram(s)

sequenceDiagram
    participant Trigger as Commit/Push
    participant Workflow as CI Workflow
    participant UnitTests as unit_tests Job
    participant TestStep as Run Tests With Coverage
    participant CoverageUpload as Upload Coverage

    Trigger->>Workflow: Push commit to repository
    Workflow->>UnitTests: Start unit_tests job with Dart SDK matrix
    UnitTests->>TestStep: Execute tests (without continue-on-error)
    UnitTests->>CoverageUpload: Trigger upload of coverage (always invoked)
Loading

Possibly related PRs

  • ci: Add test coverage #36: Addresses similar modifications to the unit_tests job's conditions and dependency checks, aligning closely with the changes in this pull request.

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@nielsenko nielsenko self-assigned this Mar 15, 2025
@nielsenko

Copy link
Copy Markdown
Collaborator Author

This is to rectify a false claim I made previously: #36 (comment)

continue_on_error behaviour differs on steps vs. jobs

@nielsenko
nielsenko marked this pull request as ready for review March 15, 2025 13:30
@codecov

codecov Bot commented Mar 15, 2025 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.30%. Comparing base (39deca6) to head (e5e4812).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #37   +/-   ##
=======================================
  Coverage   81.30%   81.30%           
=======================================
  Files          70       70           
  Lines        2621     2621           
  Branches     1119     1119           
=======================================
  Hits         2131     2131           
  Misses        490      490           

☔ 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.

@nielsenko
nielsenko force-pushed the ci-tweaks-2 branch 2 times, most recently from e027895 to a13e77c Compare March 15, 2025 14:21
@nielsenko

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Mar 15, 2025

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@nielsenko

Copy link
Copy Markdown
Collaborator Author

@coderabbitai full

@coderabbitai

coderabbitai Bot commented Mar 15, 2025

Copy link
Copy Markdown
Contributor

@nielsenko I'll perform a full review of all changes in this PR.

✅ Actions performed

Full review triggered.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
.github/workflows/dart-tests.yaml (1)

85-85: Quote matrix string values for consistency
To ensure consistent YAML parsing and clarity, consider quoting the string values stable and beta in the dart_sdk matrix. For example:

-        dart_sdk: ["3.3.0", stable, beta] # env context not available for strategy
+        dart_sdk: ["3.3.0", "stable", "beta"] # env context not available for strategy

This small nitpick could prevent any potential interpretation issues.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 39deca6 and e5e4812.

📒 Files selected for processing (1)
  • .github/workflows/dart-tests.yaml (3 hunks)
🔇 Additional comments (3)
.github/workflows/dart-tests.yaml (3)

24-26: Clarify Dart SDK strategy comment
The expanded comments clearly explain why the env.LOWEST_DART_SDK value cannot be used at the job level due to context limitations. This added context is helpful.


81-81: Hoist continue-on-error at job level
The continue-on-error: ${{ matrix.dart_sdk != '3.3.0' }} setting now correctly applies at the job level. This ensures that for Dart SDK versions other than 3.3.0 the errors won’t fail the entire workflow while still marking the job as failed, which aligns with the PR objective.


115-115: Ensure coverage upload irrespective of test failures
The new condition if: ${{ !cancelled() }} in the Upload Coverage step guarantees that coverage reports are uploaded regardless of test errors, as intended by the PR objectives. This is a valid and useful change.

@nielsenko
nielsenko requested a review from SandPod March 17, 2025 07:11
@nielsenko

Copy link
Copy Markdown
Collaborator Author

@SandPod While working on this I learned that you cannot use the env context outside of a step. I'm not sure I understand/agree with the why, but it is what it is.

We could consider moving the LOWEST_SDK_VERSION from env to vars which is available, but then we have to set it as variable on the repo (which is an admin op). However, If we do that we can get rid of hardcoded "3.3.0" and most of the comments.

@SandPod SandPod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚀

Comment thread .github/workflows/dart-tests.yaml Resolved
@SandPod

SandPod commented Mar 17, 2025

Copy link
Copy Markdown
Contributor

@SandPod While working on this I learned that you cannot use the env context outside of a step. I'm not sure I understand/agree with the why, but it is what it is.

We could consider moving the LOWEST_SDK_VERSION from env to vars which is available, but then we have to set it as variable on the repo (which is an admin op). However, If we do that we can get rid of hardcoded "3.3.0" and most of the comments.

We could add it there if you would like, but It might be a bit implicit to the running pipe? Might be better to have it hardcoded in the action.

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