Skip to content

Improve error handling in publish plugin #2526

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 27, 2025
Merged

Conversation

davidjgoss
Copy link
Contributor

@davidjgoss davidjgoss commented Mar 27, 2025

🤔 What's changed?

This PR improves error handling when interacting with the Cucumber Reports service. Specifically:

  • On a client (4xx) error on the initial GET request, we show the returned banner
  • On a server (5xx) error on the initial GET request, we don't show the banner and instead note the status
  • On any error on the subsequent PUT request, we don't show the banner and instead note the status

In all cases, this still does not cause the test run to fail.

While we're here, the plugin itself is reimplemented with fetch (which wasn't available when publish functionality was originally added) giving us less, and simpler, code.

⚡️ What's your motivation?

Better feedback for the user in case of issues with the remote reports service.

🏷️ What kind of change is this?

  • 🏦 Refactoring/debt/DX (improvement to code design, tooling, etc. without changing behaviour)
  • 🐛 Bug fix (non-breaking change which fixes a defect)

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

This text was originally generated from a template, then edited by hand. You can modify the template here.

@coveralls
Copy link

coveralls commented Mar 27, 2025

Coverage Status

coverage: 97.736% (+0.004%) from 97.732%
when pulling 58284d4 on publish-plugin-rewrite
into f3e99ba on main.

@davidjgoss davidjgoss marked this pull request as ready for review March 27, 2025 19:33
@davidjgoss davidjgoss merged commit c9b431f into main Mar 27, 2025
10 checks passed
@davidjgoss davidjgoss deleted the publish-plugin-rewrite branch March 27, 2025 19:33
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