Skip to content

Maintainability Improvements#671

Closed
carlocorradini wants to merge 6 commits intobytebeamio:mainfrom
carlocorradini:maintainability
Closed

Maintainability Improvements#671
carlocorradini wants to merge 6 commits intobytebeamio:mainfrom
carlocorradini:maintainability

Conversation

@carlocorradini
Copy link
Contributor

@carlocorradini carlocorradini commented Aug 3, 2023

This PR tries to enhance the overall maintainability of rumqtt.
Note that this PR is not ready to be merged because the code style (clippy) must be applied to the code.
What has been changed:

  • Stale (bot) is a GitHub action
  • Better CI/CD with enhanced checks and automation
  • VSCode compatibility
  • All files must respect a format/coding standard for better consistency (e.g. .rs has fmt/clippy, .sh has prettier/shellcheck, etc...)
  • Added EditorConfig
  • Markdown linter via markdownlint
  • Prettier file formatter
  • Code spell checker via cspell. A lot of typos have been found and fixed
  • rumqttd Docker image is now based on gcr.io/distroless/cc (from Google) to enhance overall security since "it does not contain package managers, shells or any other programs you would expect to find in a standard Linux distribution"
  • Multi-manifest Docker image using Docker buildx. The new Docker image is arm64 (aarch64) and amd64 (x86_64)
  • More robust and fully configurable scripts (see scripts directory). Also POSIX compliant
  • rumqttverifier sources are now based on Typescript for better maintainability and more. Simply run npx ts-node path/to/script.ts instead of old node path/to/script.js
  • Cross compilation:
    • aarch64-unknown-linux-gnu -> rumqttd-1.0.0-aarch64-unknown-linux-gnu
    • aarch64-unknown-linux-musl -> rumqttd-1.0.0-aarch64-unknown-linux-musl
    • x86_64-unknown-linux-gnu -> rumqttd-1.0.0-x86_64-unknown-linux-gnu
    • x86_64-unknown-linux-musl -> rumqttd-1.0.0-x86_64-unknown-linux-musl
      I need to test Cross a little bit more but it seems to work without any problem. We could add Windows!
  • Updated release profile
    [profile.release]
    codegen-units = 1 # Better optimization
    lto = true # Link time optimization
    strip = true # Stripping
  • Minimum supported Rust version. I've set it to 1.64.0 due to Cross requirement but it can be changed to better suit your needs
  • Rust edition is set to 2021
  • Much more...

Please, let me know what you think and what you want to change/update/add/delete 🥳

PS: Thanks for developing rumqtt*

@carlocorradini
Copy link
Contributor Author

carlocorradini commented Aug 3, 2023

The CI fails due to clippy (pedantic)

@de-sh
Copy link
Contributor

de-sh commented Aug 7, 2023

Hi @carlocorradini, thanks for opening this PR!

We would really appreciate it if you could divide the changes included in this PR and open separate PRs to resolve issues at an atomic level. This will help us greatly with the code review process that we adhere to.

Here is an example of what the PRs could look like:

  • feat: configure dependabot
  • ci: cross-compile rumqttd binaries

In the meanwhile, I will have to close this PR as it is just not feasible for us to review the entirety of this given our extremely constrained bandwidth. Thank you for understanding! 😄

@carlocorradini
Copy link
Contributor Author

@de-sh No problem
I understand 😊

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