Skip to content
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

Macro to implement the source trait #2377

Merged
merged 15 commits into from
Mar 19, 2025

Conversation

sfauvel
Copy link
Collaborator

@sfauvel sfauvel commented Mar 18, 2025

Content

Simplify the implementation of Source trait using macros.

This PR:

  • Add the crate mithril-cli-helper that contains tools only used by client.
  • Implement macros to simplify duplicated code for Source implementation
  • Apply the macro to all the Source implementations in the repository

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Crates versions are updated (if relevant)
    • CHANGELOG file is updated (if relevant)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
  • PR
    • All check jobs of the CI have succeeded
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested
  • Documentation
    • Update README file (if relevant)
    • Update documentation website (if relevant)
    • Add dev blog post (if relevant)
    • Add ADR blog post or Dev ADR entry (if relevant)
    • No new TODOs introduced

Comments

Issue(s)

Closes #2365

@sfauvel sfauvel force-pushed the sfa/2365/macro_to_implement_the_source_trait branch from 68cda04 to 121efca Compare March 18, 2025 10:34
Copy link

github-actions bot commented Mar 18, 2025

Test Results

    3 files  ±0     57 suites  +1   11m 42s ⏱️ +6s
1 772 tests +7  1 772 ✅ +7  0 💤 ±0  0 ❌ ±0 
2 170 runs  +7  2 170 ✅ +7  0 💤 ±0  0 ❌ ±0 

Results for commit e8bf4be. ± Comparison against base commit 6408d5c.

This pull request removes 1 and adds 8 tests. Note that renamed tests count towards both.
mithril-stm ‑ multi_sig::tests::test_gen
mithril-cli-helper ‑ source_config::tests::test_collect_source_values
mithril-cli-helper ‑ source_config::tests::test_register_config_value_bool_macro_add_only_true_values
mithril-cli-helper ‑ source_config::tests::test_register_config_value_macro
mithril-cli-helper ‑ source_config::tests::test_register_config_value_macro_add_value
mithril-cli-helper ‑ source_config::tests::test_register_config_value_macro_with_mapping_transform_value_before_adding_it
mithril-cli-helper ‑ source_config::tests::test_register_config_value_macro_with_the_value
mithril-cli-helper ‑ source_config::tests::test_register_config_value_option_macro_not_add_none_value
mithril-cli-helper ‑ source_config::tests::test_register_config_value_option_macro_with_mapping_transform_value_before_adding_it

♻️ This comment has been updated with latest results.

@sfauvel sfauvel temporarily deployed to testing-preview March 18, 2025 10:42 — with GitHub Actions Inactive
@sfauvel sfauvel force-pushed the sfa/2365/macro_to_implement_the_source_trait branch 2 times, most recently from 431b1ea to f19bcea Compare March 18, 2025 12:48
@sfauvel sfauvel temporarily deployed to testing-preview March 18, 2025 12:58 — with GitHub Actions Inactive
@sfauvel sfauvel force-pushed the sfa/2365/macro_to_implement_the_source_trait branch from 84ad4b2 to a34c7a6 Compare March 18, 2025 14:36
@sfauvel sfauvel force-pushed the sfa/2365/macro_to_implement_the_source_trait branch from a34c7a6 to 40ced91 Compare March 18, 2025 14:42
@sfauvel sfauvel temporarily deployed to testing-preview March 18, 2025 14:51 — with GitHub Actions Inactive
@sfauvel sfauvel marked this pull request as ready for review March 18, 2025 14:53
Copy link
Collaborator

@dlachaume dlachaume left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

Copy link
Collaborator

@Alenar Alenar left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@jpraynaud jpraynaud left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Can you also add an entry in the Makefile for the new crate and also in the tests for MacOS/Windows in the CI?

@sfauvel sfauvel temporarily deployed to testing-preview March 19, 2025 09:18 — with GitHub Actions Inactive
@sfauvel sfauvel temporarily deployed to testing-preview March 19, 2025 09:40 — with GitHub Actions Inactive
* mithril-doc from `0.1.17` to `0.1.18`
* mithril-aggregator from `0.7.17` to `0.7.18`
* mithril-client-cli from `0.11.9` to `0.11.10`
* mithril-signer from `0.2.234` to `0.2.235`
* mithril-stm from `0.3.39` to `0.3.40`
@sfauvel sfauvel temporarily deployed to testing-preview March 19, 2025 10:14 — with GitHub Actions Inactive
@sfauvel sfauvel merged commit ba14422 into main Mar 19, 2025
36 checks passed
@sfauvel sfauvel deleted the sfa/2365/macro_to_implement_the_source_trait branch March 19, 2025 10:19
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.

Use a macro to implement the Source trait
4 participants