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

Move all actions to CB::Action module. #46

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

abrightwell
Copy link
Member

@abrightwell abrightwell commented Jun 14, 2022

This is not a functional change. Here we're only seeking to organize the
code a little bit further now that the action list has grown quite
extensively.

The impetus for this was originally stated as a comment in #45 about how we had a name conflict between Token and TokenAction and wanting to maybe clean that up a little.

Candidly, I'm not sure how I feel about this one overall. I do think that giving actions their own module is a good thing, however, I'm less confident in how I've accomplished that here. More specifically, I toyed with the idea of CB::Action vs Action... and I tried both. I ultimately landed on CB::Action as it just felt a little better to me. However, I have no strong opinion here.

The other thing I did was I went through and move all the of the CB::Action::<name> declarations under a module CB::Action block. That resulted in a lot of 'files' appearing as changed given that it formatted them differently. However, the above is the only real change to these files.

I also opted to move the actions to their own directory. I don't think this is the final form as I wasn't certain what to do with the scope_checks directory. Seems like it might be appropriate to move it along with the scope.cr file. Also, dirs.cr I was a little on the fence about, but felt it was best left where it was for now.

At any rate, this is just an initial swing at this but accepted that it could potentially use some polish and it might not be the only swing at it.

This is not a functional change. Here we're only seeking to organize the
code a little bit further now that the action list has grown quite
extensively.
@abrightwell abrightwell requested a review from will June 14, 2022 15:10
@@ -42,26 +42,26 @@ private class BackupTestClient < CB::Client
end

private def make_ba
CB::BackupCapture.new(BackupTestClient.new(TEST_TOKEN))
CB::Action::BackupCapture.new(BackupTestClient.new(TEST_TOKEN))
Copy link
Collaborator

Choose a reason for hiding this comment

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

One thing that might be worth trying, is if we include CB::Action once at the top of a spec, then I think everywhere in that file we can just have BackupCapture. It might cut down on a lot of the extra scoping and be okay enough for a given file at a time?

@will
Copy link
Collaborator

will commented Jun 15, 2022

I like grouping them in the directory for sure

@abrightwell abrightwell requested a review from a team as a code owner January 23, 2024 13:24
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.

None yet

2 participants