-
Notifications
You must be signed in to change notification settings - Fork 463
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
[main] Remove failure dependency #6282
Conversation
Remove error parameters from traits.
Unused and outdated.
be85d74
to
f1f07ee
Compare
So we're switching from typed errors to untyped We used to have a bunch of code that depended on the exact error type, specifically one in edgelet-http for setting the HTTP response code appropriately and one related to external provisioning IIRC. Both of those are gone now, so I guess having untyped errors doesn't create any immediate problems, but I worry we're locking ourselves out of ever being able to do anything with the specific errors if we need to. Edit: As discussed over Teams, the alternative is too much effort - every error variant that's used with |
Another alternative (when performance is not a concern) is downcasting on the errors in anyhow::Error::chain. |
Only remaining task is to upgrade from clap 2 to 3.
f88202f
to
fb8e43d
Compare
- Pipeline updates
46dff45
to
195def0
Compare
(My worry about downcasting is not so much the performance but that it's easy to downcast at the wrong level, and thus not find the error type you were looking for / find a different error of the same type that is irrelevant. You can't make that mistake with typed errors.) |
Yes, it would not be something you could do without first getting an idea of what kinds of errors to expect. In any case, we have options for reintroducing typed errors if they become necessary. |
* Longhaul: Fix tolerance for broker enabled messaging (#6183) (#6239) Cherry pick #6183 ## Azure IoT Edge PR checklist: * Move edge-modules/MetricsCollector to test/modules/TestMetricsCollector (#6240) Move test metrics collector into test directory for clarity and consistency w/ 1.1 branch. These changes were tested by running a build images pipeline followed by E2E and Connectivity Test pipelines. ## Azure IoT Edge PR checklist: * [Tools] Addition of libssl1.0 check and refactor the script (#6242) * Added checks for libssl 1.0 when 1.1 is not present * Refactored shared lib check to simplify the checks * Grouped all variables to the top of files * Grouped all the function's util functions and renamed them * Removed storage check logic to a separate function so only the names of the function remain in aziotedge_check() for code readability and debug purposes * [main] Upgrade Rust toolchain (#6206) This is our monthly toolchain upgrade to the latest stable version. Since iotedge/edgelet is a binary package, we want to be tracking Rust compiler releases closely in the event a stdlib vulnerability is found. We do not pin to "stable", however, since that has caused pipeline breakage when some code patterns are made illegal (like in the upgrade from 1.47 to 1.48 [^0]) or, more often, clippy lints are added. - Add `#[must_use]` directives on methods returning `Self` - Change `unwrap_or_else(...::new)` to `unwrap_or_default` where appropriate - Box `CertIssuanceOptions` in `EdgeCa` enum due to large variant size difference otherwise ## Azure IoT Edge PR checklist: * Allow apt-get to wait up to 5 minutes on lock. (#6259) Allow apt-get to wait up to 5 minutes on lock. This option should work on apt-get Version 1.9.11 or later, but experimentation shows this only works for "install" and not "update" so it may not fix all problems * [main] Add must_use attributes to methods returning Self (#6268) Satisfy clippy. ## Azure IoT Edge PR checklist: * Document for IoT edge compatibility script (#6258) Documentation on usage of Compatibility script. * E2E: Fix proxy Manifest Trust Setup build step (#6266) Manifest Trust Setup build step isn't using proxy env vars. Fixing. ## Azure IoT Edge PR checklist: * [Platform Compatibility] Fix Resource Profiling for IoT Edge (#6271) Enhancements 1. Always get support bundle logs for analysis 2. Use the Configured Edge Agent Image for Bootstrapping IoT Edge ## Azure IoT Edge PR checklist: * [main] Device product information (#6262) Currently, the edge agent encodes some runtime information (e.g. EdgeAgent and .NET versions) as part of the product information connection parameter, which can then be used to examine device characteristics from management interfaces. Some users desire the ability to add system-level properties--such as kernel version--to the product information. This PR adds a configuration option for custom product information strings as well as an automated option which augments the existing runtime information with the following system parameters: - kernel name, release, architecture - OS name, release - system name, version, vendor Generated files: - edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Edgelet/version_2021_12_07/generatedCode/EdgeletHttpClient.cs Largely duplicated files: - edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Edgelet/version_2021_12_07/ModuleManagementHttpClient.cs - edgelet/api/managementVersion_2021_12_07.yaml ### General Guidelines and Best Practices - [x] I have read the [contribution guidelines](https://github.com/azure/iotedge#contributing). - [x] Title of the pull request is clear and informative. - [x] Description of the pull request includes a concise summary of the enhancement or bug fix. ### Testing Guidelines - [x] Pull request includes test coverage for the included changes. - Description of the pull request includes - [ ] concise summary of tests added/modified - [x] local testing done. * [main] Upgrade to latest Rust version (#6278) This is our monthly toolchain upgrade to the latest stable version. Since iotedge/edgelet is a binary package, we want to be tracking Rust compiler releases closely in the event a stdlib vulnerability is found. We do not pin to "stable", however, since that has caused pipeline breakage when some code patterns are made illegal (like in the upgrade from 1.47 to 1.48 [^0]) or, more often, clippy lints are added. - Change from `cloned()` to `copied()` since we can and to work around ICE: rust-lang/rust-clippy#8662 [^0]: https://github.com/rust-lang/rust/blob/master/RELEASES.md#compatibility-notes-11 Namely, the point on `mem::uninitialized`. ## Azure IoT Edge PR checklist: * Platform Compatibility : Use Docker Socket For Docker Engine API Check (#6281) A Device may not necessarily support Docker CLI to query Docker Engine API , even though it has a valid docker socket to communicate with. This PR Adds support for querying Docker Engine API from docker socket. Also fixes an issue where we were incorrectly querying Client API Version instead of Server API Version. ## Azure IoT Edge PR checklist: * UI for Platform compatibility script (#6274) * include cross and checks * Changing magenta color as it was over powering all the other messages * changes of certain messaging to debug logs. * [main] Rust toolchain upgrade fixes (#6283) Continuation of #6278. Resolves clippy failures not caught due to pipelines not triggering on changes to `rust-toolchain.toml`. ## Azure IoT Edge PR checklist: * Documentation on Memory and Storage profiling of IoT edge (#6254) * Setup of the profiling platform * Metrics used for profiling * Summary of the numbers after profiling * How compatibility scripts uses these metrics for doing memory and storage checks * Migrate to Dotnet 6 (#6214) This PR migrates main branch from dotnet 3.1 to dotnet 6.0. This is working off of Damon's prior PR here: #6185 Code changes on top of the linked PR are minor. Only notable things: 1. Removed symlinks from arm64 dockerfiles that are no longer needed 2. TempfilterFunctions module is still on dotnet 3, as base image doesn't support dotnet 6 for arm32 3. EdgeHub watchdog has to shell out to sleep rather than call `thread::sleep()` to bypass a bug in rust. Logged a bug with rust repo. 4. Various retries added in E2E test code to get around problems caused by dotnet 6. Logged bugs with SDK team where appropriate. 5. Upgrade rust artifact build OS for amd64/arm* platforms to ubuntu 20 (from ubuntu 18). Passing pipelines: 1. [Build Images](https://dev.azure.com/msazure/One/_build/results?buildId=54001600&view=results) 2. [CI](https://dev.azure.com/msazure/One/_build/results?buildId=53619492&view=results) 6. [E2E](https://dev.azure.com/msazure/One/_build/results?buildId=54004817&view=results) 7. [Nested E2E](https://dev.azure.com/msazure/One/_build/results?buildId=53668874&view=results) 8. [Connectivity](https://dev.azure.com/msazure/One/_build/results?buildId=53834451&view=results) 9. [Build Images Release](https://dev.azure.com/msazure/One/_build/results?buildId=53619579&view=results) ## Azure IoT Edge PR checklist: * Install .NET 6 in IoT Edge Compatibility Pipeline (#6286) * Enhance Docker Check * Use .NET 6 * [Platform Compatibility] Update aka.ms links (#6285) Update Platform Compatibility Tool and Documentation with correct aka.ms links ## Azure IoT Edge PR checklist: * [main] Remove failure dependency (#6282) The `failure` crate is deprecated and has been superseded by `thiserror` and `anyhow`. These changes remove dependencies on `failure` and replace them by `thiserror` and `anyhow` as appropriate. - Module{,Registry,Runtime}, MakeModuleRuntime no longer have an `Error` type parameter - Remove unused submodules of edgelet-core ## Azure IoT Edge PR checklist: * api proxy image update (#6265) Content: Updating the API proxy image because of new alpine version. Tests: Tested on amd64 in nested pipeline. Co-authored-by: Andrew Smith <als5ev@virginia.edu> Co-authored-by: Noel Campbell <7676015+nlcamp@users.noreply.github.com> Co-authored-by: gaya <33068020+ggjjj@users.noreply.github.com> Co-authored-by: onalante-msft <89409054+onalante-msft@users.noreply.github.com> Co-authored-by: David Robson <darobs@microsoft.com> Co-authored-by: hugues bouvier <33438817+huguesBouvier@users.noreply.github.com>
The
failure
crate is deprecated and has been superseded bythiserror
andanyhow
. These changes remove dependencies onfailure
and replace them bythiserror
andanyhow
as appropriate.Error
type parameterAzure IoT Edge PR checklist:
This checklist is used to make sure that common guidelines for a pull request are followed.
General Guidelines and Best Practices
Testing Guidelines