-
Notifications
You must be signed in to change notification settings - Fork 0
feat(github-actions): Add pub.dev publishing workflow #5
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
Conversation
- upgraded deps to their latest with sound null safety: - grinder 0.9.0 - test 1.19.5 - ran `dart migrate` - there were 15 changes to mark data as nullable in http_exception.dart - ran `dart format --fix .` to fix formatting - ran `pub run grinder travis` to verify formatting and test - updated version to 0.2.2 - added my name in authors
The HttpStatus class has been replaced with the HttpStatusCode class from the 'http_status' package. This change affects all HTTP exception classes in the 'http_exception.dart' file, where status codes are now referenced from HttpStatusCode instead of HttpStatus. The 'http_status.dart' file has been deleted as it is no longer needed. The dependency on the 'http_status' package has been added to 'pubspec.yaml'. Tests have also been updated to reflect these changes.
Significant changes have been made to the analysis_options.yaml and pubspec.yaml files to improve Dart code linting. The lints package has been included, and several new plugins and rules have been added to the analyzer. The implicit-dynamic setting in strong-mode has also been changed from false to true. In addition, the dev_dependencies in pubspec.yaml have been updated with newer versions of test and a new dependency on dart_code_linter.
The code has been refactored to improve the readability and consistency of the HttpException class and its subclasses. The constructor parameters have been reformatted for better clarity, and the same changes have been applied across all subclasses. This should make it easier to understand how each exception is structured.
This commit introduces a new GitHub workflow specifically designed to handle HTTP exceptions. The workflow is triggered on push and pull requests to the main branch, as well as manually via the 'workflow_dispatch' event. The job runs on Ubuntu and tests against multiple Dart SDK channels including stable, beta, dev, and main. It includes steps for checking out code, setting up Dart SDK, disabling analytics in Dart, installing dependencies, verifying code formatting and analyzing project source for semantic errors. Additionally, it also runs tests with coverage check ensuring minimum 100% coverage. If the test coverage falls below this threshold, the build will fail. Finally, it uses Coveralls GitHub Action to report code coverage results.
The grind.dart and travis.sh scripts in the tool directory have been removed. These scripts were previously used for Travis checks, but are no longer necessary.
The HttpException class and its subclasses have been refactored for better organization. The code has been divided into three separate files: http_exception_base.dart, http_4xx_exceptions.dart, and http_5xx_exceptions.dart. This change improves readability and maintainability of the code by grouping related exceptions together.
Updated the HttpException class and its subclasses to improve error handling. Changes include: - Replaced positional parameters with named parameters in constructors for better readability. - Added 'uri' field to HttpException for more detailed error information. - Overridden equality operator and hashCode method in HttpException for better comparison capabilities. - Enhanced toString() method in HttpException to provide more comprehensive error details. - Updated status code references from HttpStatusCode to HttpStatus for consistency.
…' of key Map The key 'statusCode' in the HttpException class has been renamed to 'httpStatusCode'. Corresponding changes have also been made in the tests, updating expected map lengths and replacing references from 'status' to 'httpStatusCode'.
This commit adds a set of HTTP 4xx exceptions to the codebase. These exceptions represent common client errors in the HTTP protocol, such as Bad Request, Unauthorized, Payment Required, Forbidden, Not Found, Method Not Allowed, and more. The new exceptions are organized into classes that extend the base HttpException class. Each exception includes a detailed message and optional data. The deprecated classes have been replaced with their corresponding non-deprecated versions. These changes improve the codebase by providing a standardized way to handle and communicate client errors in HTTP requests.
This commit adds several new HTTP exception classes to handle different server error statuses. The added classes include: - InternalServerErrorHttpException - NotImplementedHttpException (deprecated, use NotImplementedException instead) - BadGatewayHttpException - ServiceUnavailableHttpException (deprecated, use ServiceUnavailableException instead) - GatewayTimeoutHttpException - HttpVersionNotSupportedHttpException - InsufficientStorageHttpException - NetworkAuthenticationRequiredHttpException These classes provide more specific and descriptive exceptions for handling different types of server errors.
This commit adds tests for various HTTP 4XX exceptions including BadRequestException, UnauthorizedException, PaymentRequiredException, ForbiddenException, NotFoundException, MethodNotAllowedException, NotAcceptableException, ProxyAuthenticationRequiredException, RequestTimeoutException, ConflictException, GoneException, LengthRequiredException and PreconditionFailedException. The tests cover different aspects such as type checking, message validation, data validation and status code verification.
This commit adds test cases for various HTTP 5XX exceptions, including InternalServerErrorException, NotImplementedException, BadGatewayException, ServiceUnavailableException, GatewayTimeoutException, HttpVersionNotSupportedException, InsufficientStorageException, and NetworkAuthenticationRequiredException. Each test case checks the type of exception thrown and verifies its message, data, status code, URI, toMap() method output, and toString() method output.
This commit adds tests for the HttpException class. The tests cover equality and hash code, throwing exceptions with different checks, and checking the toString() and toMap() methods of the HttpException class.
This commit adds an extension to the HttpStatus enum that allows for easy creation of HttpException objects based on the status code. The extension includes methods for each HTTP status code, allowing for custom data and detail to be passed in.
…ions This commit adds constructors for various 4xx and 5xx HTTP exceptions, allowing users to provide custom data, detail, and URI parameters when creating instances of these exceptions.
The channel version in the http_exception.yml workflow file has been updated from '2.18.0' to '2.12.0'. This ensures compatibility with the desired channel versions for the job execution.
- Added patterns to ignore build/, .pub/, doc/api/ directories - Removed pattern for pubspec.lock file - Added patterns to ignore coverage/ directory and lcov.info file - Added pattern to ignore .env* files - Added patterns to ignore generated Javascript files and related artifacts - Added patterns to ignore .flutter-plugins and .flutter-plugins-dependencies files
Added new HTTP exception classes for 506, 507, 508, 510 and 599 status codes. Each class includes a constructor with optional parameters for data, detail message and URI.
Upgraded the http_status package from version 2.1.0 to 3.2.0 in the dependencies section of pubspec.yaml file.
Uncommented the code coverage check in the workflow. Adjusted minimum required coverage from 100% to 90%.
Updated the SDK version in both workflow and pubspec files from 2.15.0 to 2.18.0 for better compatibility and performance improvements.
Downgraded the version of the 'meta' dependency from 1.12.0 to 1.11.0 for compatibility reasons.
Updated the HTTP exception status message to include 'Code' for better clarity. This change affects both the base HttpException class and all related tests.
Replaced the 'message' field with 'detail' in HttpException and all its subclasses. This change improves clarity by using a more descriptive term for error details. Also updated related methods to accommodate this change, including toString() and toMap().
Lowered the minimum coverage requirement in http_exception.yml from 90 to 89. Added anti-patterns to dart_code_linter in analysis_options.yaml. Deprecated NotImplementedException warning moved up in main.dart and added no-magic-number ignore rule in simple_test.dart.
The homepage URL in the pubspec.yaml file has been updated to point to a new location. This change does not affect the functionality of the code.
chore: updated null safety and configuration Github Actions
chore: updated null safety
Introduce Dedicated HTTP 4xx & 5xx Exception Classes, Streamline Testing & Workflow
Updated the build workflow to also trigger on push and pull requests for feature branches.
feat(workflows): Expand trigger branches
Introduced a new GitHub Actions workflow for automatic publishing to pub.dev upon tagging. The workflow triggers on push events with version-like tags and uses the dart-lang setup-dart action.
The build workflow has been updated to only trigger on pushes to the main branch, removing feature branches from the list.
Pull Request Test Coverage Report for Build 8043686759Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 8043686759Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
1 similar comment
Pull Request Test Coverage Report for Build 8043686759Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Introduced a new GitHub Actions workflow for automatic publishing to pub.dev upon tagging. The workflow triggers on push events with version-like tags and uses the dart-lang setup-dart action.