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
refactoring the Release script #381
Conversation
@@ -466,7 +404,7 @@ sub import_tarball { | |||
} | |||
} | |||
if (@provides) { | |||
$release->provides( [ sort @provides ] ); | |||
$release->provides( \@provides ); |
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.
Why did you remove the sort
?
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.
In the new version I did not, this why I said I messed up with git, I solved some merge conflicts and deleted some things that shouldn't have been deleted. The sort stays.
I have not put 'isa' everywhere because I am not sure how to add their type. |
4b9e2a8
to
5436277
Compare
@@ -95,6 +95,7 @@ requires 'MooseX::ClassAttribute'; | |||
requires 'MooseX::Getopt'; | |||
requires 'MooseX::Getopt::Dashes'; | |||
requires 'MooseX::Getopt::OptionTypeMap'; | |||
requires 'MooseX::StrictConstructor'; |
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.
When you add a new module, make sure you run carton and then commit the changes to cpanfile.snapshot so that we can mimic your installed modules in production.
9e3769b
to
f7fc9dc
Compare
Then if we change how archives are extracted in the future it only has to be done in one place. MC::Model::Archive deliberately does not clean up a directory given to it, we don't know the caller's intent, but it does use a temp directory by default. Someone can add an option later if it's needed.
Needed to allow the model to make the MC::Document::Release.
"document" is more descriptive of what it is than "release" in the context of the release script.
In the context of the release script, $release_model is redundant.
This will be used by MC::Model::Archive and the like to coerce relative paths into absolute to protect against chdir'ing.
This protects against chdir'ing. As more lazy initialization is used, this becomes more of a concern. File::Find, for example, is a problem.
This lets it derive its own attributes, easier to instantiate. It also gives it everything necessary to create an MC::Document::Release which is where we're heading next. Note: The fixed version was never used before. Now it is.
I'm not happy that building it also indexes it, but I don't know how to instanciate a document without also adding it to the index.
1 similar comment
More efficient when it's called multiple times, and it's going to be as import_archive is split up further.
Bring it all together into one method for getting the modules.
I'm done refactoring. It's far from perfect, I was very rote and conservative and leaned heavily on the existing tests. There's some attribute name inconsistencies between Document::Release, Script::Release and Model::Release it would be nice to resolve. This is enough to start hooking in Gitpan. |
After all that code being moved around between the two modules.
I don't see anything here which causes me any concerns. Also, I feel like this is a nice cleanup over the existing code. It's way less confusing now that things are more compartmentalized. I'd like to leave this open for a day or two while we get some more feedback, but I also don't want to leave this open for very long. If there's no dissent, I say we merge this on Monday (Feb 23). @andreeap how much have you tested this? If you haven't done a full re-index via this branch, now would be a good time to kick that off. |
I have tested this on my VM and everything seemed fine at indexing, but I was indexing more than one release and when I tried with just one I noticed that for every release I will get 3 x
|
No, it's only being extracted once, but it's being asked to be extracted multiple times. The logging for extract is in
It might make more sense to add a log initialization function to a test helper module. I'll get on fixing this. |
I'm going to merge this now, since overly verbose logging seems like a secondary concern. |
refactoring the Release script
Sorry, I got distracted. |
This is from Friday, still learning.