Skip to content

Conversation

hernanmd
Copy link

Added method to collect package users in the format expected as parameter of GitMigration>>authors: method.

The #collectPackageUsers: receives a package name which will be matched against all RPackages in the image searched using beginsWith: . Then all author Strings of methods of every selected package are collected. The asSet removes duplicate author names. Finally another filter removes empty author names usually found in method annotations. Resulting collection is sorted for a better later edition and formatted as parameter of authors: method.
Addition of e-mails is required manually.

Added test

…eter of GitMigration>>authors: method.

Added test
@coveralls
Copy link

Coverage Status

Coverage increased (+0.6%) to 78.042% when pulling ae04a3e on hernanmd:pharo6_010 into b886bc1 on peteruhnak:pharo6.

@peteruhnak
Copy link
Owner

Hi Hernan, can you please tell me what is difference between your pull request, and using the following?

migration allAuthors.

@hernanmd
Copy link
Author

hernanmd commented Jul 15, 2018

Hi Peter,

Please compare the following outputs:

The one suggested by this PR:

(GitMigration new collectPackageUsers: 'Colors') asArray. 
"
{'AliakseiSyrel'->#('Aliaksei Syrel' '@.'). 'DamienPollet'->#('Damien Pollet' '@.'). 'FernandoOlivero'->#('Fernando Olivero' '@.'). 'GuillermoPolito'->#('Guillermo Polito' '@.'). 'HenrikNergaard'->#('Henrik Nergaard' '@.'). 'MarcusDenker'->#('Marcus Denker' '@.'). 'NicolaiHess'->#('Nicolai Hess' '@.'). 'PavelKrivanek'->#('Pavel Krivanek' '@.'). 'PeterHugossonMiller'->#('Peter Hugosson Miller' '@.'). 'StephaneDucasse'->#('Stephane Ducasse' '@.'). 'VincentBlondeau'->#('Vincent Blondeau' '@.'). 'ar'->#('ar' '@.'). 'lr'->#('lr' '@.'). 'tk'->#('tk' '@.')}
"

with the one currently implemented using #allAuthors:

GitMigration new 
	projectName: 'Colors'; " --> NotFound "
	allAuthors.
	
GitMigration new 
	projectName: 'Fuel'; " FileDoesNotExist: File @ /Users/mvs/git_projects/GitMigration/pharo-local/package-cache/ConfigurationOfFuelMooseExtension-MarianoMartinezPeck.27.mcz "
	allAuthors.

The main feature is that this PR provides a ready-to-use parameters for the migration script:

| migration |
migration := GitMigration on: '{your_sthub_user}/{project_name}'.
migration cacheAllVersions.
migration projectName: project_name.
migration authors: migration collectPackageUsers.
migration
  fastImportCodeToDirectory: 'repository'
  initialCommit: '....'
  to: 'import.txt'

@peteruhnak
Copy link
Owner

Your solution makes two assumptions:

  • all project packages are loaded
  • the last author of a method was the only person that ever touched that method

Neither of these assumptions are usually correct. In fact GitMigration never even loads packages into Pharo. The only way to correctly know all the authors is to traverse the entire history.

Regarding your points

GitMigration new
projectName: 'Colors' " --> NotFound "

This is correct behavior, there's no project 'Colors'. I am not sure what you are expecting.

GitMigration new
projectName: 'Fuel'; " FileDoesNotExist: File @ /Users/mvs/git_projects/GitMigration/pharo-local/package-cache/ConfigurationOfFuelMooseExtension-MarianoMartinezPeck.27.mcz "
allAuthors.

This is bug unrelated to authors. It seems that it happens only for projects that are packaged with pharo (as they are already in cache so it doesn't try to load them again)... I would fix it, but I think all of these projects are already on github.

I can add the transform to #allAuthors though.

@peteruhnak peteruhnak closed this Oct 7, 2018
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.

3 participants