-
Notifications
You must be signed in to change notification settings - Fork 6
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
Refactor: consolidate forum parameters and confirmation parameters into a single structure. #1290
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…to a single structure. The 'SubmissionParameters' structure has sprung to existence to include the `ForumParameters` and `ConfirmationModeOptions' structs, and is now used when appropriate (in operations that require forum post parameters and can be affected by confirmation modes, e.g., dry run, confirm, unconditional). These changes, together with prior changes that consolidate forum post management and proposal simulation / execution, make the code more maintainable, more explicit about what is taking place, and pave the way for imbuing the `Proposable` types with knowledge about how to deal with the forum based on what the type of `Proposable`. Noteworthy in light of the last sentence: now the Submitter type method `propose()` accepts a `ProposalExecution` (tied to a `Proposable`) next to a forum post type. Soon, the type of forum post can be dictated by the `ProposalExecution` itself, which makes sense, as we already have fixed forum post types for different proposals, but this knowledge is currently (incorrectly) hardcoded in an ad-hoc manner throughout various parts of the code.
DFINITYManu
commented
Feb 19, 2025
DFINITYManu
commented
Feb 19, 2025
DFINITYManu
commented
Feb 19, 2025
503b7fb
to
9b9752e
Compare
… Simplified graph to be posted in PR soon.
Interdependencies between modules were insane. I have removed many cycles from the `use` graph through the application of `cargo-graphmod`.
DFINITYManu
commented
Feb 19, 2025
DFINITYManu
commented
Feb 19, 2025
DFINITYManu
commented
Feb 19, 2025
DFINITYManu
commented
Feb 19, 2025
sasa-tomic
approved these changes
Feb 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for taking on this huge quality of life improvement!
d9cc192
to
68c6918
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What has happened here:
use
dependencies.auth.rs
.ExecutableCommand
stuff moved toctx
module, since (despite the name) it's just a vehicle to create aCtx
for commands to use. I will revise this abstraction later on -- I think it may ultimately not be necessary.lib.rs
instead of double importing inmain.rs
. Removes source of confusion and speeds up compilation.confirm.rs
to clear up confusion and the import graph.forum.rs
moves tosubmitter.rs
since it has dual responsibility (submit proposals and manage forum posts) so having it as a separate file adds clarity.proposal_executors.rs
move togovernance.rs
for the governance executor andic_admin.rs
for the ic-admin executor, breaking up an important import cycle.One important change not in the list above:
The
SubmissionParameters
structure has sprung to existence to include theForumParameters
andConfirmationModeOptions
structs, and is now used when appropriate (in operations that require forum post parameters and can be affected by confirmation modes, e.g., dry run, confirm, unconditional).These changes, together with prior changes that consolidate forum post management and proposal simulation / execution, make the code more maintainable, more explicit about what is implemented or happening and where it is, and pave the way for imbuing the
Proposable
types with knowledge about how to deal with the forum based on what the type ofProposable
.Noteworthy in light of the last sentence: now the Submitter type method
propose()
accepts aProposalExecution
(tied to aProposable
) next to a forum post type. Soon, the type of forum post can be dictated by theProposalExecution
(effectively, theProposable
) itself, which makes sense, as we already have fixed forum post types for different proposals, but this knowledge is currently (incorrectly) hardcoded in an ad-hoc manner throughout various parts of the code.Important change: we hereby sunset the ability to pass
--yes
,--no
and--forum-post
stuff at arbitrary positions in the command line. These are now accepted only after the subcommand name.clap
-- or perhaps our use ofclap
-- does not give us flexibility in parsing these flags anywhere in the command line. I removed error-prone code that tried to guess (with only a moderate chance of success) under certain circumstances what the user meant.Find most current import graphs attached here:
Not all cycles have been eliminated!